Skip to content

feat: add hotfix auto-tagging and template generation workflows#8131

Merged
Devinwong merged 17 commits intomainfrom
devinwon/hotfix_absvc_customdata
Mar 20, 2026
Merged

feat: add hotfix auto-tagging and template generation workflows#8131
Devinwong merged 17 commits intomainfrom
devinwon/hotfix_absvc_customdata

Conversation

@Devinwong
Copy link
Collaborator

@Devinwong Devinwong commented Mar 19, 2026

What this PR does / why we need it:
Add hotfix auto-tagging and template generation workflows.

Developer per-hotfix effort:

  • Fix the bugs, cherry-pick to main.
  • This PR automates the steps for hot fixing the official release branch.

Tried to separate from production codes because this is only for script hotfix PR generation, and probably won't last too long once we get aks-node-controller hotfix available.

Which issue(s) this PR fixes:

Fixes #

Copilot AI review requested due to automatic review settings March 19, 2026 20:57
@Devinwong Devinwong added the hotfix Only use this label when you are hot fixing an official release label Mar 19, 2026
Copy link
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

Adds automation to support hotfix workflows for official/** release branches by generating scriptless-template overrides and auto-creating hotfix tags.

Changes:

  • Introduces hack/hotfix-generate.sh to detect changed parts/linux/cloud-init/artifacts/** files and inject matching write_files blocks into parts/linux/cloud-init/nodecustomdata.yml’s EnableScriptlessCSECmd section.
  • Adds a GitHub Actions workflow to run the generator, run make generate, and commit/push the updated template + snapshot testdata.
  • Adds a GitHub Actions workflow to auto-tag hotfix releases on official/** branches.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
hack/hotfix-generate.sh New generator script that maps changed artifacts to cloudInitData variable keys and injects the corresponding write_files blocks into the scriptless template section.
.github/workflows/hotfix-generate.yml Workflow to run the generator on PRs/label events, run make generate, and commit/push generated updates.
.github/workflows/hotfix-autotag.yml Workflow to create/push incrementing v0.<date>.<patch> tags for official/** branches.

Copilot AI review requested due to automatic review settings March 19, 2026 21:16
Copy link
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Copilot AI review requested due to automatic review settings March 19, 2026 21:46
@Devinwong Devinwong removed the hotfix Only use this label when you are hot fixing an official release label Mar 19, 2026
Copy link
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

@Devinwong Devinwong marked this pull request as ready for review March 19, 2026 22:19
Copilot AI review requested due to automatic review settings March 19, 2026 22:19
Copilot AI review requested due to automatic review settings March 20, 2026 19:18
Copy link
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Uses the same GitHub App token pattern as tidy.yaml to produce
verified/signed commits that satisfy branch protection rules.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Uses go-version-file to match the repo's pinned Go version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 20, 2026 21:07
Copy link
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

- Upgrade checkout@v4 → @v6 in both hotfix workflows
- Upgrade setup-go@v5 → @v6
- Stage manifest.json in commit step (generated by make generate)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replaces git commit + git push with GitHub Git Data API calls
(create tree → create commit → update ref). This produces a single
atomic commit that is automatically signed/verified by GitHub,
satisfying branch protection requirements.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 20, 2026 22:29
Copy link
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings March 20, 2026 23:11
@Devinwong Devinwong merged commit f453cb6 into main Mar 20, 2026
22 checks passed
@Devinwong Devinwong deleted the devinwon/hotfix_absvc_customdata branch March 20, 2026 23:17
Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +73 to +89
- name: Commit changes via API
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
FILE="parts/linux/cloud-init/nodecustomdata.yml"
if git diff --quiet "$FILE"; then
echo "No template changes needed."
exit 0
fi
CONTENT=$(base64 -w 0 "$FILE")
SHA=$(gh api "repos/${{ github.repository }}/contents/${FILE}?ref=${{ github.head_ref }}" --jq '.sha')
gh api "repos/${{ github.repository }}/contents/${FILE}" \
-X PUT \
-f message="chore: auto-generate hotfix template entries" \
-f content="$CONTENT" \
-f branch="${{ github.head_ref }}" \
-f sha="$SHA"
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The commit-via-API step can fail with a 409/sha mismatch if multiple runs update the PR branch around the same time (e.g., rapid pushes triggering synchronize, plus a labeled run). Consider adding a concurrency group keyed by PR (and cancel-in-progress: true) and/or adding a small retry that refetches the latest file SHA before the PUT to make the workflow resilient to concurrent runs.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,89 @@
name: Hotfix Template Update
# This workflow is for temporary use and will deprecate once we move to the
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

The header comment says the workflow "will deprecate"; grammatically this should be "will be deprecated" (or "will be removed") to avoid ambiguity about whether the workflow deprecates something else or is itself being deprecated.

Suggested change
# This workflow is for temporary use and will deprecate once we move to the
# This workflow is for temporary use and will be deprecated once we move to the

Copilot uses AI. Check for mistakes.
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.

4 participants