Skip to content

chore(ci): enable yarn hardened mode and immutable installs (API-476) - #6915

Merged
MarioAlexandruDan merged 7 commits into
mainfrom
chore/api-476-yarn-hardened-installs
Aug 19, 2026
Merged

MarioAlexandruDan merged 7 commits into
mainfrom
chore/api-476-yarn-hardened-installs

Conversation

@MarioAlexandruDan

@MarioAlexandruDan MarioAlexandruDan commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

🧭 What and Why

🎟 JIRA Ticket: API-476

Changes included:

  • Turn on yarn hardened mode and remove the explicit immutable install opt-outs on the two CI installs in the setup action (.github/actions/setup/action.yml:49 and :110). Immutable installs are already yarn's default when CI is set, the old lines were opting out of it.

  • The post codegen step that updates yarn.lock keeps immutable installs off since it intentionally rewrites the lockfile, but now runs with hardened mode (.github/workflows/check.yml:223).

  • Also enable hardened mode on the post codegen install spawned by yarn cli build (scripts/buildLanguages.ts:57), CI only so local builds keep their speed.

  • Same treatment for the remaining CI install sites found on a full sweep: CTS runs and generation (scripts/cts/runCts.ts:92, scripts/cts/generate.ts:31), docs generation (scripts/docs/generate.ts:32) and the website build (scripts/website/build.sh:11), all gated on CI so local runs are unchanged. The TS sites share a YARN_HARDENED_MODE_PREFIX constant from scripts/common.ts.

  • Behavior note: with the root install strictly immutable, a PR that leaves a lockfile desynced now fails at the Setup step across the job matrix instead of being silently auto-repaired. That is the intent of the change, but the first dependency bump after merge will surface it as multiple red jobs.

  • Hardened mode also on the standalone JS client release workflow install (clients/algoliasearch-client-javascript/.github/workflows/release.yml:30). It runs on push where yarn's default leaves hardened mode off, and it feeds the npm publish.

πŸ§ͺ Test

  • Ran both installs locally with the new flags against the committed lockfiles: repo root done in 45s, JS client in 32s, both exit code 0.
  • actionlint is clean on the changed lines (remaining warnings are pre-existing shellcheck findings on untouched lines).

@algolia-api-clients-automation-bot

algolia-api-clients-automation-bot Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

No code generated

If you believe code should've been generated, please, report the issue.

πŸ“Š Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
javascript 2224
go 1899
php 1683
python 1347
csharp 1308
java 1108
swift 996
ruby 924
scala 712

@aikido-pr-checks

aikido-pr-checks Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

Summary by Aikido

Security Issues: 0 Quality Issues: 0 Resolved Issues: 0

⚑ Enhancements

  • Enabled Yarn hardened mode and immutable installs across core CI workflows
  • Applied CI-gated hardened installs to generation, CTS, documentation, and website builds
  • Enabled hardened dependency installation for JavaScript client release publishing

πŸ”§ Refactors

  • Centralized the hardened-mode command prefix for TypeScript build scripts

More info

@MarioAlexandruDan MarioAlexandruDan self-assigned this Aug 18, 2026
@MarioAlexandruDan
MarioAlexandruDan force-pushed the chore/api-476-yarn-hardened-installs branch from 4058b85 to a3c5c4c Compare August 18, 2026 14:32
@MarioAlexandruDan
MarioAlexandruDan marked this pull request as ready for review August 18, 2026 14:32
@MarioAlexandruDan
MarioAlexandruDan requested a review from a team as a code owner August 18, 2026 14:32
@github-actions

github-actions Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

@MarioAlexandruDan
MarioAlexandruDan enabled auto-merge (squash) August 19, 2026 11:20
@MarioAlexandruDan
MarioAlexandruDan merged commit 120ed46 into main Aug 19, 2026
37 checks passed
@MarioAlexandruDan
MarioAlexandruDan deleted the chore/api-476-yarn-hardened-installs branch August 19, 2026 11:36
algolia-api-clients-automation-bot Bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Aug 19, 2026
… (generated)

algolia/api-clients-automation#6915

Co-authored-by: Mario-Alexandru Dan <marioalexandrudan@gmail.com>
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