Skip to content

Add prek hook to auto-update copyright year in NOTICE files#67146

Open
xchwan wants to merge 3 commits into
apache:mainfrom
xchwan:prek_range_year_current
Open

Add prek hook to auto-update copyright year in NOTICE files#67146
xchwan wants to merge 3 commits into
apache:mainfrom
xchwan:prek_range_year_current

Conversation

@xchwan
Copy link
Copy Markdown
Contributor

@xchwan xchwan commented May 19, 2026

issue: #60540

Airflow has 170+ NOTICE files that required manual year updates annually (e.g. 2016-2025 → 2016-2026) with no automation in place.

Adds update-notice-year hook


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
  • Claude Code Sonnet 4.6

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Signed-off-by: Xch1 <qchwan@gmail.com>
@boring-cyborg boring-cyborg Bot added area:dev-tools backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch labels May 19, 2026
@xchwan xchwan changed the title feat:update_notice_year Add prek hook to auto-update copyright year in NOTICE files May 19, 2026
@potiuk
Copy link
Copy Markdown
Member

potiuk commented May 19, 2026

This will have the undesirble side effect that all PRs will be failing 01.01.2027 when everyone who can help might be partying hard (and not wake up early next day).

I am not sure we want it. If anything - this could be manual prek hook, and we should have workflow scheduled maybe every week or so to check if the year changed and post notification on slack in the #internal-* channel like other notifications. The issue is that it's next to impossible to test before Jan 2027

@xchwan
Copy link
Copy Markdown
Contributor Author

xchwan commented May 20, 2026

I think the simplest fix is to strip the year check out of check_notice_files.py and keep only the ASF declaration check. The scheduled notification approach still requires someone to manually run update_notice_year.py at the end anyway. And if the update is done in late December, Copyright 2016-2027 would be incorrect while still in 2026, which check_notice_files.py would then reject — update early and the year is wrong, wait until 01/01 and everyone is at a New Year's party. So:

  • pre-commit only blocks genuine errors where the ASF declaration is missing entirely
  • PRs never fail due to year drift
  • Someone can run update_notice_year.py when they remember, and nothing explodes if they don't

How do you think about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants