Skip to content

Commit

Permalink
Relplat 897 copywrite bot workarounds (#19200)
Browse files Browse the repository at this point in the history
Co-authored-by: Ronald Ekambi <ronekambi@gmail.com>
  • Loading branch information
modrake and roncodingenthusiast authored Oct 16, 2023
1 parent a7fbd00 commit 3716b69
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 3716b69

Please sign in to comment.