Skip to content

fix(stack): derive repository from git remote when --repository is not provided#1123

Merged
mergify[bot] merged 1 commit intomainfrom
devs/JulianMaurin/fix/stack-checkout-repository-default/Ia877c5731f169267d4285b8f5997f802f44298c9
Apr 10, 2026
Merged

fix(stack): derive repository from git remote when --repository is not provided#1123
mergify[bot] merged 1 commit intomainfrom
devs/JulianMaurin/fix/stack-checkout-repository-default/Ia877c5731f169267d4285b8f5997f802f44298c9

Conversation

@JulianMaurin
Copy link
Copy Markdown
Contributor

The stack checkout command crashed with AttributeError: 'NoneType' object has no attribute 'split'
when --repository was omitted, because the option had no default. Now falls back to resolving
the user/repo from the git remote URL, consistent with stack list and stack push.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Copilot AI review requested due to automatic review settings April 10, 2026 12:17
@JulianMaurin
Copy link
Copy Markdown
Contributor Author

This pull request is part of a stack:

  1. fix(stack): derive repository from git remote when --repository is not provided (#1123) 👈
  2. fix(stack): normalize --branch by stripping prefix and change ID suffix (#1124)

@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 12:17 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ia877c5731f169267d4285b8f5997f802f44298c9 branch from e3e2952 to 7b916b5 Compare April 10, 2026 12:22
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 12:22 Failure
@JulianMaurin JulianMaurin marked this pull request as ready for review April 10, 2026 12:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes mergify stack checkout crashing when --repository is omitted by deriving owner/repo from the configured git remote URL (aligned with how stack list / stack push resolve the repository).

Changes:

  • Make --repository optional in stack checkout and fall back to parsing remote.<trunk-remote>.url.
  • Add tests covering: no stacked PRs, deriving repository from remote, and honoring an explicit --repository.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
mergify_cli/stack/cli.py Updates checkout CLI handler to derive user/repo from git remote when --repository is not provided.
mergify_cli/tests/stack/test_checkout.py Adds new async tests for checkout behavior and repository resolution paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ia877c5731f169267d4285b8f5997f802f44298c9 branch from 7b916b5 to 5d97975 Compare April 10, 2026 12:26
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 12:26 Failure
jd
jd previously approved these changes Apr 10, 2026
@mergify mergify bot requested a review from a team April 10, 2026 12:28
…t provided

The `stack checkout` command crashed with `AttributeError: 'NoneType' object has no attribute 'split'`
when `--repository` was omitted, because the option had no default. Now falls back to resolving
the user/repo from the git remote URL, consistent with `stack list` and `stack push`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change-Id: Ia877c5731f169267d4285b8f5997f802f44298c9
@JulianMaurin JulianMaurin force-pushed the devs/JulianMaurin/fix/stack-checkout-repository-default/Ia877c5731f169267d4285b8f5997f802f44298c9 branch from 5d97975 to fe99c6c Compare April 10, 2026 12:31
@mergify mergify bot dismissed jd’s stale review April 10, 2026 12:31

Pull request has been modified.

@mergify mergify bot deployed to Mergify Merge Protections April 10, 2026 12:31 Active
@mergify mergify bot requested a review from a team April 10, 2026 13:36
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 2026

Merge Queue Status

This pull request spent 2 minutes 28 seconds in the queue, including 1 minute 55 seconds running CI.

Required conditions to merge

mergify bot added a commit that referenced this pull request Apr 10, 2026
@mergify mergify bot added the queued label Apr 10, 2026
mergify bot added a commit that referenced this pull request Apr 10, 2026
@mergify mergify bot merged commit 9afa9b4 into main Apr 10, 2026
11 checks passed
@mergify mergify bot deleted the devs/JulianMaurin/fix/stack-checkout-repository-default/Ia877c5731f169267d4285b8f5997f802f44298c9 branch April 10, 2026 13:41
@mergify mergify bot removed the queued label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants