Skip to content

Make release bumping in maintenance phase RHEL customizable - #774

Merged
nforro merged 3 commits into
packit:mainfrom
nforro:release
Aug 26, 2026
Merged

Make release bumping in maintenance phase RHEL customizable#774
nforro merged 3 commits into
packit:mainfrom
nforro:release

Conversation

@nforro

@nforro nforro commented Aug 25, 2026

Copy link
Copy Markdown
Member

@qodo-for-packit

Copy link
Copy Markdown

PR Summary by Qodo

Make maintenance-phase RHEL release bumping rule-configurable

🐞 Bug fix ✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Defaults maintenance-phase CentOS Stream releases to plain Y-stream bumps.
• Lets maintainer rules opt backport and rebase workflows into Z-stream bumping.
• Expands agent guidance and tests for related triage and consolidation workflows.
Diagram

graph TD
  R["Maintainer rules"] --> P["Agent prompts"] --> O["Agent output"] --> S["Workflow state"] --> T["Release tool"] --> D{"Z-stream opt-in?"} -->|No| Y["Y-stream bump"]
  D -->|Yes| Z["Z-stream bump"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Central structured rule parsing
  • ➕ Makes release-policy selection deterministic rather than agent-interpreted
  • ➕ Avoids duplicating policy instructions across backport and rebase prompts
  • ➖ Requires a formal maintainer-rules schema and parser
  • ➖ Diverges from the existing abandon_autorelease agent-output pattern
2. Automatic maintenance detection
  • ➕ Requires no new agent output field
  • ➕ Preserves the behavior introduced for all maintenance-phase branches
  • ➖ Cannot honor package-specific preferences
  • ➖ Retains the behavior this PR intends to make optional

Recommendation: Keep the PR's explicit opt-in flag because it matches the established maintainer-rule workflow and preserves backward-compatible schema defaults. Consider centralized structured rule parsing later if more release-policy switches are added and prompt duplication becomes costly.

Files changed (13) +528 / -123

Enhancement (7) +46 / -0
backport_agent.pyPropagate maintenance release policy through backport state +4/-0

Propagate maintenance release policy through backport state

• Stores the agent's maintenance-RHEL Z-stream preference across workflow attempts and passes it to the shared release-update task.

ymir/agents/backport_agent.py

instructions.j2Teach backport agents the maintenance release opt-in +8/-0

Teach backport agents the maintenance release opt-in

• Instructs the backport agent to return the new flag when maintainer rules request Z-stream bumping for maintenance-phase CentOS Stream.

ymir/agents/prompts/backport/instructions.j2

instructions_zstream.j2Add maintenance release guidance to Z-stream backports +8/-0

Add maintenance release guidance to Z-stream backports

• Mirrors the maintainer-rule opt-in instructions in the older Z-stream backport prompt.

ymir/agents/prompts/backport/instructions_zstream.j2

instructions.j2Teach rebase agents the maintenance release opt-in +8/-0

Teach rebase agents the maintenance release opt-in

• Directs rebase agents to expose the Z-stream release preference from maintainer rules in structured output.

ymir/agents/prompts/rebase/instructions.j2

rebase_agent.pyPropagate maintenance release policy through rebase state +4/-0

Propagate maintenance release policy through rebase state

• Persists the rebase agent's policy flag and forwards it when updating the spec Release after build verification.

ymir/agents/rebase_agent.py

tasks.pyForward maintenance policy to the release tool +2/-0

Forward maintenance policy to the release tool

• Extends the shared update_release task with the opt-in argument and passes it into UpdateReleaseTool.

ymir/agents/tasks.py

models.pyExpose maintenance release policy in agent schemas +12/-0

Expose maintenance release policy in agent schemas

• Adds a default-false treat_maintenance_rhel_as_zstream field to both rebase and backport output models.

ymir/common/models.py

Bug fix (1) +21 / -5
specfile.pyDefault maintenance branches to plain release bumps +21/-5

Default maintenance branches to plain release bumps

• Adds the release-policy input and only resolves the corresponding internal RHEL branch when explicitly enabled. Maintenance-phase CentOS Stream therefore uses ordinary Y-stream logic by default while retaining opt-in Z-stream behavior.

ymir/tools/unprivileged/specfile.py

Tests (1) +39 / -0
test_specfile.pyCover default and opt-in maintenance release behavior +39/-0

Cover default and opt-in maintenance release behavior

• Updates existing maintenance-branch Z-stream cases to opt in explicitly and adds rebase and non-rebase coverage proving the default path performs plain bumps without branch lookup.

ymir/tools/unprivileged/tests/unit/test_specfile.py

Documentation (4) +422 / -118
SKILL.mdDocument configurable maintenance release policy and expanded backport safeguards +177/-33

Document configurable maintenance release policy and expanded backport safeguards

• Adds the maintenance-RHEL Z-stream opt-in to backport state, outputs, and release handling. Also synchronizes consolidation submission and rule-gated dependency-fix guidance for incremental build recovery.

agents_as_skills/backport/SKILL.md

SKILL.mdUse maintainer rules to select errata test automation +11/-4

Use maintainer rules to select errata test automation

• Documents maintainer-rule and README tools, then directs verification to use package rules when choosing NEWA or EWA test results.

agents_as_skills/issue-verification/SKILL.md

SKILL.mdDocument release policy and consolidated rebase workflows +135/-46

Document release policy and consolidated rebase workflows

• Adds the maintenance-RHEL release flag throughout rebase outputs and release handling. Synchronizes sibling detection, issue consolidation, namespace selection, Jira updates, and MR guidance.

agents_as_skills/rebase/SKILL.md

SKILL.mdExpand CVE validation and rebase sibling triage guidance +99/-35

Expand CVE validation and rebase sibling triage guidance

• Adds rebase sibling queuing and consolidation instructions, stricter source-based CVE applicability rules, dependency stream validation, and older Z-stream side-tag support.

agents_as_skills/triage/SKILL.md

@qodo-for-packit

qodo-for-packit Bot commented Aug 25, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Consolidation job cannot submit ✗ Dismissed 🐞 Bug ≡ Correctness ⭐ New
Description
Step 9 requires the backport skill to submit a consolidation job, but none of the skill's MCP or
local tools exposes the Redis-backed submission operation. As a result, a newly created MR cannot
trigger consolidation when this skill is executed, even when the package enables it in ymir.yaml.
Code

agents_as_skills/backport/SKILL.md[333]

+Otherwise, attempt to submit a consolidation job for `{{package}}` on `{{dist_git_branch}}`. This checks whether the package's rules (ymir.yaml, fetched via `get_maintainer_rules`) have a consolidation section configured and, if so, submits a job to consolidate related MRs.
Relevance

●●● Strong

Missing execution capability blocks the newly added workflow step; recent workflow failures and
completeness fixes are accepted.

PR-#726
PR-#662

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The skill's complete MCP tool list contains repository, Jira, rules, build, and reviewer operations
but no consolidation submission tool, while the repository implementation proves submission is an
internal Redis operation rather than an existing gateway tool.

agents_as_skills/backport/SKILL.md[29-45]
ymir/agents/tasks.py[1029-1063]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The backport skill instructs the agent to submit an MR consolidation job, but no available skill tool can perform the Redis-backed submission.

## Issue Context
The in-process workflow uses `try_submit_consolidation_job`, which requires a Redis connection and calls `submit_merge_job`; this operation is not exposed by the listed MCP or local tools.

## Fix Focus Areas
- agents_as_skills/backport/SKILL.md[326-337]
- agents_as_skills/backport/SKILL.md[29-45]
- ymir/agents/tasks.py[1029-1063]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Rules ignored in other workflows ✗ Dismissed 🐞 Bug ≡ Correctness
Description
Gating maintenance-branch detection on treat_maintenance_rhel_as_zstream makes every caller that
omits the new flag use a plain Y-stream bump; rebuild and both MR-consolidation release paths omit
it, so packages requesting Z-stream handling still get the wrong Release there. These workflows
accept CentOS Stream targets such as c8s, making the new rule customization incomplete for
production release bumps.
Code

ymir/tools/unprivileged/specfile.py[R526-529]

+            maintenance_rhel_branch = (
+                not higher_stream_branch
+                and tool_input.treat_maintenance_rhel_as_zstream
+                and await get_maintenance_rhel_branch(tool_input.dist_git_branch)
Relevance

●●● Strong

Cross-workflow flag propagation is a concrete correctness gap; recent history accepts analogous
workflow completeness and release-path fixes.

PR-#655
PR-#659
PR-#726

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new gate only performs maintenance-RHEL lookup when the flag is true. The shared task defaults
omitted values to false, while rebuild and both consolidation paths call it without the flag even
though their target branch is externally/triage supplied and their branch handling supports CentOS
Stream; by contrast, backport and rebase explicitly forward the flag.

ymir/tools/unprivileged/specfile.py[523-542]
ymir/agents/tasks.py[344-360]
ymir/agents/rebuild_agent.py[118-131]
ymir/agents/rebuild_agent.py[432-440]
ymir/agents/mr_consolidation_agent.py[1035-1040]
ymir/agents/mr_consolidation_agent.py[1323-1331]
ymir/common/base_utils.py[306-312]
ymir/agents/backport_agent.py[612-621]
ymir/agents/rebase_agent.py[440-449]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Maintenance-phase CentOS Stream release bumps in rebuild and MR-consolidation workflows always receive the new flag's `False` default, so they cannot honor maintainer rules requesting Z-stream logic.

## Issue Context
Backport and rebase store and forward `treat_maintenance_rhel_as_zstream`, but rebuild and both MR-consolidation call sites do not. Add an equivalent source of the maintainer preference to those workflow states and pass it through `tasks.update_release`; retain plain Y-stream behavior only when rules do not opt in.

## Fix Focus Areas
- ymir/tools/unprivileged/specfile.py[526-529]
- ymir/agents/tasks.py[344-360]
- ymir/agents/rebuild_agent.py[118-125]
- ymir/agents/mr_consolidation_agent.py[1035-1040]
- ymir/agents/mr_consolidation_agent.py[1323-1331]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Dependency issue omitted from commit ✗ Dismissed 🐞 Bug ≡ Correctness ⭐ New
Description
The rebuild skill now constructs a Dependency issue(s): metadata line, but its commit template
never inserts that line, so dependency tracker keys are present only in the MR description and are
lost from commit history. The Python rebuild workflow has the same mismatch: it builds
dep_issues_text but omits it from commit_message.
Code

agents_as_skills/rebuild/SKILL.md[R117-120]

+3. Construct dependency issue metadata line:
+   - If `all_dependency_issues` has one issue: `Dependency issue: <issue>`.
+   - If `all_dependency_issues` has multiple: `Dependency issues: <issue1>, <issue2>, ...`.
+   - Only include this line if `all_dependency_issues` is non-empty.
Relevance

●●● Strong

Deterministic metadata omission loses dependency information from commits; recent accepted workflow
correctness fixes favor addressing it.

PR-#726
PR-#662

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The skill constructs the dependency issue line at lines 117-120, but its commit format goes directly
from dependency components to Resolves; the implementation likewise computes dep_issues_text and
uses it in the MR description only.

agents_as_skills/rebuild/SKILL.md[117-131]
ymir/agents/rebuild_agent.py[215-256]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly constructed dependency issue metadata is not included in rebuild commit messages.

## Issue Context
Both the skill commit template and the Python `commit_message` include dependency components and `Resolves`, while skipping the already-computed dependency issue text.

## Fix Focus Areas
- agents_as_skills/rebuild/SKILL.md[117-131]
- ymir/agents/rebuild_agent.py[215-245]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Valid config discarded by text ✗ Dismissed 🐞 Bug ≡ Correctness ⭐ New
Description
fetch_release_bumping_config treats any response containing the substring "not found" as an
absent file before parsing YAML, so a valid ymir.yaml comment or unrelated value containing those
words silently disables all release-bumping settings. This can select the default bump strategy and
generate the wrong Release value for the package.
Code

ymir/agents/tasks.py[R382-383]

+    if "not found" in raw.lower():
+        return PackageReleaseBumpingConfig()
Relevance

●●● Strong

Broad text matching can discard valid YAML, a concrete correctness bug; recent task validation and
robustness fixes were accepted.

PR-#571
PR-#726

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The fetcher performs the broad substring check on the complete raw file, whereas the
maintainer-rules tool has a specific 404 response at lines 74-78; therefore ordinary YAML containing
the same phrase is indistinguishable from absence.

ymir/agents/tasks.py[371-394]
ymir/tools/privileged/maintainer_rules.py[72-81]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Valid release-bumping YAML is discarded whenever its raw text happens to contain `not found`.

## Issue Context
The maintainer-rules tool returns a specific structured sentence for HTTP 404; detect that exact response (or expose a typed not-found result) rather than searching the entire file contents.

## Fix Focus Areas
- ymir/agents/tasks.py[371-394]
- ymir/tools/privileged/maintainer_rules.py[72-81]
- ymir/agents/tests/unit/test_tasks.py[718-780]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
⚠️ Tickets: not configured — ticket URL found in PR but could not be fetched — check ticket provider credentials
✅ Compliance rules (platform): 8 rules

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 6f37c9c

Results up to commit 67816b3 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Rules ignored in other workflows ✗ Dismissed 🐞 Bug ≡ Correctness
Description
Gating maintenance-branch detection on treat_maintenance_rhel_as_zstream makes every caller that
omits the new flag use a plain Y-stream bump; rebuild and both MR-consolidation release paths omit
it, so packages requesting Z-stream handling still get the wrong Release there. These workflows
accept CentOS Stream targets such as c8s, making the new rule customization incomplete for
production release bumps.
Code

ymir/tools/unprivileged/specfile.py[R526-529]

+            maintenance_rhel_branch = (
+                not higher_stream_branch
+                and tool_input.treat_maintenance_rhel_as_zstream
+                and await get_maintenance_rhel_branch(tool_input.dist_git_branch)
Relevance

●●● Strong

Cross-workflow flag propagation is a concrete correctness gap; recent history accepts analogous
workflow completeness and release-path fixes.

PR-#655
PR-#659
PR-#726

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new gate only performs maintenance-RHEL lookup when the flag is true. The shared task defaults
omitted values to false, while rebuild and both consolidation paths call it without the flag even
though their target branch is externally/triage supplied and their branch handling supports CentOS
Stream; by contrast, backport and rebase explicitly forward the flag.

ymir/tools/unprivileged/specfile.py[523-542]
ymir/agents/tasks.py[344-360]
ymir/agents/rebuild_agent.py[118-131]
ymir/agents/rebuild_agent.py[432-440]
ymir/agents/mr_consolidation_agent.py[1035-1040]
ymir/agents/mr_consolidation_agent.py[1323-1331]
ymir/common/base_utils.py[306-312]
ymir/agents/backport_agent.py[612-621]
ymir/agents/rebase_agent.py[440-449]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Maintenance-phase CentOS Stream release bumps in rebuild and MR-consolidation workflows always receive the new flag's `False` default, so they cannot honor maintainer rules requesting Z-stream logic.

## Issue Context
Backport and rebase store and forward `treat_maintenance_rhel_as_zstream`, but rebuild and both MR-consolidation call sites do not. Add an equivalent source of the maintainer preference to those workflow states and pass it through `tasks.update_release`; retain plain Y-stream behavior only when rules do not opt in.

## Fix Focus Areas
- ymir/tools/unprivileged/specfile.py[526-529]
- ymir/agents/tasks.py[344-360]
- ymir/agents/rebuild_agent.py[118-125]
- ymir/agents/mr_consolidation_agent.py[1035-1040]
- ymir/agents/mr_consolidation_agent.py[1323-1331]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread ymir/tools/unprivileged/specfile.py Outdated
majamassarini
majamassarini previously approved these changes Aug 25, 2026

@majamassarini majamassarini left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All the unrelated changes were puzzling me at the beginning then I remembered the today standup discussion 😅
LGTM!

Comment thread ymir/common/models.py Outdated
@nforro nforro changed the title Make release bumping in maintenance phase RHEL customizable with rules Make release bumping in maintenance phase RHEL customizable Aug 25, 2026
@nforro

nforro commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

/agentic_review

Comment thread agents_as_skills/backport/SKILL.md
Comment thread agents_as_skills/rebuild/SKILL.md
Comment thread ymir/agents/tasks.py
@qodo-for-packit

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 3cc2dfc

nforro added 3 commits August 25, 2026 18:24
Signed-off-by: Nikola Forró <nforro@redhat.com>
Assisted-by: Claude Sonnet 5 via Claude Code
Signed-off-by: Nikola Forró <nforro@redhat.com>
Assisted-by: Claude Sonnet 5 via Claude Code
Signed-off-by: Nikola Forró <nforro@redhat.com>
Assisted-by: Claude Opus 4.6 via Claude Code

@lbarcziova lbarcziova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks a lot! Let's aim for announcing soon after deploying, as the default for 8.10.z is changed

@nforro
nforro merged commit cee6bbb into packit:main Aug 26, 2026
11 checks passed
@nforro
nforro deleted the release branch August 26, 2026 06:47
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