Repository navigation
Conversation
Compare complete canonical write_files blocks before hotfix injection and remove stale generated duplicates without changing distinct entries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9f611d25-fb17-4857-86d5-ae9f0746edad
Contributor
Windows Unit Test Results 3 files 18 suites 1m 9s ⏱️ Results for commit 76b6bd7. |
Contributor
Contributor
|
Contributor
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new test assumes a marker-free repository template, causing subsequent hotfix workflow runs to fail when generated entries already exist.
1 open issue
What changed in this PR
Prevents duplicate hotfix entries in AgentBaker’s scriptless cloud-init template.
Changes:
- Filters generated entries against complete existing blocks, preserving distinct guards and content.
- Adds regression coverage for cleanup, mixed selections, and repeat-run idempotence.
| File | Description |
|---|---|
| hotfix/hotfix_generate.py | Skips blocks already supplied by the scriptless branch. |
| hotfix/hotfix_generate_test.py | Tests deduplication and preservation of distinct entries. |
Review effort: Balanced
|
|
||
| def test_update_nodecustomdata_deduplicates_existing_scriptless_block(self): | ||
| repository = Path(__file__).resolve().parents[1] | ||
| original = (repository / hotfix_generate.TEMPLATE).read_text() |
This branch has not been deployed
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.

What this PR does / why we need it:
Prevent hotfix generation from injecting a write_files block already supplied by the handwritten scriptless branch, such as the conditional init-aks-cloud.sh entry. Compare complete canonical blocks, including guards and content, rather than paths or variable keys alone. Regeneration also removes stale auto-generated duplicates while preserving distinct hotfix entries and the mutually exclusive traditional branch.
Add regression coverage for stale-duplicate cleanup, mixed selections, repeat-run idempotence, no-hotfix cleanup, and differently guarded or defined entries. Embedded payload eligibility and empty-output handling are unchanged.
Validation:
python -X utf8 -m unittest hotfix.hotfix_generate_test— passed all 28 tests.python -B -X utf8 -m unittest hotfix.hotfix_generate_test— passed after committing.git diff --check— passed.python -X utf8 C:\Users\devinwon\.copilot\session-state\9f611d25-fb17-4857-86d5-ae9f0746edad\files\verify_hotfix_dedup.py— passed 16 production-renderer/YAML cases using a local, uncommitted verification harness: Ubuntu/Azure Linux, scriptless/traditional CSE, public/custom clouds, before/after regeneration. Reproduced duplicate eligible init entries before regeneration and verified exactly one afterward, with distinct helper entries retained.No live VM test was run; this change only affects template generation.
Which issue(s) this PR fixes:
N/A