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

fix: update copyright year in Java license header replacement template #1810

Merged
merged 5 commits into from
Jun 7, 2023

Conversation

emmileaf
Copy link
Contributor

@emmileaf emmileaf commented Jun 6, 2023

Following up to Java generator's copyright year fix and discussion in googleapis/sdk-platform-java#1720 (comment) with post-processor fix.

Todos:

  • Fix copyright year
  • Update golden files (instructions) for Java OwlBot Image Tests
  • Update golden files for tests in test_language_java.py
  • Check locally built docker image against java-storage (split repo) - no changes to existing files
  • Check locally built docker image against google-cloud-java (monorepo) - no changes to existing files

@emmileaf emmileaf marked this pull request as ready for review June 6, 2023 19:25
@emmileaf emmileaf requested a review from suztomo June 6, 2023 19:27
@dandhlee
Copy link
Contributor

dandhlee commented Jun 6, 2023

FYI this is optional and not required to update every year - copyright should reflect when these changes were first introduced, and it's better to have coverage to older years than risk not having potential coverage for previous years.

Generated files can be updated, while other files should not have it license updated.

@emmileaf
Copy link
Contributor Author

emmileaf commented Jun 6, 2023

Ah that makes sense, thanks for the heads up @dandhlee!

For a bit of context - the intention of this change was to fix the header years in newly generated files where this logic is applied to (e.g. in googleapis/google-cloud-java#9480), so that their headers have 2023 rather than 2020.

That said, is the concern here that the change might unintentionally modify headers on existing files as part of the generation process? Maybe a better fix might be to parse out the year from “BAD_LICENSE” and use that instead of a hard-coded value though - I can take a look at that approach as an alternative here.

Edit: I was under the wrong assumption; this template change will possibly apply the copyright year update to a subset of auto-generated proto classes and grpc stub classes, whether existing or new.

@dandhlee
Copy link
Contributor

dandhlee commented Jun 6, 2023

For autogenerated files either is fine - they can be 2020 or 2023, doesn't matter (as long as we're consistent about it). Existing files can also get copyright updates if they're autogenerated files.

Just want to let you know that this is an optional change and it is not strictly necessary that these files have to say they're in the current year.

@emmileaf emmileaf changed the title fix: update copyright year in Java license header replacement fix: update copyright year in Java license header replacement template Jun 7, 2023
@emmileaf emmileaf merged commit 38ad636 into master Jun 7, 2023
@emmileaf emmileaf deleted the java-license-year-patch branch June 7, 2023 16:06
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.

5 participants