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

[COMPLIANCE] Add copyright and license headers #292

Merged
merged 10 commits into from
Jun 5, 2023
Merged

Conversation

austinvalle
Copy link
Member

@austinvalle austinvalle commented Jun 5, 2023

Closes #259

This PR introduces:

  • Add new tools module, add to dependabot, and move GRPC program to tools module dependencies
  • make generate command that will auto-generate all copyright headers for this repo (hooks into go generate)
  • make tools command to simplify the installation process of the Go specific tooling for make protoc target
    • Updated GH workflow to use this make tools command
  • GH workflow that will error if copyright headers aren't present or if license is malformed
  • Addition to the CONTRIBUTING.md on how to run license autogenerating commands

@austinvalle austinvalle requested a review from a team as a code owner June 5, 2023 16:14
.copywrite.hcl Outdated
# Release Engineering tooling configuration
".release/*.hcl",

# Proto and protoc generated files
Copy link
Member Author

Choose a reason for hiding this comment

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

Along with the auto-generated files, I also ignored the .proto file, is that okay?

I believe comments would persist to the auto-generated file as well if we wanted to just ignore the auto-generated files only, i.e. *.pb.go and then I can run a make protoc

Copy link
Member

Choose a reason for hiding this comment

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

Hm the .proto files probably should have the copyright headers as they are intellectual property related. 👍 I thought the issue we saw elsewhere was that the comment would be injected into the middle of the .pb.go file instead of the top like copywrite wants, but maybe that's mistaken! grpc/grpc-go#5540 seems to suggest from the testing files that both protoc-gen-go and protoc-gen-go-grpc can put the comments at the top, maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool! I added an ignore just for the .pb.go files and then ran a make protoc:

 $ make generate
cd tools; go generate ./...
Using license identifier: MPL-2.0
Using copyright holder: HashiCorp, Inc.

Exempting the following search patterns:
.changes/unreleased/*.yaml
.changie.yaml
.github/ISSUE_TEMPLATE/*.yml
.github/labeler-*.yml
.golangci.yml
.goreleaser.yml
.release/*.hcl
tfprotov5/internal/tfplugin5/*.pb.go
tfprotov6/internal/tfplugin6/*.pb.go

The following files are missing headers:
2023-06-05T12:31:48.015-0400 [INFO]  cli: tfprotov5/internal/tfplugin5/tfplugin5.proto modified
2023-06-05T12:31:48.016-0400 [INFO]  cli: tfprotov6/internal/tfplugin6/tfplugin6.proto modified

@austinvalle austinvalle added this to the v0.16.0 milestone Jun 5, 2023
Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀

Makefile Show resolved Hide resolved
tools/tools.go Show resolved Hide resolved
.copywrite.hcl Outdated Show resolved Hide resolved
Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀

Co-authored-by: Brian Flad <bflad417@gmail.com>
@austinvalle austinvalle merged commit 9303150 into main Jun 5, 2023
49 checks passed
@austinvalle austinvalle deleted the av/compliance branch June 5, 2023 18:08
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants