Skip to content

chore(ci): fix header comment loss in update_overrides on repeated runs#503

Open
yogarajalakshmi-s wants to merge 3 commits into
kubeflow:mainfrom
yogarajalakshmi-s:chore/fix-update-overrides-header-loss
Open

chore(ci): fix header comment loss in update_overrides on repeated runs#503
yogarajalakshmi-s wants to merge 3 commits into
kubeflow:mainfrom
yogarajalakshmi-s:chore/fix-update-overrides-header-loss

Conversation

@yogarajalakshmi-s
Copy link
Copy Markdown

@yogarajalakshmi-s yogarajalakshmi-s commented May 25, 2026

What this PR does / why we need it:
When has_overrides=True, update_overrides.py removes the "# Security overrides" header comment but never re-adds it. On the next run, the insertion logic uses this header as a bookmark to know where to insert the override block — but since it was deleted, the block gets inserted incorrectly. Fixed by reinserting the header after [tool.uv] following the cleanup step.

This bug was discovered while adapting this script for kubeflow/trainer in kubeflow/trainer#3539.

Which issue(s) this PR fixes:
Fixes #502

Checklist:

  • Docs included if any changes are user facing

Copilot AI review requested due to automatic review settings May 25, 2026 22:35
@google-oss-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign astefanutti for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the update_overrides.py helper to keep the pyproject.toml “Security overrides” header stable when regenerating override-dependencies, and applies small formatting cleanups.

Changes:

  • Reformats long print(...) and re.sub(...) calls for readability.
  • Removes existing override-dependencies blocks and associated header comments.
  • Re-inserts a standardized “Security overrides” header after [tool.uv] to support consistent insertion behavior.

Comment thread .github/scripts/update_overrides.py
Comment thread .github/scripts/update_overrides.py Outdated
Comment thread .github/scripts/update_overrides.py Outdated
@yogarajalakshmi-s
Copy link
Copy Markdown
Author

Hi @Fiona-Waters! Could you review this PR?

Copy link
Copy Markdown
Contributor

@Fiona-Waters Fiona-Waters left a comment

Choose a reason for hiding this comment

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

Thanks for this @yogarajalakshmi-s
Looks good. Should we include \r here too?

Copy link
Copy Markdown
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

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

/ok-to-test
/retest

Signed-off-by: Yogarajalakshmi S <yogarajalakshmis@gmail.com>
Signed-off-by: Yogarajalakshmi S <yogarajalakshmis@gmail.com>
Signed-off-by: Yogarajalakshmi S <yogarajalakshmis@gmail.com>
@yogarajalakshmi-s yogarajalakshmi-s force-pushed the chore/fix-update-overrides-header-loss branch from 8147af6 to fecc825 Compare May 28, 2026 13:33
@google-oss-prow google-oss-prow Bot added size/M and removed size/S labels May 28, 2026
@yogarajalakshmi-s
Copy link
Copy Markdown
Author

Should we include \r here too?

Yes! Updated both insertion points to use \r

Copy link
Copy Markdown
Contributor

@Fiona-Waters Fiona-Waters left a comment

Choose a reason for hiding this comment

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

Thanks @yogarajalakshmi-s
/lgtm

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update_overrides.py drops Security overrides header on repeated runs

4 participants