feat: add GitHub Action for ANC hotfix template injection#8405
Open
feat: add GitHub Action for ANC hotfix template injection#8405
Conversation
Add a GitHub Action workflow that auto-injects the ANC hotfix version into nodecustomdata.yml when hack/anc-hotfix-version.json is updated in a PR targeting an official/* release branch. Files added: - .github/workflows/anc-hotfix-generate.yml: workflow with same infra pattern as hotfix-generate.yml (Azure login, App token, commit via API) - hack/anc_hotfix_generate.py: reads version file, validates YYYYMM.DD.PATCH format, idempotently injects write_files entry in scriptless section - hack/anc-hotfix-version.json: empty by default, operator sets version Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a GitHub Action workflow that auto-injects the ANC hotfix version into nodecustomdata.yml when hotfix/anc-hotfix-version.json is updated in a PR targeting an official/* release branch. Files added: - .github/workflows/anc-hotfix-generate.yml: workflow with same infra pattern as hotfix-generate.yml (Azure login, App token, commit via API) - hotfix/anc_hotfix_generate.py: reads version file, validates YYYYMM.DD.PATCH format, idempotently injects write_files entry in scriptless section - hotfix/anc-hotfix-version.json: empty by default, operator sets version Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds pull_request_target trigger so adding the 'anc-hotfix' label to any PR will run the ANC hotfix template injection workflow. Uses same pattern as scripts hotfix workflow with 'hotfix' label. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds automation to keep nodecustomdata.yml in sync with an ANC hotfix version file for official/* release PRs by injecting/removing a marked write_files entry, plus documentation for reviewer expectations.
Changes:
- Adds a GitHub Actions workflow to run on
hotfix/anc-hotfix-version.jsonupdates (and optional label trigger) and commit template updates back to the PR branch. - Introduces a Python generator that injects/updates/removes a marked ANC hotfix block in
parts/linux/cloud-init/nodecustomdata.yml. - Adds an empty default hotfix version config file and updates reviewer guidance in
AGENTS.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/anc-hotfix-generate.yml |
New workflow to run generator and write template updates back to the PR branch. |
hotfix/anc_hotfix_generate.py |
New script to validate version and inject/remove an idempotent marked block in the template. |
hotfix/anc-hotfix-version.json |
Adds default empty version file used as the workflow trigger/config. |
AGENTS.md |
Adds reviewer checklist guidance about safe hotfix entry removal. |
- Fix usage string path (hack/ -> hotfix/) - Add json.JSONDecodeError handling for invalid JSON - Tighten day regex to require exactly 2 digits (DD) - Remove debug prints that add CI log noise Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
awesomenix
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a GitHub Action workflow that automatically injects the ANC hotfix version into
nodecustomdata.yml. Companion to #8355 (ANC hotfix patch-only matching logic).Triggers
hotfix/anc-hotfix-version.jsonis changed in a PR targetingofficial/**"anc-hotfix"label to any PRFiles
.github/workflows/anc-hotfix-generate.ymlhotfix/anc_hotfix_generate.pynodecustomdata.ymlhotfix/anc-hotfix-version.json{}by default, operator sets{"version":"YYYYMM.DD.PATCH"}AGENTS.mdOperational Flow
202604.01.1), publishes to PMCmain(with hotfix entry innodecustomdata.yml)official/*and setshotfix/anc-hotfix-version.jsonaks-node-controller-hotfix.jsonwrite_files entry into the scriptless CSE section ofnodecustomdata.ymlHotfix Entry Lifecycle
mainandofficial/*until affected VHDs are republished or out of the 6-month support windowTested Scenarios
{}removes stale entry)