backport: add self-review step to instructions#598
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a reusable self-review template (_self_review.j2) for backport instructions, integrating it into both standard and z-stream backport instruction templates. The review feedback suggests quoting the SRPM path placeholder in the shell command to prevent word-splitting, and utilizing Jinja2 block assignments ({% set %} ... {% endset %}) instead of escaped multi-line strings to improve template readability and maintainability.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| Criterion 4 — Completeness: | ||
| Verify the SRPM generated in step {{ srpm_step }} exists on disk. Use the path that the | ||
| SRPM generation command printed, and run: | ||
| `test -f <path-to-srpm> && echo exists || echo missing` |
| {% set spec_only_note = ' Note: If this was a spec-only change (step 3d path), no patch files are\n generated — criteria 1, 2a, 2b, and 5 will not apply. Criterion 2c still\n applies: verify that pre-existing Patch tags were not accidentally modified.' %} | ||
| {% set criterion_3_body = ' From the git diff output, verify the `%changelog` section was not modified.\n (Changing the Release field is acceptable in y-stream, unless this was a\n spec-only change via step 3d — in that case the Release field must not be\n modified either.)' %} |
There was a problem hiding this comment.
Using Jinja2's block assignment ({% set var %} ... {% endset %}) is the idiomatic and much more readable way to define multi-line strings in templates. It avoids manual \n escape sequences and improves maintainability.
{% set spec_only_note %}
Note: If this was a spec-only change (step 3d path), no patch files are
generated — criteria 1, 2a, 2b, and 5 will not apply. Criterion 2c still
applies: verify that pre-existing Patch tags were not accidentally modified.
{% endset %}
{% set criterion_3_body %}
From the git diff output, verify the `%changelog` section was not modified.
(Changing the Release field is acceptable in y-stream, unless this was a
spec-only change via step 3d — in that case the Release field must not be
modified either.)
{% endset %}
| {% set self_review_step = 7 %} | ||
| {% set repo_context = 'any cloned source repository' %} | ||
| {% set spec_only_note = '' %} | ||
| {% set criterion_3_body = ' From the git diff output, verify all of the following:\n a. The `%changelog` section was not modified.\n b. Your changes (visible in the diff) did not modify the `Release:` field.' %} |
There was a problem hiding this comment.
Using Jinja2's block assignment ({% set var %} ... {% endset %}) is the idiomatic and much more readable way to define multi-line strings in templates. It avoids manual \n escape sequences and improves maintainability.
{% set criterion_3_body %}
From the git diff output, verify all of the following:
a. The `%changelog` section was not modified.
b. Your changes (visible in the diff) did not modify the `Release:` field.
{% endset %}
Summary
_self_review.j2to avoid duplication between y-stream and z-stream templates%autosetup/%autopatchspecs that don't need explicit%patchdirectivesTest plan
pytest ymir/agents/tests/unit/test_jinja2_templates.py— 31 tests pass🤖 Generated with Claude Code