Skip to content

fix: RepoPath resolution for issue and PR keybinding commands#825

Merged
dlvhdr merged 3 commits intodlvhdr:mainfrom
seflue:fix/repo-path-fallback
Apr 5, 2026
Merged

fix: RepoPath resolution for issue and PR keybinding commands#825
dlvhdr merged 3 commits intodlvhdr:mainfrom
seflue:fix/repo-path-fallback

Conversation

@seflue
Copy link
Copy Markdown
Contributor

@seflue seflue commented Apr 3, 2026

Fixes #496

  • I have read the CONTRIBUTING.md and AI_POLICY.md guides

Custom keybinding commands using {{.RepoPath}} fail for issues and PRs
when repoPaths is empty, even when running gh-dash from inside a repo.
Branch and universal commands don't have this problem because they read
ctx.RepoPath directly.

The root cause is in runCustomCommand: it only resolves RepoPath via
GetRepoLocalPath (which checks the repoPaths config), with no fallback
to the current repo.

The first commit extracts the resolution logic for testability, the second
adds the fallback and tests. Config matches still take priority.

How Did You Test this Change?

  • Tests verified red-green (fail without fix, pass with fix)
  • Manually tested: e on an issue with empty repoPaths, gh-dash started
    from inside a repo

AI-assisted with Claude Code, reviewed and tested manually.

dlvhdr
dlvhdr previously approved these changes Apr 4, 2026
Copy link
Copy Markdown
Owner

@dlvhdr dlvhdr left a comment

Choose a reason for hiding this comment

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

very nice! thank you

@dlvhdr dlvhdr changed the title Fix RepoPath resolution for issue and PR keybinding commands fix: RepoPath resolution for issue and PR keybinding commands Apr 4, 2026
RepoPath resolution for keybinding commands is only possible
through repoPaths config. Fixing the missing fallback to the
current working directory requires the resolution logic to be
testable independently of the full UI model.

No behavior change.
@seflue
Copy link
Copy Markdown
Contributor Author

seflue commented Apr 5, 2026

Had to apply some reformatting to make the linter happy. Could you please reapprove?

@seflue seflue requested a review from dlvhdr April 5, 2026 01:28
dlvhdr
dlvhdr previously approved these changes Apr 5, 2026
Keybinding commands using {{.RepoPath}} now resolve the path
from the current working directory when repoPaths config has no
match. This aligns issue and PR commands with the existing
behavior of branch and universal commands.
@seflue
Copy link
Copy Markdown
Contributor Author

seflue commented Apr 5, 2026

Sorry for the hassle, I again made a mistake in pre-linting. That I can see the shortcomings of my work only after your approval because of Github constraints is new to me and Go is not my natural ecosystem (yet).
I added a hint about linting to the CONTRIBUTING.md to spare others these problems.

@dlvhdr
Copy link
Copy Markdown
Owner

dlvhdr commented Apr 5, 2026

Yea sorry about that, it's only for first time contributors

@dlvhdr dlvhdr merged commit 744dda9 into dlvhdr:main Apr 5, 2026
3 checks passed
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.

[BUG] Failed to parsetemplate error shown when missing repo paths

2 participants