Skip to content

Commit

Permalink
lint: require license headers for .sh, .py, makefiles
Browse files Browse the repository at this point in the history
Some file types generally did not use license headers before. Now .sh,
.py and makefile files will be required to include license headers. The
license header linter will enforce the requirement. All non-compliant
files are now updated with the correct headers.

Part of RE-658

Release note (general change): Change the license cockroach is
distributed under to the new CockroachDB Software License (CSL).
  • Loading branch information
jlinder committed Oct 17, 2024
1 parent 1cdc2eb commit 6571d59
Show file tree
Hide file tree
Showing 306 changed files with 1,839 additions and 71 deletions.
14 changes: 3 additions & 11 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
# Copyright 2022 The Cockroach Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

.PHONY: all
all: build
$(MAKE) help
Expand Down
6 changes: 6 additions & 0 deletions build/bazelutil/bazel-generate.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2021 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euo pipefail

# files_unchanged_from_upstream takes file globs as arguments and checks
Expand Down
6 changes: 6 additions & 0 deletions build/bazelutil/check.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2021 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euo pipefail

# This script performs assorted checks to make sure there is nothing obviously
Expand Down
6 changes: 6 additions & 0 deletions build/bazelutil/gopackagesdriver.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
#!/bin/bash

# Copyright 2022 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

exec bazel run -- @io_bazel_rules_go//go/tools/gopackagesdriver "${@}"
6 changes: 6 additions & 0 deletions build/bazelutil/stamp.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2021 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


# This command is used by bazel as the workspace_status_command
# to implement build stamping with git information.

Expand Down
6 changes: 6 additions & 0 deletions build/bootstrap/autoshutdown.cron.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2017 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


# This script is intended to be called periodical. If it doesn't detect remote
# sessions in a given number of consecutive runs, a shutdown is initiated.
#
Expand Down
6 changes: 6 additions & 0 deletions build/bootstrap/bootstrap-debian.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env bash

# Copyright 2017 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

#
# On a Debian/Ubuntu system, bootstraps a docker install and the cockroach
# repo.
Expand Down
6 changes: 6 additions & 0 deletions build/bootstrap/bootstrap-ssd.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env bash

# Copyright 2017 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

#
# Bootstraps Local SSD devices.
#
Expand Down
6 changes: 6 additions & 0 deletions build/bootstrap/bootstrap-unison.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env bash

# Copyright 2018 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

#
# On a Debian/Ubuntu system, bootstraps the Unison file-syncer.

Expand Down
6 changes: 6 additions & 0 deletions build/bootstrap/install-azure-cli.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env bash

# Copyright 2017 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

#
# On a Debian/Ubuntu system, installs the Azure CLI.

Expand Down
11 changes: 3 additions & 8 deletions build/deploy/cockroach.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#!/bin/bash
#

# Copyright 2021 The Cockroach Authors.
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.txt.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0, included in the file
# licenses/APL.txt.
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

# set -e: If the command returns a non-zero exit status, exit the shell.
# set -u: errors if an variable is referenced before being set
Expand Down
6 changes: 6 additions & 0 deletions build/disable-hyperv-timesync.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2017 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euxo pipefail

# Disabling hyper-v time synchronization means unbinding the device.
Expand Down
6 changes: 6 additions & 0 deletions build/ghactions/changed-go-pkgs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2023 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


BASE_SHA="$1"
HEAD_SHA="$2"

Expand Down
6 changes: 6 additions & 0 deletions build/ghactions/pr-codecov-run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2023 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -xeuo pipefail

output_json_file="$1"
Expand Down
6 changes: 6 additions & 0 deletions build/github/acceptance-test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euxo pipefail

set +x
Expand Down
5 changes: 5 additions & 0 deletions build/github/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

set -euxo pipefail

# Usage: must provide a cross config as argument
Expand Down
6 changes: 6 additions & 0 deletions build/github/check-generated-code.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euo pipefail

# This function dumps the output of the given file to $GITHUB_STEP_SUMMARY
Expand Down
6 changes: 6 additions & 0 deletions build/github/cleanup-engflow-keys.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euxo pipefail

rm -f /home/agent/engflow.key /home/agent/engflow.crt
6 changes: 6 additions & 0 deletions build/github/docker-image.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


#!/usr/bin/env bash
set -euxo pipefail

Expand Down
5 changes: 5 additions & 0 deletions build/github/engflow-args.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

# The intention is that you'll execute the script at the end of your Bazel
# invocation as follows: `bazel test ... $(engflow-args.sh)`. This will add
# remote execution arguments to the invocation. You must call get-engflow-keys.sh
Expand Down
6 changes: 6 additions & 0 deletions build/github/examples-orms.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euxo pipefail

pushd cockroach
Expand Down
6 changes: 6 additions & 0 deletions build/github/get-engflow-keys.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2023 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euxo pipefail

gcloud secrets versions access 2 --secret=engflow-mesolite-key > /home/agent/engflow.key
Expand Down
6 changes: 6 additions & 0 deletions build/github/lint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euxo pipefail

WORKSPACE=$(bazel info workspace)
Expand Down
6 changes: 6 additions & 0 deletions build/github/local-roachtest.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euxo pipefail

CROSSCONFIG=$1
Expand Down
6 changes: 6 additions & 0 deletions build/github/prepare-summarize-build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euxo pipefail

THIS_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
Expand Down
6 changes: 6 additions & 0 deletions build/github/summarize-build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


# You MUST run prepare-summarize-build.sh before running this script.

set -euxo pipefail
Expand Down
6 changes: 6 additions & 0 deletions build/github/unit-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euxo pipefail

EXTRA_PARAMS=""
Expand Down
6 changes: 6 additions & 0 deletions build/go-version-check.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2018 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


# Detect whether the installed version of Go can build this version of
# CockroachDB.
#
Expand Down
6 changes: 6 additions & 0 deletions build/instrumentation/gen_exclusions.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2022 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

echo "# Vendor Exclusions"
Expand Down
6 changes: 6 additions & 0 deletions build/instrumentation/vendor_antithesis.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env bash

# Copyright 2022 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.

set -eo pipefail

# NB: Currently, this script is only intended to work with `make instrument(short)`
Expand Down
6 changes: 6 additions & 0 deletions build/node-run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

# Copyright 2017 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


# node-run.sh runs a command installed by NPM/Yarn. It looks for COMMAND in
# ./node_modules/bin, where NPM/Yarn install commands by default, then invokes
# it with the specified ARGS, if any.
Expand Down
6 changes: 6 additions & 0 deletions build/oss-fuzz/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash -eu

# Copyright 2024 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


# Don't need the stdlib and libc++ gives linker error
CXXFLAGS="${CXXFLAGS/-stdlib=libc++/}"

Expand Down
6 changes: 6 additions & 0 deletions build/packer/setup_filebeat_on_teamcity_agent.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

# Copyright 2020 The Cockroach Authors.
#
# Use of this software is governed by the CockroachDB Software License
# included in the /LICENSE file.


set -euo pipefail

export FILEBEAT_CONFIG_PATH=/tmp/filebeat.yml
Expand Down
Loading

0 comments on commit 6571d59

Please sign in to comment.