Skip to content

Update upgrade pipeline: bridge creates PR, agent only pushes#1066

Merged
bmbouter merged 2 commits intomainfrom
fix-upgrade-workflow
Apr 20, 2026
Merged

Update upgrade pipeline: bridge creates PR, agent only pushes#1066
bmbouter merged 2 commits intomainfrom
fix-upgrade-workflow

Conversation

@bmbouter
Copy link
Copy Markdown
Member

@bmbouter bmbouter commented Apr 20, 2026

Summary

  • Add create-pr (draft) and await-ci bridge steps to the upgrade-deps workflow pipeline
  • Update AGENT.md Phase 8: agent commits and pushes to branch only, no PR creation
  • Update agent prompt to reference workflow context branch
  • Pipeline orchestrates PR creation and CI monitoring; agent focuses on upgrade work

Changes

  • .alcove/workflows/upgrade-deps-pipeline.yml — 3-step pipeline: upgrade-dependencies → create-pr (draft) → await-ci
  • .alcove/tasks/upgrade-deps.yml — prompt updated to mention branch from context
  • .alcove/agents/upgrade-deps/AGENT.md — Phase 8 rewritten: commit+push only, no gh pr create

Summary by Sourcery

Orchestrate dependency upgrade PR creation and CI monitoring via the workflow pipeline while limiting the agent to committing and pushing changes to a designated branch.

New Features:

  • Add bridge steps to the upgrade-deps workflow to create a draft PR and wait for CI on the resulting pull request.

Enhancements:

  • Update the upgrade-deps workflow to provide a deterministic branch name to the agent and remove PR URL output.
  • Revise the upgrade-deps agent instructions so Phase 8 only commits and pushes to the workflow-specified branch and delegates PR creation to the pipeline.
  • Clarify the upgrade-deps task prompt to instruct the agent to push to the workflow context branch and not create PRs manually.

- Add create-pr and await-ci bridge steps to the workflow pipeline
- Update AGENT.md Phase 8: agent commits and pushes only, no PR creation
- Update agent prompt to reference workflow context branch
- PR is created as draft by the bridge create-pr action

The agent focuses on the upgrade work (phases 1-7) and pushes to the
branch. The pipeline orchestrates PR creation and CI monitoring.
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 20, 2026

Reviewer's Guide

Refactors the upgrade-deps workflow so the agent only commits and pushes to a workflow-provided branch while new bridge steps handle PR creation (as draft) and CI monitoring, and updates docs/prompts to align with this responsibility split.

Sequence diagram for new upgrade-deps pipeline orchestration

sequenceDiagram
  actor Dev
  participant Workflow as upgrade-deps_workflow
  participant Agent as upgrade-dependencies_agent
  participant Repo as git_pulp_pulp-service
  participant BridgePR as bridge_create-pr
  participant BridgeCI as bridge_await-ci
  participant GitHub as github_pr_api
  participant CI as ci_system

  Dev->>Workflow: Trigger upgrade-deps workflow
  Workflow->>Agent: Run agent with input branch = upgrade/deps-issue_number
  Agent->>Repo: git checkout -b BRANCH
  Agent->>Repo: Apply upgrades, run tests, modify patches
  Agent->>Repo: git commit
  Agent->>Repo: git push -u origin BRANCH
  Agent-->>Workflow: Return outputs packages_upgraded, patches_modified, patches_removed, tests_passed

  Workflow->>BridgePR: Invoke create-pr bridge
  BridgePR->>GitHub: Create draft PR
  GitHub-->>BridgePR: pr_number
  BridgePR-->>Workflow: Output pr_number

  Workflow->>BridgeCI: Invoke await-ci bridge with pr_number
  loop Up to max_iterations = 4
    BridgeCI->>CI: Check PR status
    CI-->>BridgeCI: CI status (pending/success/failure)
  end
  BridgeCI-->>Workflow: Final CI status
  Workflow-->>Dev: Report PR link and CI result
Loading

File-Level Changes

Change Details Files
Shift Phase 8 of the upgrade-deps agent from creating a PR to only committing and pushing to a workflow-provided branch, with updated error-handling guidance.
  • Rename Phase 8 from 'Create PR' to 'Commit and Push' and change branch creation to use a BRANCH variable from workflow context.
  • Remove all gh pr create commands and instructions, replacing them with guidance that the pipeline will create the PR automatically.
  • Update error-handling steps to require commits and pushes instead of draft PRs when failures persist, ensuring work is never lost.
.alcove/agents/upgrade-deps/AGENT.md
Extend the upgrade-deps workflow pipeline to pass a branch name into the agent and add bridge steps for draft PR creation and CI waiting.
  • Add a branch input to the upgrade-dependencies agent step using an issue-number-based naming convention.
  • Introduce a create-pr bridge step that opens a draft PR against pulp/pulp-service/main using the agent step's branch.
  • Introduce an await-ci bridge step that waits on CI for the PR created by the create-pr step, with a bounded number of iterations.
.alcove/workflows/upgrade-deps-pipeline.yml
Align the upgrade-deps task prompt with the new workflow behavior around branches and PR creation.
  • Update the task prompt to instruct the agent to push work to the branch specified in the Workflow Context.
  • Explicitly tell the agent not to create a PR because the pipeline now handles PR creation.
.alcove/tasks/upgrade-deps.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The agent docs reference a $BRANCH env var while the workflow passes branch via workflow context; consider clarifying how that value is exposed to the agent (e.g., naming the env var explicitly) to avoid confusion or misconfiguration.
  • Right now create-pr always sets draft: true; if the intent is only to draft when tests or migrations fail, consider wiring steps.upgrade-dependencies.outputs.tests_passed (and other failure signals) into the draft parameter so successful runs open a ready-for-review PR.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The agent docs reference a `$BRANCH` env var while the workflow passes `branch` via workflow context; consider clarifying how that value is exposed to the agent (e.g., naming the env var explicitly) to avoid confusion or misconfiguration.
- Right now `create-pr` always sets `draft: true`; if the intent is only to draft when tests or migrations fail, consider wiring `steps.upgrade-dependencies.outputs.tests_passed` (and other failure signals) into the `draft` parameter so successful runs open a ready-for-review PR.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- Add ci-fix step: if CI fails, the agent fixes and re-pushes (up to 3x)
- Add code-review step: PR Reviewer agent reviews after CI passes
- Add PR Reviewer agent definition with pulp-service-contributor profile
- Pipeline stops after review (no auto-merge)

Full pipeline: upgrade → create-pr (draft) → await-ci ↔ ci-fix → review
@bmbouter bmbouter merged commit c9895e8 into main Apr 20, 2026
2 of 5 checks passed
@bmbouter bmbouter deleted the fix-upgrade-workflow branch April 20, 2026 15:20
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.

1 participant