Skip to content

Run ci-job-timings on macOS bash 3.2 - #39

Merged
itsryanarmani merged 1 commit into
mainfrom
fix/ci-job-timings-bash3
Aug 28, 2026
Merged

itsryanarmani merged 1 commit into
mainfrom
fix/ci-job-timings-bash3

Conversation

@itsryanarmani

Copy link
Copy Markdown
Owner

The problem

ci-job-timings does not run on macOS. It aborts before doing any work:

./ci-job-timings: line 124: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]

declare -A needs bash 4. macOS ships bash 3.2.57, and /usr/bin/env bash resolves to it. So the tool was unrunnable on the machine it is most often run from, while ci-pr-latency and ci-runner-audit sitting next to it worked fine.

I hit this while taking a CI baseline across the private repos and had to reimplement the same aggregation by hand.

The fix

The associative array only mapped a run id to its workflow path, so that two workflows both defining a job called test do not collapse into one row. A tab-separated temp file plus an awk lookup does the same job and runs anywhere. The temp file joins the existing trap cleanup.

No behaviour change: same grouping, same output, same --json shape.

Verified

Both output modes, against two real repos, on bash 3.2.57:

$ ./ci-job-timings pooriaarab/popcornteam --limit 12
JOB                          COUNT   MEDIAN      P95      MAX RUNNER
---------------------------- ----- -------- -------- -------- ------
auto-format.yml/Auto-format      1      219      219      219 ubicloud-standard-2
vibecodereview.yml/vibeco...     1      207      207      207 ubicloud-standard-2
oxlint.yml/oxlint                2       20       22       22 ubuntu-latest
gitleaks.yml/Secret Scan         2       13       14       14 ubuntu-latest

--json emits the same schema as before.

`declare -A` needs bash 4. macOS ships bash 3.2.57 and `/usr/bin/env bash`
resolves to it, so the script aborted before doing any work:

    ./ci-job-timings: line 124: declare: -A: invalid option

That made the tool unrunnable on the machine it is most often run from,
while `ci-pr-latency` and `ci-runner-audit` next to it worked fine.

The associative array only mapped a run id to its workflow path. A
tab-separated temp file and an `awk` lookup do the same job and run
anywhere. The temp file joins the existing `trap` cleanup.

No behaviour change: same grouping, same output, same `--json` shape.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 16 minutes.

View limit details

Limit details: You’ve used all 5 included reviews currently available. Your 52 included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f88e7539-def1-4704-8401-18b524b9847e

📥 Commits

Reviewing files that changed from the base of the PR and between 1c8df6a and 3590504.

📒 Files selected for processing (1)
  • ci-job-timings

Comment @coderabbitai help to get the list of available commands.

@itsryanarmani
itsryanarmani merged commit 7f5fa1a into main Aug 28, 2026
2 of 3 checks passed
@kilo-code-bot

kilo-code-bot Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • ci-job-timings

Reviewed by free · Input: 28.7K · Output: 8.1K · Cached: 90.6K

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.

1 participant