Skip to content

Commit a65890d

Browse files
opohorelTomasKorbar
authored andcommitted
Improve backporting prompt
Be stricter about NOT backporting changelogs
1 parent 1b4d4dc commit a65890d

2 files changed

Lines changed: 50 additions & 16 deletions

File tree

agents_as_skills/backport/SKILL.md

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,14 @@ This step attempts to fix build errors by finding and cherry-picking prerequisit
179179

180180
1. Increment `incremental_fix_attempts`.
181181
2. If `incremental_fix_attempts > max_incremental_fix_attempts` → set `success=false`, `error="Unable to fix build errors after N incremental fix attempts. Last error: ..."`, skip to Step 11.
182-
3. Follow the **Fix Build Error Instructions** (Section C or D depending on the branch variant) with the current `build_error`.
183-
4. The fix attempt produces a new `success`/`error`/`srpm_path`.
184-
5. If the fix **succeeds** (build passes) → reset `incremental_fix_attempts = 0`, proceed to Step 6.
185-
6. If the fix **fails** → update `build_error` with the new error, go back to Step 5a.
182+
3. Archive build logs and record the error:
183+
a. Create `<local_clone>-upstream/build-logs/` directory if it doesn't exist.
184+
b. If `incremental_fix_attempts > 1`, move all `.log` and `.log.gz` files from `<local_clone>` to `<local_clone>-upstream/build-logs/attempt-<previous_attempt>/`.
185+
c. Create or append to `<local_clone>-upstream/build-logs/fix-attempts.md` with the current attempt number and the build error text.
186+
4. Follow the **Fix Build Error Instructions** (Section C or D depending on the branch variant) with the current `build_error`.
187+
5. The fix attempt produces a new `success`/`error`/`srpm_path`.
188+
6. If the fix **succeeds** (build passes) → reset `incremental_fix_attempts = 0`, proceed to Step 6.
189+
7. If the fix **fails** → update `build_error` with the new error, go back to Step 5a.
186190

187191
### Step 6: Update Release
188192

@@ -520,9 +524,12 @@ General instructions:
520524
- Never change anything in the spec file changelog.
521525
- Never change the Release field in the spec file.
522526
- Preserve existing formatting and style conventions in spec files and patch headers.
523-
- Ignore all changes that cause conflicts in the following kinds of
524-
files: .github/ workflows, .gitignore, news, changes,
525-
and internal documentation.
527+
- Drop ALL changes to the following kinds of files, whether they
528+
conflict or apply cleanly: .github/ workflows, .gitignore,
529+
news/changelog files (e.g. Changes, NEWS, ChangeLog), and
530+
internal project documentation. Discard conflicts in these files
531+
and revert any cleanly-applied changes before generating the
532+
final patch so they don't appear in the backport.
526533
- Apply all changes that modify the core library of the package,
527534
and all binaries, manpages, and user-facing documentation.
528535
- For more information how the package is being built, inspect the
@@ -742,9 +749,12 @@ General instructions:
742749
- If necessary, you can run `git checkout -- <FILE>` to revert any changes done to <FILE>.
743750
- Never change anything in the spec file changelog.
744751
- Preserve existing formatting and style conventions in spec files and patch headers.
745-
- Ignore all changes that cause conflicts in the following kinds of
746-
files: .github/ workflows, .gitignore, news, changes,
747-
and internal documentation.
752+
- Drop ALL changes to the following kinds of files, whether they
753+
conflict or apply cleanly: .github/ workflows, .gitignore,
754+
news/changelog files (e.g. Changes, NEWS, ChangeLog), and
755+
internal project documentation. Discard conflicts in these files
756+
and revert any cleanly-applied changes before generating the
757+
final patch so they don't appear in the backport.
748758
- Apply all changes that modify the core library of the package,
749759
and all binaries, manpages, and user-facing documentation.
750760
- For more information how the package is being built, inspect the
@@ -784,6 +794,9 @@ Your task is to fix this build error by improving the patches - NOT by modifying
784794
This includes BOTH compilation errors AND test failures during the check section.
785795
Make ONE attempt to fix the issue - you will be called again if the build still fails.
786796
797+
Before you start: Read <LOCAL_CLONE>-upstream/build-logs/fix-attempts.md for a log of
798+
previous fix attempts. Do NOT repeat strategies that already failed.
799+
787800
Follow these steps:
788801
789802
STEP 1: Analyze the build error
@@ -888,6 +901,12 @@ IMPORTANT RULES:
888901
- Make ONE solid attempt to fix the issue - if the build fails, report the error clearly
889902
- Your work will persist in the upstream repo for the next attempt if needed
890903
904+
STEP 6: Document the fix attempt
905+
- Append a summary to <LOCAL_CLONE>-upstream/build-logs/fix-attempts.md documenting:
906+
* What you identified as the root cause
907+
* Which commits you cherry-picked or what manual edits you made
908+
* The build result (pass/fail and error if applicable)
909+
891910
---
892911
893912
## Section D: Fix Build Error Instructions (Z-Stream)
@@ -911,6 +930,9 @@ Your task is to fix this build error by improving the patches - NOT by modifying
911930
This includes BOTH compilation errors AND test failures during the check section.
912931
Make ONE attempt to fix the issue - you will be called again if the build still fails.
913932
933+
Before you start: Read <LOCAL_CLONE>-upstream/build-logs/fix-attempts.md for a log of
934+
previous fix attempts. Do NOT repeat strategies that already failed.
935+
914936
Follow these steps:
915937
916938
STEP 1: Analyze the build error
@@ -1015,6 +1037,12 @@ IMPORTANT RULES:
10151037
- Make ONE solid attempt to fix the issue - if the build fails, report the error clearly
10161038
- Your work will persist in the upstream repo for the next attempt if needed
10171039
1040+
STEP 6: Document the fix attempt
1041+
- Append a summary to <LOCAL_CLONE>-upstream/build-logs/fix-attempts.md documenting:
1042+
* What you identified as the root cause
1043+
* Which commits you cherry-picked or what manual edits you made
1044+
* The build result (pass/fail and error if applicable)
1045+
10181046
---
10191047
10201048
## Output Schema

ymir/agents/backport_agent.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,12 @@
286286
- If necessary, you can run `git checkout -- <FILE>` to revert any changes done to <FILE>.
287287
- Never change anything in the spec file changelog.
288288
- Preserve existing formatting and style conventions in spec files and patch headers.
289-
- Ignore all changes that cause conflicts in the following kinds of
290-
files: .github/ workflows, .gitignore, news, changes,
291-
and internal documentation.
289+
- Drop ALL changes to the following kinds of files, whether they
290+
conflict or apply cleanly: .github/ workflows, .gitignore,
291+
news/changelog files (e.g. Changes, NEWS, ChangeLog), and
292+
internal project documentation. Discard conflicts in these files
293+
and revert any cleanly-applied changes before generating the
294+
final patch so they don't appear in the backport.
292295
- Apply all changes that modify the core library of the package,
293296
and all binaries, manpages, and user-facing documentation.
294297
- For more information how the package is being built, inspect the
@@ -533,9 +536,12 @@
533536
- Never change anything in the spec file changelog.
534537
- Never change the Release field in the spec file.
535538
- Preserve existing formatting and style conventions in spec files and patch headers.
536-
- Ignore all changes that cause conflicts in the following kinds of
537-
files: .github/ workflows, .gitignore, news, changes,
538-
and internal documentation.
539+
- Drop ALL changes to the following kinds of files, whether they
540+
conflict or apply cleanly: .github/ workflows, .gitignore,
541+
news/changelog files (e.g. Changes, NEWS, ChangeLog), and
542+
internal project documentation. Discard conflicts in these files
543+
and revert any cleanly-applied changes before generating the
544+
final patch so they don't appear in the backport.
539545
- Apply all changes that modify the core library of the package,
540546
and all binaries, manpages, and user-facing documentation.
541547
- For more information how the package is being built, inspect the

0 commit comments

Comments
 (0)