Skip to content

Add a license check for new files #13806

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iyabchen
Copy link
Contributor

@iyabchen iyabchen commented Apr 28, 2025

hashicorp/terraform-provider-google#20127

  • Check license type (using a go-licenses library)
  • Check copyright year (using strings.Contains)

Tested in #13805.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@iyabchen iyabchen requested a review from shuyama1 April 29, 2025 21:39
@iyabchen iyabchen marked this pull request as ready for review April 29, 2025 21:39
Copy link

github-actions bot commented May 2, 2025

@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

github-actions bot commented May 6, 2025

@GoogleCloudPlatform/terraform-team @shuyama1 This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Hey @melinath, just want to confirm with you if this change addresses what's asked in hashicorp/terraform-provider-google#20127

This license text validation is currently implemented to check files in the mmv1 folder. We'd like to confirm if this is the desired scope, or should it be broader?

Also, the ticket description mentions "We should automate validation of its presence and correctness". Could you please clarify what specific aspects of correctness this should be validating?

@melinath
Copy link
Member

melinath commented May 6, 2025

Correctness:

  • Is the license text being added the correct license text?
  • Does it have the current year

Which files: Basically, any files that correspond to other files that currently have it. MMv1 yaml, definitely. tpgtools we can ignore for now because it's not getting new stuff added. I'm not sure if there are other files.

We should only be running this check for files modified in the current PR.

@github-actions github-actions bot requested a review from shuyama1 May 8, 2025 21:17
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

1 similar comment
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@iyabchen
Copy link
Contributor Author

iyabchen commented May 8, 2025

The current code is checking only the mmv1 folder for .tmpl, .go, .yaml files, and only for new files. If checking for just modified files, then many files will need a touch for the copyright year.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

Copy link

@shuyama1 This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants