-
Notifications
You must be signed in to change notification settings - Fork 22
Ibm copyright format #180
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
Ibm copyright format #180
Conversation
- 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.
86a09c8 to
c6e2416
Compare
- 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
There was a problem hiding this 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.
- Changed template from 'Copyright (c) YEAR HOLDER' to 'Copyright (c) HOLDER YEAR' - Now produces correct IBM format: 'Copyright (c) IBM Corp. 2023, 2026' - Updated both tmplSPDX and tmplCopyrightOnly templates
mohanmanikanta2299
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
π οΈ Description
π External Links
π Definition of Done
π€ 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.