Skip to content

fix: support default repo in macos issue stores - #971

Merged
aaronjmars merged 1 commit into
aeonfun:mainfrom
Svector-anu:fix/macos-issue-store-default-repo-2026-08-26
Aug 27, 2026
Merged

fix: support default repo in macos issue stores#971
aaronjmars merged 1 commit into
aeonfun:mainfrom
Svector-anu:fix/macos-issue-store-default-repo-2026-08-26

Conversation

@Svector-anu

Copy link
Copy Markdown
Contributor

What

Make the issue-backed cron-state and health helpers work in their documented current-repository mode on macOS Bash 3.2.

Why

Both scripts initialized REPO_ARGS=() and expanded "${REPO_ARGS[@]}" under set -u. The macOS system Bash treats that zero-element expansion as an unbound variable, so leaving GH_REPO unset aborted both helpers before gh ran:

scripts/state_store.sh: line 22: REPO_ARGS[@]: unbound variable
scripts/health_issue.sh: line 20: REPO_ARGS[@]: unbound variable

The existing state-store test even had to set a dummy GH_REPO specifically to avoid this failure. GitHub Actions uses a newer Bash, so production scheduling was not broken; the impact is local macOS operation and testing of the issue-backed self-heal path.

Fix

  • Route gh issue calls through a small helper that adds --repo "$GH_REPO" only when the override is present.
  • Otherwise invoke gh issue normally and let gh resolve the current repository.
  • Add offline coverage with GH_REPO explicitly unset for both helpers.
  • Keep the existing race/convergence assertions, while skipping the historical before-side when the resolved base already contains that older race fix.

Verification

  • bash scripts/tests/test_state_store.shALL PASS.
  • bash scripts/tests/test_health_issue.shALL PASS.
  • bash -n scripts/state_store.sh scripts/health_issue.sh scripts/tests/test_state_store.sh scripts/tests/test_health_issue.sh — passed.
  • ShellCheck 0.11.0, error-severity gate over all four changed shell files — passed.
  • git diff --check — passed.

Mutation test on macOS Bash 3.2.57, reverting only the two source fixes while keeping the tests:

state_store mutation rc=1
scripts/state_store.sh: line 22: REPO_ARGS[@]: unbound variable
FAIL - ensure failed with GH_REPO unset (current-repo default)

health_issue mutation rc=1
scripts/health_issue.sh: line 20: REPO_ARGS[@]: unbound variable
FAIL - ensure failed with GH_REPO unset (current-repo default)

Restoring the source fixes returned both offline suites to ALL PASS.

@aaronjmars
aaronjmars merged commit 252947e into aeonfun:main Aug 27, 2026
2 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.

2 participants