Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: convert more license headers to SPDX #17151

Merged
merged 1 commit into from Aug 19, 2021
Merged

treewide: convert more license headers to SPDX #17151

merged 1 commit into from Aug 19, 2021

Conversation

twpayne
Copy link
Contributor

@twpayne twpayne commented Aug 12, 2021

Running tools/spdxconv caught a few files not using SPDX, mostly because they were new files created just before the SPDX change.

Refs #16887.

Signed-off-by: Tom Payne tom@isovalent.com

@twpayne twpayne added the release-note/misc This PR makes changes that have no direct user impact. label Aug 12, 2021
@twpayne twpayne requested review from ldelossa and a team August 12, 2021 14:18
@twpayne twpayne requested a review from a team as a code owner August 12, 2021 14:18
@twpayne twpayne requested a review from a team August 12, 2021 14:18
@twpayne twpayne requested a review from a team as a code owner August 12, 2021 14:18
@twpayne twpayne requested a review from a team August 12, 2021 14:18
@twpayne twpayne requested review from a team as code owners August 12, 2021 14:18
@ti-mo
Copy link
Contributor

ti-mo commented Aug 12, 2021

Consider me out of the loop, but how do generated files get their SPDX (or license) headers?

ti-mo
ti-mo previously approved these changes Aug 12, 2021
@glibsm
Copy link
Member

glibsm commented Aug 12, 2021

Upon running make in the api/v1 the license is restored back to fully apache2

> git status
On branch pr/twpayne/more-spdx
nothing to commit, working tree clean

> cd api/v1; make
[...]
make: Leaving directory '/src'

> git status
On branch pr/twpayne/more-spdx
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   flow/flow.pb.go
        modified:   observer/observer.pb.go
        modified:   peer/peer.pb.go
        modified:   recorder/recorder.pb.go
        modified:   relay/relay.pb.go

no changes added to commit (use "git add" and/or "git commit -a")

> git diff flow/flow.pb.go
diff --git a/api/v1/flow/flow.pb.go b/api/v1/flow/flow.pb.go
index 917597c413..5f5aabcc70 100644
--- a/api/v1/flow/flow.pb.go
+++ b/api/v1/flow/flow.pb.go
@@ -1,5 +1,16 @@
-// SPDX-License-Identifier: Apache-2.0
 // Copyright 2019 Authors of Hubble
+//
+// 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.

Copy link
Member

@glibsm glibsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell the license is copied from the .proto file when the code is generated.

❯ head -3 observer/observer.proto
// This is my custom license setup.
// Copyright 2019 Authors of Hubble


❯ head -3 observer/observer.pb.go
// SPDX-License-Identifier: Apache-2.0
// Copyright 2019 Authors of Hubble

❯ make
[...]
make: Leaving directory '/src'

❯ head -3 observer/observer.pb.go
// This is my custom license setup.
// Copyright 2019 Authors of Hubble

@ldelossa
Copy link
Contributor

the original commit that introduced the spdxconv tool only updated this file:

https://github.com/cilium/cilium/blob/master/hack/custom-boilerplate.go.txt

@glibsm I thought that was going to take care of any protobuf gens and make generated files use the correct license header.

@ti-mo ti-mo dismissed their stale review August 13, 2021 09:10

Needs more work to account for generated files

@twpayne twpayne requested a review from glibsm August 13, 2021 13:57
@twpayne
Copy link
Contributor Author

twpayne commented Aug 13, 2021

OK, .proto files updated, and I've verified that make generate-hubble-api propagates the SPDX licence header from the .proto file to the generated .pb.go.

Running tools/spdxconv caught a few files not using SPDX.

Signed-off-by: Tom Payne <tom@isovalent.com>
@twpayne
Copy link
Contributor Author

twpayne commented Aug 13, 2021

Note that this is a documentation-only change.

The CI failure in the ConformanceKind1.19 / installation-and-connectivity check looks similar to #16392.

@twpayne twpayne added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 18, 2021
@tklauser tklauser merged commit ddd9ed7 into cilium:master Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants