Skip to content

ci(packaging): shellcheck the packaging scripts and document entry points - #29758

Merged
chrisnojima merged 5 commits into
nojima/HOTPOT-packaging-stale-scriptsfrom
nojima/HOTPOT-packaging-shellcheck
Oct 15, 2026
Merged

chrisnojima merged 5 commits into
nojima/HOTPOT-packaging-stale-scriptsfrom
nojima/HOTPOT-packaging-shellcheck

Conversation

@chrisnojima

@chrisnojima chrisnojima commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

Guards the packaging scripts against regressions. Stacked on #29757.

  • New Jenkins stage: Shellcheck, at the start of test_linux in the Jenkinsfile, runs shellcheck -S warning -x from the repo root over packaging/**/*.sh, shared/react-native/gobuild.sh and packageAndBuild.sh.
    • It runs only when one of those files or the Jenkinsfile changes, using the same change detection as the existing Jenkinsfile-change check.
    • Jenkins installs shellcheck itself: the setup step, next to the golangci-lint install, downloads shellcheck v0.11.0 for the node's architecture into $GOBIN and checks its SHA-256. A failed download or checksum mismatch stops the setup before anything is extracted.
    • A failure fails continuous-integration/jenkins/branch, which is also the check the release wait-ci gate in lib.sh waits on.
  • Warning-level fixes so the job starts green:
    • ${BASH_SOURCE[0]} where scripts used bare $BASH_SOURCE;
    • # shellcheck source= directives;
    • removed unused variables;
    • a quoted $(...) and a quoted trap string;
    • quoted bundle URLs in packageAndBuild.sh. Unquoted, the & in them sent curl to the background and turned the rest of the URL into stray variable assignments. Those pre-warm requests are kept non-fatal. They only run when packageAndBuild.sh gets platform arguments, and rn:start:legacy doesn't pass any. The constant-word case checks there are now plain if tests that behave the same;
    • the single-architecture loops in linux/deb/layout_repo.sh and linux/rpm/layout_repo.sh stay loops, so another architecture can be added, with SC2043 disabled on them.
  • packaging/README.md:
    • a table of each entry script, what launches it (keybot, winbot or the Linux build host) and the environment it reads;
    • KBFS_COMMIT is also listed: keybot still sends it, but nothing reads it;
    • sections on lib.sh and the Jenkins shellcheck stage.

Testing

  • This PR changes the Jenkinsfile, so the Shellcheck stage runs on it.
  • The install snippet, run locally as Groovy renders it: the real checksum installs shellcheck; a corrupted checksum fails and extracts nothing.
  • The edited scripts passed the same shellcheck command in an earlier GitHub Actions run of this PR.
  • Every edited script passes bash -n.

@chrisnojima
chrisnojima added this pull request to stack #29759 October 12, 2026 17:48
@chrisnojima chrisnojima changed the title nojima/HOTPOT packaging shellcheck ci(packaging): shellcheck the packaging scripts and document entry points Oct 12, 2026
Comment thread .github/workflows/shellcheck.yml Outdated
@chrisnojima
chrisnojima marked this pull request as ready for review October 14, 2026 13:50
…y points

- New GitHub workflow runs `shellcheck -S warning -x` over packaging/**/*.sh,
  gobuild.sh and packageAndBuild.sh on PRs and master pushes that touch them.
- Fix the warning-level findings: ${BASH_SOURCE[0]}, source directives, unused
  variables, a quoted $(...) and trap string, and unquoted URLs in
  packageAndBuild.sh whose `&` backgrounded curl.
- packaging/README.md maps each entry script to what launches it and the
  environment it reads.
@chrisnojima
chrisnojima force-pushed the nojima/HOTPOT-packaging-shellcheck branch from 2678c29 to 2edcc45 Compare October 14, 2026 14:01
@chrisnojima
chrisnojima merged commit c7e63c5 into master Oct 15, 2026
1 check passed
@chrisnojima
chrisnojima deleted the nojima/HOTPOT-packaging-shellcheck branch October 15, 2026 18:36
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