fix: forgejo remote detection fallback + add mcd-tracker board #149
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/claude-custom!149
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "148-fix-forgejo-remote-detection-add-mcd-tra"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes remote detection for repos that don't use
originas their remote name (e.g., pal-e-platform usesforgejo), and adds the mcd-tracker board to the shared boards config.Changes
hooks/session-start-context.sh: line 71 now falls back to the first available remote whenorigindoesn't exist, so project detection works for pal-e-platformhooks/boards-config.sh: added"board-mcd-tracker"to the BOARDS arrayTest Plan
session-start-context.shcorrectly detects the remote URL when run from~/pal-e-platform(which usesforgejoas its remote name)Review Checklist
bash -n) for both modified filesRelated
Self-Review: LGTM
Files changed: 2 (2 additions, 1 deletion)
session-start-context.sh
originfirst, falls back to first available remote viagit remote | head -1git remote get-url ""fails silently and the outer|| trueensures no error propagationboards-config.sh
"board-mcd-tracker"added in correct position (after last entry, before closing paren)Syntax
Both files pass
bash -nsyntax check. No issues found.PR #149 Review
DOMAIN REVIEW
Tech stack: Bash (shell hooks for Claude Code session management)
Change 1 -- Remote detection fallback (
hooks/session-start-context.shline 71):The fix adds a fallback chain: try
originfirst, then fall back to the first available remote (git remote | head -1). This correctly solves project detection for repos likepal-e-platformwhere the remote is namedforgejoinstead oforigin.2>/dev/nullon both inner commands, outer|| trueensures fail-open behavior consistent with the script's design philosophy (line 9: "Fail-open: any error exits 0 silently").git remote | head -1returns empty,git remote get-url ""fails silently via2>/dev/null,cwd_remotestays empty, and theif [[ -n "$cwd_remote" ]]guard on line 73 prevents further processing. Safe.head -1picks the first one. For the specific use case (pal-e-platform hasforgejoas its only remote), this is correct.Change 2 -- Board addition (
hooks/boards-config.sh):Adding
"board-mcd-tracker"to the BOARDS array. Format matches existing entries. Trivially correct.Pre-existing observation: The inline fallback functions at lines 22 and 29 of
session-start-context.shstill hardcodeoriginfor platform detection (Forgejo vs GitHub). However, these fallbacks only execute whenforgejo-helper.shis unavailable, and the realforgejo-helper.shalready checks ALL remotes (line 39). This is out of scope for this PR but worth noting for the nit-bundle issue #147.BLOCKERS
None.
NITS
Pre-existing
originhardcoding in inline fallbacks (lines 22, 29): The inlineis_forgejo_repoandis_github_repofallbacks still usegit remote get-url origin. Ifforgejo-helper.shis unavailable AND the repo uses a non-originremote name, platform detection would fail. This is pre-existing and out of scope, but should be tracked. Issue #147 may already cover this.Line length: The new line 71 is quite long (~110 chars) due to the nested fallback. A multi-line approach using a helper variable would improve readability, e.g.:
Non-blocking -- current form is functionally correct.
SOP COMPLIANCE
148-fix-forgejo-remote-detection-add-mcd-trastarts with148)plan-pal-e-agencyPROCESS OBSERVATIONS
origindoesn't exist). The board config addition is append-only.plan-pal-e-agencyper SOP. This is a minor process gap, not a code quality issue.VERDICT: APPROVED