Skip to content

fix(#1833): compare GitHub owner logins case-insensitively in PR recovery - #1836

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/1833-owner-case-insensitive
Open

fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/1833-owner-case-insensitive

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

This changes scripts/lib/github-code-ops.lib.sh so that both _forge_resolve_existing_pr_url and forge_list_prs_for_branch compare GitHub owner logins case-insensitively (jq ascii_downcase). The bundled scripts that inline the lib (post-code.sh, pre-code.sh, pre-code-jira.sh) are regenerated.

Why

REPO_FULL_NAME takes its owner spelling from ISSUE_URL, but gh pr list returns the canonical headRepositoryOwner.login. With an issue URL like https://github.com/Fullsend-Ai/agents/issues/123, the case-sensitive check dropped the matching same-repo PR. Recovery then failed closed, and post-code reported a creation failure for a PR that existed.

Head and base branch matching (headRefName, baseRefName, --head, --base) stays exact because git refs are case-sensitive. GitLab is unchanged.

Testing

  • run_gh_create_pr_recover_test in scripts/post-code-test.sh now accepts an optional REPO_FULL_NAME (default org/repo).
  • New fixture create-pr-already-exists-owner-case-mismatch-recovers: REPO_FULL_NAME=Org/repo, the API login is org, and there is one matching PR. Recovery returns its URL. This test fails without the lib change.
  • forge_list_prs_for_branch has no direct test, so none was added. I checked its jq filter by hand against mixed-case input.
  • scripts/post-code-test.sh passes in source and bundled modes, except for 3 signed-commits checks (code-harness-signed-commits-default-off, eval-code-harness-signed-commits-on, signed-commits-off-plain-push). Those 3 also fail on unmodified main.

Caveats

  • make cannot run in the sandbox (/bin/sh is not permitted). I regenerated the bundles and checked them for staleness by running scripts/bundle-sh.sh directly over BUNDLE_SRCS. Please confirm with make check-bundle in CI.
  • pre-commit could not fetch its hook repos (TLS error). shellcheck v0.10.0 (the pinned rev, with the configured args) passed when run directly, and so did lint-release-cases. scan-secrets covered gitleaks.
  • make lint (skillsaw) did not run because uvx is unavailable. It lints only skills and agent docs, which this change does not touch.

🤖 Generated with Claude Code


Closes #1833

Post-script verification

  • Branch is not main/master (agent/1833-owner-case-insensitive)
  • Secret scan passed (gitleaks — f4acd0350dc9445112f4a0a6f781c02a31a64636..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

…very

REPO_FULL_NAME takes its owner spelling from ISSUE_URL, while the
GitHub API returns the canonical login. Owner logins are
case-insensitive, but _forge_resolve_existing_pr_url and
forge_list_prs_for_branch compared headRepositoryOwner.login with
case-sensitive equality. A mixed-case issue URL owner therefore dropped
the matching same-repo PR, and post-code reported a creation failure
for a PR that existed.

Both jq filters now compare owner logins with ascii_downcase, the same
approach review-ops.lib.sh uses for reviewers. Head and base branch
matching stays exact because git refs are case-sensitive. GitLab is
unchanged.

Bundled scripts (post-code.sh, pre-code.sh, pre-code-jira.sh) were
regenerated with scripts/bundle-sh.sh. The PR-recovery test harness
now accepts an optional REPO_FULL_NAME, and a new fixture checks that
recovery succeeds when the owner differs only by case.

forge_list_prs_for_branch has no direct test, so none was added.

Note: make could not run in the sandbox (/bin/sh not permitted), so
the bundles were regenerated and checked by calling bundle-sh.sh
directly. pre-commit could not fetch its hook repos (TLS error).
shellcheck v0.10.0 (the pinned rev) passed when run directly, and so
did lint-release-cases. The whitespace and line-ending checks were
done by hand, and scan-secrets covered gitleaks. make lint (skillsaw)
could not run because uvx is unavailable, but it lints only skills and
agent docs, which this change does not touch. post-code-test.sh passes
in source and bundled modes, except for 3 signed-commits checks that
also fail on unmodified main.

Closes #1833

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Oct 29, 2026
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner October 29, 2026 11:15
@fullsend-ai-review

fullsend-ai-review Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:17 AM UTC · Completed 11:25 AM UTC

Commit: c999042 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.30

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Oct 29, 2026
@fullsend-ai-review

Copy link
Copy Markdown

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Small, well-specified bugfix with complete acceptance criteria coverage and matching scope, moderated to score 2 by protected script modifications and high recent churn across touched files.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] scripts/lib/github-code-ops.lib.sh, scripts/post-code.sh, scripts/pre-code.sh, scripts/pre-code-jira.sh, scripts/post-code-test.sh — This PR modifies files under the protected scripts/ path. The PR links issue PR recovery treats GitHub owner logins as case-sensitive #1833, which authorizes the change, and the description explains the rationale. Human approval is still required for protected-path changes, whatever the context.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Oct 29, 2026

This branch was successfully deployed

1 active deployment
dev — c9990425 Deployed Oct 29, 2026 by fullsend-ai-coder[bot] via behaviour #1423
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Triggers review agent dispatch requires-manual-review Review requires human judgment risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR recovery treats GitHub owner logins as case-sensitive

1 participant