Skip to content

Conversation

@CreatorHead
Copy link
Contributor

πŸ› οΈ Description

πŸ”— External Links

πŸ‘ Definition of Done

  • New functionality works?
  • Tests added?

πŸ€” Can be merged upon approval?

βœ…

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.

  • If applicable, I've documented the impact of any changes to security controls.

    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

@CreatorHead CreatorHead requested a review from a team as a code owner December 23, 2025 06:15
- Add detectFirstCommitYear() function to auto-detect first commit year
- Update FormatCopyrightYears() to use auto-detection when copyright_year not set
- Graceful fallback to current year if git unavailable
- Explicit copyright_year in config always takes precedence
- Add comprehensive unit tests for auto-detection
- Update README documentation to explain auto-detection behavior

This enhancement eliminates the need to manually configure copyright_year
for existing repositories, reducing configuration time from ~30min to ~2min
per repo for the TF-337 rollout.
- Add fetch-depth: 0 to checkout action in golang-test job
- This ensures git log can find the first commit for auto-detection
- Revert test to strict validation now that full history is available
Copy link
Contributor

@mohanmanikanta2299 mohanmanikanta2299 left a comment

Choose a reason for hiding this comment

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

Recommendation:

  • I think the better approach would be to fetch the year-1 information from workflow and pass it as parameter into copywrite tool.
  • For private and internal repos, it might face authentication issues. GH APP Token and Key will be present in the GH secrets and they can be used to authenticate to any repo across Hashicorp Organisation.
  • Workflows will stay in the Copyright-notice-automation repo which is private so key will be not exposed as well.
  • For repos where copyright year is different from the first commit year, teams can reach out and we can either hardcode that information in copyright-notice-automation repo or save the year in config(giving it higher priority).

Code is still missing update on files where code changes are made. If a file is updated then the year-2 should be updated only for that file, rather than the entire repo. That functionality needs to be introduced.

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.

2 participants