Skip to content

chore(ci): add lint+format PR gate, reusable template, and consolidate Node 24#992

Open
MiguelLZPF wants to merge 2 commits intodevelopmentfrom
chore/ci-add-lint-format-workflows
Open

chore(ci): add lint+format PR gate, reusable template, and consolidate Node 24#992
MiguelLZPF wants to merge 2 commits intodevelopmentfrom
chore/ci-add-lint-format-workflows

Conversation

@MiguelLZPF
Copy link
Copy Markdown
Contributor

Description

Adds a PR-time CI gate that runs npm run <module>:format:check && npm run <module>:lint for ATS and Mass Payout independently, plus the related CI housekeeping required to make the gate land cleanly.

Highlights

  • New workflows 103-flow-ats-lint.yaml and 104-flow-mp-lint.yaml — trigger on PRs touching their respective module paths.
  • Reusable template 800-call-lint-format.yaml (Hiero [CALL] 800-prefix) — both 103 and 104 are thin shells that delegate to it.
  • Always full-tree mode — deterministic, mirrors the local npm run <module>:lint contract. Delta-mode scripts kept in package.json for local dev only.
  • Node centralised to .nvmrc (24.15.0 — current Active LTS, exact-patch pin) via node-version-file: in every setup-node step. Drops 11 hard-coded node-version: 22.20.0 references.
  • Obsolete NODE_OPTIONS=--max-old-space-size=... heap bumps removed across package.jsons and workflow env: blocks. They pre-date the lib-based architecture migration and are no longer required (verified: contracts/sdk/web build green, web tests pass).
  • Workflow name: prefixes aligned with filenames — fixes 6 deviant entries (e.g. 001-flow-pull-request-formatting.yaml previously declared "000: [FLOW]"). Hiero naming is now consistent across all 11 workflows.
  • Runner consolidation300/301 switched from ubuntu-latest to token-studio-linux-medium for parity with the rest of the repo.
  • @typescript-eslint/no-dupe-class-members enabled in MP SDK eslint config (TS-aware variant; the base no-dupe-class-members misreports overload signatures).

Lint debt cleanup (Commit 2)

The new gate would have failed on day-one because of pre-existing latent debt that lint-staged never surfaced (it only checks staged files). Addressed alongside:

  • ATS web — 22 errors → 0 (16 files: removed unused vars/expressions, bare catch {} for unused caught errors, letconst, removed test.only debug leftover, fixed two expect(...) calls missing matchers, two duplicate test titles).
  • ATS SDK — 16 errors → 0 (12 files: stale eslint-disable for removed rule names purged, bare catch, unused vars/imports/createMock removed, unused expressions converted to if).
  • MP frontend — 14 errors → 0 (8 files: bare catch, unused destructure removed, prefer-const, conditional expect refactored to setup-driven unconditional asserts).
  • MP contracts compiled artefactsscripts/results/*.js removed from tracking (had .ts siblings — accidental check-ins). Added gitignore safety net.

⚠️ Deliberately skipped — must be addressed in a follow-up

Workspace Errors remaining Rule
packages/mass-payout/contracts 20 max-len in lifecyclecashflow.test.ts (long it("…") test descriptions)
packages/mass-payout/sdk 4 prettier/prettier in lifeCycleCashFlow/operations/Execute*CommandHandler.ts (long class declarations that prettier flattens past the 120-char limit)

These are length-rule conflicts where prettier's printWidth: 120 and ESLint's max-len: 120 disagree on string literals and long class declarations. 104-flow-mp-lint.yaml will fail until they are resolved. Recommended approaches for the follow-up PR:

  1. Wrap the test descriptions using template-literal concatenation (preserves readability), OR
  2. Relax max-len to a higher cap for MP (e.g. 140), OR
  3. Disable max-len in MP eslint configs and defer entirely to prettier.

This PR intentionally does NOT pick a direction — it surfaces the debt cleanly for a separate decision.

Type of change

  • Refactor 🔧
  • Bug fix 🐞
  • New feature ✨
  • Breaking change 💥
  • Documentation update 📖

Testing

  • npm run ats:format:check → green.
  • npm run ats:lint → green (0 errors, 2 pre-existing warnings).
  • npm run ats:contracts:build / ats:sdk:build / ats:web:build → green (without NODE_OPTIONS heap bumps).
  • npm run ats:web:test → 183/183 passing, 79 snapshots.
  • npx jest TabContent.test -t "should pass t function to components" → 1/1 passing (verifies the restored assertion).
  • npx prettier --check on all new YAMLs → green.
  • npm run mass-payout:format:check → green.
  • npm run mass-payout:lint → 24 errors (all length-rule, scoped above).

@MiguelLZPF MiguelLZPF self-assigned this Apr 27, 2026
@MiguelLZPF MiguelLZPF force-pushed the chore/ci-add-lint-format-workflows branch 6 times, most recently from d52b8b4 to b04f320 Compare April 28, 2026 09:34
…ation

- Added ATS (103) and MP (104) lint+format workflow gates to PR pipeline
- Introduced reusable 800-call-lint-format template (Hiero [CALL] pattern)
  - Supports delta-mode (changed files only) for dev velocity
  - Full-tree mode for CI accuracy on PR/push
  - Space-safe with git diff -z / xargs -0
- Centralized Node.js version management via .nvmrc (LTS 24.15.0)
  - All workflows now use node-version-file: .nvmrc
  - Removed obsolete NODE_OPTIONS heap bumps from package.json scripts:
    * Root: ats:contracts:build, ats:web:build, ats:web:test
    * contracts: 5 scripts cleaned
    * sdk: test cleaned
- Aligned workflow name prefixes with filenames (001-003, 100-102)
- Consolidated CI runners: ubuntu-latest → token-studio-linux-medium (300, 301)
- Added @typescript-eslint/no-dupe-class-members to mass-payout SDK eslint

This enables per-package lint gates while maintaining full-tree integrity.

Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
Applied eslint and formatting fixes across:
- ATS web: 16 files (components, tests, views, utils)
- ATS SDK: 9 files (event service, validation, core types, tests)
- MP frontend: 8 files (services, views, hooks, tests)
- MP contracts: added .gitignore entry for results/*.js
- MP SDK: 4 command handler files with implicit-any fixes

All changes pass linting and enable the new PR gate workflows
(103-flow-ats-lint, 104-flow-mp-lint) without blockage.

Signed-off-by: Miguel_LZPF <miguel.carpena@io.builders>
@MiguelLZPF MiguelLZPF force-pushed the chore/ci-add-lint-format-workflows branch from b04f320 to 2ebccaf Compare April 28, 2026 09:36
@MiguelLZPF MiguelLZPF marked this pull request as ready for review April 28, 2026 09:52
@MiguelLZPF MiguelLZPF requested review from a team as code owners April 28, 2026 09:52
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