Skip to content

[DO NOT MERGE] Temporary script to merge multiple PRs for demo and testing purposes. - #2001

Open
kusumachalasani wants to merge 1 commit into
kruize:runtimes-iirjfrom
kusumachalasani:prmerge
Open

[DO NOT MERGE] Temporary script to merge multiple PRs for demo and testing purposes.#2001
kusumachalasani wants to merge 1 commit into
kruize:runtimes-iirjfrom
kusumachalasani:prmerge

Conversation

@kusumachalasani

@kusumachalasani kusumachalasani commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

Temporary script to merge multiple PRs for demo and testing purposes.

Summary by Sourcery

Add a temporary script to integrate multiple pull requests into a demo/testing branch and trigger the appropriate build pipeline.

New Features:

  • Introduce a prmerge.sh helper script to fetch and merge multiple pull requests into a temporary integration branch for demo and testing purposes.

Enhancements:

  • Automatically detect the repository type and run the corresponding build script after merging the selected pull requests.

Signed-off-by: kusuma chalasani <kchalasani@ibm.com>
@kusumachalasani kusumachalasani self-assigned this Jun 26, 2026
@sourcery-ai

sourcery-ai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a temporary Bash script to create an integration branch from a base branch, sequentially merge multiple PRs from an upstream remote with interactive conflict handling, then run an appropriate build script based on the repository.

File-Level Changes

Change Details Files
Introduce an interactive Bash script to merge multiple PRs into a temporary integration branch for demo/testing and trigger a repo-specific build.
  • Define BASE_BRANCH and a timestamped INTEGRATION_BRANCH and require at least one PR number argument.
  • Check out and update the base branch, then create a new integration branch for the test build.
  • For each PR number, fetch the PR head from the upstream remote into a local branch, attempt a non-fast-forward merge, and handle conflicts interactively with guidance and safety checks.
  • On successful merge of each PR, delete the temporary local PR branch reference.
  • After all merges, detect whether the repository is Autotune vs Optimizer based on the origin URL and run either build.sh or build_and_push.sh.
  • Leave cleanup of the temporary integration branch commented out so the branch is preserved for inspection after the run.
scripts/prmerge.sh

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

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:

  • Consider parameterizing BASE_BRANCH and the upstream remote name (with sensible defaults) instead of hard-coding them, so the script is easier to reuse across different environments.
  • Several git commands could be made more robust by quoting variables and tolerating missing branches (e.g. git branch -D pr-$PR may fail if the branch doesn't exist); wrapping cleanup commands with || true or a trap would avoid unexpected script termination.
  • The repository detection logic using [[ "$REPO_URL" == *"autotune"* ]] is brittle; checking for a more explicit pattern (such as the full repo name or a config flag) would reduce the risk of misidentifying the repo and running the wrong build script.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider parameterizing `BASE_BRANCH` and the `upstream` remote name (with sensible defaults) instead of hard-coding them, so the script is easier to reuse across different environments.
- Several git commands could be made more robust by quoting variables and tolerating missing branches (e.g. `git branch -D pr-$PR` may fail if the branch doesn't exist); wrapping cleanup commands with `|| true` or a trap would avoid unexpected script termination.
- The repository detection logic using `[[ "$REPO_URL" == *"autotune"* ]]` is brittle; checking for a more explicit pattern (such as the full repo name or a config flag) would reduce the risk of misidentifying the repo and running the wrong build script.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Verify

Development

Successfully merging this pull request may close these issues.

2 participants