Skip to content

Commit

Permalink
Backport of Relplat 897 copywrite bot workarounds into release/1.17.x (
Browse files Browse the repository at this point in the history
…#19217)

* backport of commit 30051fc

* backport of commit 5b71320

* backport of commit 9603006

---------

Co-authored-by: Morgan Drake <12264057+modrake@users.noreply.github.com>
Co-authored-by: Ronald Ekambi <ronekambi@gmail.com>
  • Loading branch information
3 people authored Oct 16, 2023
1 parent 3764c96 commit 449f190
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ codegen: codegen-tools ## Deep copy
@$(SHELL) $(CURDIR)/agent/consul/state/deep-copy.sh
@$(SHELL) $(CURDIR)/agent/config/deep-copy.sh
copywrite headers
# Special case for MPL headers in /api and /sdk
cd api && $(CURDIR)/build-support/scripts/copywrite-exceptions.sh
cd sdk && $(CURDIR)/build-support/scripts/copywrite-exceptions.sh

print-% : ; @echo $($*) ## utility to echo a makefile variable (i.e. 'make print-GOPATH')

Expand Down
8 changes: 8 additions & 0 deletions api/.copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
schema_version = 1

project {
license = "MPL-2.0"
copyright_year = 2023

header_ignore = []
}
3 changes: 3 additions & 0 deletions api/config_entry_routes_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package api

import (
Expand Down
3 changes: 3 additions & 0 deletions api/config_entry_status_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package api

import "testing"
Expand Down
3 changes: 3 additions & 0 deletions api/internal.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package api

import "context"
Expand Down
3 changes: 3 additions & 0 deletions api/internal_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package api

import (
Expand Down
2 changes: 1 addition & 1 deletion api/operator_audit.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
// SPDX-License-Identifier: MPL-2.0

// The /v1/operator/audit-hash endpoint is available only in Consul Enterprise and
// interact with its audit logging subsystem.
Expand Down
14 changes: 14 additions & 0 deletions build-support/scripts/copywrite-exceptions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# Used as a stopgap for copywrite bot in MPL-licensed subdirs, detects BUSL licensed
# headers and deletes them, then runs the copywrite bot to utilize local subdir config
# to inject correct headers.

find . -type f -name '*.go' | while read line; do
if grep "SPDX-License-Identifier: BUSL-1.1" $line; then
sed -i '/SPDX-License-Identifier: BUSL-1.1/d' $line
sed -i '/Copyright (c) HashiCorp, Inc./d' $line
fi
done

copywrite headers
8 changes: 8 additions & 0 deletions sdk/.copywrite.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
schema_version = 1

project {
license = "MPL-2.0"
copyright_year = 2023

header_ignore = []
}
3 changes: 3 additions & 0 deletions sdk/testutil/retry/counter.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package retry

import "time"
Expand Down
3 changes: 3 additions & 0 deletions sdk/testutil/retry/timer.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package retry

import "time"
Expand Down

0 comments on commit 449f190

Please sign in to comment.