Skip to content

Enhancement: package prs devcontainer tool#2427

Draft
LiamStanziani wants to merge 2 commits into
developfrom
feat/package-prs
Draft

Enhancement: package prs devcontainer tool#2427
LiamStanziani wants to merge 2 commits into
developfrom
feat/package-prs

Conversation

@LiamStanziani

@LiamStanziani LiamStanziani commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Note: This tool is a work in progress, it was created to make an easier and more streamlined way to send package or branches in general to other repos (such as OpenOSP, or MagentaHealth). This functionality needs to be tested and isn't very important to be added into the project currently

Summary by Sourcery

Introduce a devcontainer-only CLI for assembling package branches from multiple source PRs and document its usage and limitations.

New Features:

  • Add a package-prs devcontainer script to build a package branch by cherry-picking merge commits from multiple PRs.

Documentation:

  • Add package-prs.md documenting usage, flags, workflow, recovery steps, and limitations of the new packaging tool.

Summary by cubic

Adds package-prs, a devcontainer CLI to build a single “package” branch by cherry‑picking merge commits from multiple PRs. Includes docs, a help-dev entry, and fixes for safer arg handling and remote fetching.

  • New Features

    • Resolves PRs to merge SHAs via git log and cherry‑picks with -m 1 onto a branch from --target-base.
    • Supports --dry-run, --force, --source-branch, and --source-remote; checks clean working tree and verifies merge subjects (warns on owner mismatch).
    • Prints a plan table and suggested next steps; aborts cleanly on conflicts.
    • Added package-prs.md with usage and recovery steps; help-dev now lists package-prs --help.
  • Bug Fixes

    • Removed hard gh requirement; only suggests gh pr create if available.
    • Guarded missing flag values and empty entries in --pr; warn on fork PRs rather than fail.
    • Fetches --target-base remote when specified to avoid stale refs; more robust plan output; fixed code fences in docs.

Written for commit 4a1c77a. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features

    • Added a CLI tool to build “package” branches by cherry-picking merge commits from a supplied list of PRs, with input validation, dry-run and force options, conflict recovery guidance, and suggested follow-up commands.
  • Documentation

    • Added a comprehensive guide covering the cherry-pick workflow, usage examples, dry-run output, recovery steps after conflicts, and supported/unsupported behaviors.

Review Change Stack

…entation on the feature, and an update to help-dev to reference the new tool
@LiamStanziani LiamStanziani self-assigned this May 4, 2026
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds a new Bash CLI script package-prs plus a help entry and Markdown docs; the script resolves merge commit SHAs for supplied PR numbers from a source repo/branch and cherry-picks them onto a created target branch, with dry-run and force options and explicit conflict abort/recovery guidance.

Changes

package-prs Tool

Layer / File(s) Summary
Script header and usage
.devcontainer/development/scripts/package-prs
Adds script header, strict mode, defaults, and usage/help heredoc describing required flags and options.
Output helpers & CLI parsing
.devcontainer/development/scripts/package-prs
Adds err/info helpers, need_val, and full CLI argument parsing with unknown-option handling.
Validation and normalization
.devcontainer/development/scripts/package-prs
Validates required flags, checks git availability, enforces clean working tree, normalizes PR list, and derives SOURCE_OWNER.
Fetch remotes
.devcontainer/development/scripts/package-prs
Fetches the specified source remote/branch and optionally fetches TARGET_BASE if remote-like.
Resolve merge commit
.devcontainer/development/scripts/package-prs
resolve_one(pr) finds merge commit SHA via git log --grep 'Merge pull request #<N> ', verifies subject prefix and owner substring, extracts shortstat, and emits plan lines.
PR iteration and arrays
.devcontainer/development/scripts/package-prs
Splits PR list, iterates, resolves each PR, aborts on failures, and builds parallel arrays of PRs/SHAs/subjects/stats.
Plan display and dry-run
.devcontainer/development/scripts/package-prs
Prints formatted plan table (subject truncation) and exits early when --dry-run is used.
Target branch creation
.devcontainer/development/scripts/package-prs
Creates target branch from TARGET_BASE; errors on existing branch unless --force, supports forced deletion with detach when needed.
Cherry-pick loop and failure handling
.devcontainer/development/scripts/package-prs
Cherry-picks each merge SHA with git cherry-pick -m 1; on conflict aborts, restores pre-failure state, and prints retry/manual-resolution instructions.
Completion output & suggestions
.devcontainer/development/scripts/package-prs
Prints completion summary with commit count and next-step suggestions; suggests gh pr create when gh exists.
Help Command
.devcontainer/development/scripts/help-dev
Adds package-prs --help entry describing cherry-picking PR merge commits into a package branch.
Documentation
.devcontainer/development/scripts/package-prs.md
Adds detailed usage doc covering rationale, flags, dry-run example, recovery steps, examples, and limitations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

"I hop through commits, tiny paws at play,
Picking merged PRs to carry on my way.
With scripts well-tested and a helpful plan,
I build a branch — hop! — then offer you a scan.
🐇✨"

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Enhancement: package prs devcontainer tool' accurately reflects the main change: adding a new package-prs CLI tool to the devcontainer environment for cherry-picking PR merge commits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/package-prs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 4a1c77a.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@sourcery-ai

sourcery-ai Bot commented May 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a new devcontainer CLI script package-prs for assembling package branches by cherry-picking merge commits from multiple PRs, wires it into the dev help command, and documents usage, flags, workflows, and limitations in a dedicated markdown guide.

Flow diagram for package-prs cherry-pick workflow

flowchart LR
  User["Run package-prs with --pr, --source-repo, --target-base, --branch"]
  CheckTree["Check working tree is clean"]
  Fetch["git fetch <source-remote> <source-branch>"]
  ResolvePRs["Resolve PR merge commits via git log --grep"]
  VerifySubjects["Verify merge commit subjects and owners"]
  DryRun{Dry run?}
  Plan["Print plan table (PR, SHA, subject, stats)"]
  CreateBranch["Create branch from --target-base"]
  CherryPick["git cherry-pick -m 1 for each merge commit"]
  Conflict{Cherry-pick conflict?}
  Abort["Abort cherry-pick and exit non-zero"]
  Success["Print suggested next steps (e.g., push, gh pr create)"]

  User --> CheckTree --> Fetch --> ResolvePRs --> VerifySubjects --> DryRun
  DryRun -->|yes| Plan --> Success
  DryRun -->|no| CreateBranch --> CherryPick --> Conflict
  Conflict -->|yes| Abort
  Conflict -->|no| Success
Loading

File-Level Changes

Change Details Files
Introduce the package-prs devcontainer CLI to build package branches from multiple PR merge commits.
  • Create an executable package-prs script under the devcontainer scripts directory.
  • Implement argument parsing for PR list, source repo/branch/remote, target base, branch name, dry-run, and force options.
  • Use git commands to fetch the source remote, resolve PR numbers to merge commit SHAs via git log, and sanity-check merge subjects and owners.
  • Create a new local branch from the specified target base and cherry-pick each merge commit with git cherry-pick -m 1, aborting cleanly on conflicts.
  • Support dry-run mode that prints a planned table of merge SHAs, subjects, and stats plus suggested follow-up commands.
  • Relax hard GitHub CLI dependency by only suggesting gh pr create when available, and handle fork PRs and missing/empty flag values more defensively.
.devcontainer/development/scripts/package-prs
Document the package-prs workflow, usage, and recovery steps.
  • Add a markdown guide explaining what package-prs does, why it cherry-picks merge commits, and how it avoids prior bugs with GitHub API and git diff inspection.
  • Document all supported flags, including dry-run and force semantics, and provide example commands for common packaging scenarios.
  • Describe limitations (devcontainer-only, GitHub merge-commit format assumptions, owner checks) and outline recovery steps for failed cherry-picks.
.devcontainer/development/scripts/package-prs.md
Expose the new package-prs tool through the devcontainer help script.
  • Update the dev help script to list package-prs and surface its --help output so it is discoverable by developers.
.devcontainer/development/scripts/help-dev

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new Bash script, package-prs, designed to automate the creation of 'package' branches by cherry-picking merge commits from a list of pull requests. It includes documentation and integration into the development help script. Feedback highlights several areas for improvement: the owner validation check is too restrictive for PRs from forks, the PR list parsing is vulnerable to empty strings which could lead to incorrect commit matching, and the use of '|' as a delimiter for internal data passing is fragile. Additionally, the script requires the GitHub CLI (gh) despite not using it for core logic, and it lacks a mechanism to ensure the target base reference is up to date before branching.

Comment thread .devcontainer/development/scripts/package-prs
Comment thread .devcontainer/development/scripts/package-prs Outdated
Comment thread .devcontainer/development/scripts/package-prs Outdated
Comment thread .devcontainer/development/scripts/package-prs Outdated
Comment thread .devcontainer/development/scripts/package-prs
@LiamStanziani

Copy link
Copy Markdown
Collaborator Author

@SourceryAI review

@LiamStanziani

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.devcontainer/development/scripts/package-prs:
- Around line 55-67: The case block directly assigns "$2" to variables like
PR_LIST, SOURCE_REPO, SOURCE_BRANCH, SOURCE_REMOTE, TARGET_BASE, and BRANCH
which will trigger an unbound-variable error under set -u if a flag is the last
arg; add a small guard function (e.g., ensure_arg_or_err) or inline checks
before each assignment to verify that a next positional argument exists ($# -ge
2 or test -n "${2-}") and call err/usage when missing, then perform the
shift(s); update the --pr, --source-repo, --source-branch, --source-remote,
--target-base, and --branch branches in the case to use that guard so flags
without values produce a friendly error instead of crashing.
- Around line 82-83: Remove the hard failure on missing GitHub CLI by deleting
or making conditional the `command -v gh >/dev/null || { err "gh (GitHub CLI) is
required"; exit 1; }` check; keep `command -v git` as the only mandatory
dependency. Additionally, update the post-run suggestion that mentions `gh` (the
message printed around line ~227) to either only show that suggestion when
`command -v gh` succeeds or replace it with a generic Git-based next-step (e.g.,
push and open a PR via the GitHub web UI) so the script does not assume `gh` is
installed. Ensure references to `command -v gh` and the post-run suggestion
string are updated consistently.

In @.devcontainer/development/scripts/package-prs.md:
- Around line 63-69: The fenced sample-output block in the markdown lacks a
language tag (MD040); update the triple-backtick fence that contains the
PR/SHA/SUBJECT/STATS table so it begins with ```text (i.e., add the "text"
language identifier to the opening ``` fence) to mark the block as plain output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5fa70dd7-7d22-4efb-a330-e9f0e6b68874

📥 Commits

Reviewing files that changed from the base of the PR and between c9dbad8 and 431f250.

📒 Files selected for processing (3)
  • .devcontainer/development/scripts/help-dev
  • .devcontainer/development/scripts/package-prs
  • .devcontainer/development/scripts/package-prs.md

Comment thread .devcontainer/development/scripts/package-prs
Comment thread .devcontainer/development/scripts/package-prs Outdated
Comment thread .devcontainer/development/scripts/package-prs.md Outdated
…empty PRs and missing flag values, warn on fork PRs, fetch target base, tab-delimit resolve_one output, mark md code fence)
@LiamStanziani

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@LiamStanziani

Copy link
Copy Markdown
Collaborator Author

@SourceryAI review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.devcontainer/development/scripts/package-prs (1)

126-140: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate that each PR token is a positive integer before interpolating into --grep.

$pr is splatted directly into the regex passed to git log --grep (line 132). git log --grep uses basic regex by default, so a malformed PR token (e.g., 12.3, 12*, 1[23]) silently matches unintended merges or yields confusing results. A one-line numeric check up front turns these cases into a clean error.

🛡️ Proposed guard
 resolve_one() {
   local pr="$1"
   local subject sha stat
 
+  if [[ ! "$pr" =~ ^[0-9]+$ ]]; then
+    err "invalid PR number: '${pr}' (expected a positive integer)"
+    return 1
+  fi
+
   # Look up by PR number in the merge commit subject
   sha=$(git log --merges \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.devcontainer/development/scripts/package-prs around lines 126 - 140, In
resolve_one(), validate the incoming PR token ($pr) is a positive integer before
it’s interpolated into the git --grep pattern: add a guard right after the
function entry that checks $pr against a digits-only regex (e.g. ^[0-9]+$) and
on failure emit an err message and return non-zero; this prevents malformed
tokens (like 12.3, 1[23], etc.) from being used in git log --grep and keeps the
subsequent sha lookup safe.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.devcontainer/development/scripts/package-prs:
- Around line 51-52: The info() helper writes to stdout and contaminates
resolve_one's output; change info() to write to stderr (redirect its printf to
>&2) or update the two info calls inside resolve_one (the fork-PR warning
branch) to redirect to stderr so resolve_one echoes only the single
tab-separated data line; update references to the info() helper or the specific
calls in resolve_one accordingly so command substitution (line=$(resolve_one
"$pr")) receives only the intended data.
- Around line 166-183: After splitting and filtering RAW_PRS into PRS, add a
post-loop guard to detect an effectively-empty PR list (e.g., inputs like "--pr
','") by checking if the PRS array is empty and aborting with a clear message;
locate the for loop that reads RAW_PRS into PRS/SHAS/SUBJECTS/STATS (uses
symbols RAW_PRS, PRS, SHAS, SUBJECTS, STATS and function resolve_one) and
immediately after that loop add a conditional that exits non-zero (with an err
message referencing the original PR_LIST/RAW_PRS) when PRS has zero elements to
prevent creating a 0-commit branch.

---

Outside diff comments:
In @.devcontainer/development/scripts/package-prs:
- Around line 126-140: In resolve_one(), validate the incoming PR token ($pr) is
a positive integer before it’s interpolated into the git --grep pattern: add a
guard right after the function entry that checks $pr against a digits-only regex
(e.g. ^[0-9]+$) and on failure emit an err message and return non-zero; this
prevents malformed tokens (like 12.3, 1[23], etc.) from being used in git log
--grep and keeps the subsequent sha lookup safe.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc002ecc-b276-443e-9cff-70eaad7272c4

📥 Commits

Reviewing files that changed from the base of the PR and between 431f250 and 4a1c77a.

📒 Files selected for processing (2)
  • .devcontainer/development/scripts/package-prs
  • .devcontainer/development/scripts/package-prs.md
✅ Files skipped from review due to trivial changes (1)
  • .devcontainer/development/scripts/package-prs.md

Comment on lines +51 to +52
err() { printf 'Error: %s\n' "$*" >&2; }
info() { printf '==> %s\n' "$*"; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

info() writes to stdout and corrupts resolve_one's captured output for fork PRs.

resolve_one is invoked via command substitution (line=$(resolve_one "$pr"), line 174), and its contract per the doc-comment on line 124 is to echo a single tab-separated data line. However, info() (line 52) writes to stdout, so when the fork-PR branch fires at lines 154–155, both info lines get prepended into $line. The read at line 178 only consumes the first line, so sha is assigned ==>, subject gets the warning text, and the real SHA/subject/stat data is dropped. The script then attempts git cherry-pick -m 1 "==>", which fails with a misleading "bad object" error.

This is a regression introduced by the new fork-warning feature in this PR.

🛠️ Suggested fix — route `info` to stderr
 err()  { printf 'Error: %s\n' "$*" >&2; }
-info() { printf '==> %s\n' "$*"; }
+info() { printf '==> %s\n' "$*" >&2; }

Alternatively, redirect just the two calls inside resolve_one:

   if [[ "$subject" != *"from ${SOURCE_OWNER}/"* ]]; then
-    info "PR #${pr}: merge subject not 'from ${SOURCE_OWNER}/...' (likely a fork PR)"
-    info "  got: $subject"
+    info "PR #${pr}: merge subject not 'from ${SOURCE_OWNER}/...' (likely a fork PR)" >&2
+    info "  got: $subject" >&2
   fi

Also applies to: 153-156, 174-178

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.devcontainer/development/scripts/package-prs around lines 51 - 52, The
info() helper writes to stdout and contaminates resolve_one's output; change
info() to write to stderr (redirect its printf to >&2) or update the two info
calls inside resolve_one (the fork-PR warning branch) to redirect to stderr so
resolve_one echoes only the single tab-separated data line; update references to
the info() helper or the specific calls in resolve_one accordingly so command
substitution (line=$(resolve_one "$pr")) receives only the intended data.

Comment on lines +166 to +183
info "Resolving merge SHAs for PRs: ${PR_LIST}"

IFS=',' read -ra RAW_PRS <<< "$PR_LIST"
declare -a PRS=() SHAS=() SUBJECTS=() STATS=()

for pr in "${RAW_PRS[@]}"; do
# Skip empty elements from a stray comma in --pr (e.g., "1,,2" or ",1").
[[ -z "$pr" ]] && continue
if ! line=$(resolve_one "$pr"); then
err "aborting; resolution failed for PR #${pr}"
exit 1
fi
IFS=$'\t' read -r sha subject stat <<< "$line"
PRS+=("$pr")
SHAS+=("$sha")
SUBJECTS+=("$subject")
STATS+=("$stat")
done

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Guard against an effectively-empty PR list after normalization.

PR_LIST non-emptiness is checked pre-normalization (line 79), but inputs like --pr "," or --pr ",,," survive that check, get whitespace-stripped, then every element is skipped by the empty-token filter at line 173. The loop completes with empty arrays, the plan table prints just a header, and the script proceeds to create a 0-commit branch. Adding a post-loop assertion keeps the error message close to the user's intent.

🛡️ Proposed guard
 done
+
+if (( ${`#PRS`[@]} == 0 )); then
+  err "no valid PR numbers in --pr='${PR_LIST}'"
+  exit 2
+fi
 
 # --------------------------------------------------------------- print plan
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.devcontainer/development/scripts/package-prs around lines 166 - 183, After
splitting and filtering RAW_PRS into PRS, add a post-loop guard to detect an
effectively-empty PR list (e.g., inputs like "--pr ','") by checking if the PRS
array is empty and aborting with a clear message; locate the for loop that reads
RAW_PRS into PRS/SHAS/SUBJECTS/STATS (uses symbols RAW_PRS, PRS, SHAS, SUBJECTS,
STATS and function resolve_one) and immediately after that loop add a
conditional that exits non-zero (with an err message referencing the original
PR_LIST/RAW_PRS) when PRS has zero elements to prevent creating a 0-commit
branch.

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