Skip to content

chore(dx): apps/api unused-import cleanup + turbo --continue in CI + relaxed pre-commit hook#24

Merged
JOBYINC merged 1 commit into
previewfrom
chore/dx-cleanup
May 21, 2026
Merged

chore(dx): apps/api unused-import cleanup + turbo --continue in CI + relaxed pre-commit hook#24
JOBYINC merged 1 commit into
previewfrom
chore/dx-cleanup

Conversation

@JOBYINC
Copy link
Copy Markdown
Owner

@JOBYINC JOBYINC commented May 21, 2026

Why

Three independent dev-experience problems uncovered during the 2026-05-21 preview hygiene cleanup. All three are root-cause fixes, not workarounds.

What

1. apps/api — clear 5 pre-existing F401 unused-import warnings

`ruff check --fix` runs in CI but doesn't commit its fixes back. Every PR touching `apps/api` saw `Found N errors (N-1 fixed, 1 remaining)` log noise that masked real failures. Applied `ruff check --fix` and committed.

  • `apps/api/plane/app/views/issue/sub_issue.py` — `Func`, `Q` unused
  • `apps/api/plane/db/management/commands/lark_long_poll.py` — `build_url_preview_card` unused
  • `apps/api/plane/tests/contract/api/test_assigned_work_items.py` — `uuid` unused
  • `apps/api/plane/tests/contract/api/test_personal_tasks.py` — `APIClient` unused

Pure unused-import removal. 4 files, 5 deletions, 1 reformat. No runtime behavior change.

2. CI — `turbo run --continue` so package failures don't hide each other

`pnpm turbo run check:types --affected` (and check:format / check:lint) short-circuited on the first failing package. The 2026-05-21 cleanup discovered that a single `@plane/i18n` type error was hiding 11 latent type errors in apps/web for an unknown duration. Without `--continue`, the second-tier errors never surfaced.

Added `--continue` to all three turbo invocations in `.github/workflows/pull-request-build-lint-web-apps.yml`:

```yaml

before

run: pnpm turbo run check:types --affected

after

run: pnpm turbo run check:types --affected --continue
```

Same for `check:format` and `check:lint`. Now every package surfaces its own failures in a single CI run, regardless of any prior package's outcome.

3. Pre-commit hook — drop `--deny-warnings` (CI's max-warnings budget is enough)

The husky pre-commit hook ran `pnpm exec oxlint --fix --deny-warnings` on staged files. `apps/web` carries 964 pre-existing oxlint warnings (well within the CI budget of 11957), but `--deny-warnings` is 0-tolerance — so any author running `oxfmt --write` or otherwise re-staging a warning-laden file got their commit refused unless they incidentally fixed the warning. That's a friction tax with no net benefit, because CI's `--max-warnings=11957` already fails on any NET INCREASE in warnings.

Changed `package.json` lint-staged config: `--fix --deny-warnings` → `--fix --quiet` (only fail pre-commit on actual lint ERRORS; warnings still get auto-fixed where possible, just don't fail the commit).

Test plan

  • CI green on this PR (proves all three fixes are compatible)
  • `Lint API` step no longer prints "Found N errors (N-1 fixed)" noise
  • After merge: a contrived test PR that touches a warning-laden web file but adds no new warnings should pre-commit cleanly
  • After merge: a contrived test PR with type errors in 2+ different packages should see all errors in one CI run (not just the first package's)

…commit warnings

Three independent dev-experience problems found during the 2026-05-21
preview hygiene cleanup. All three are root-cause fixes, not workarounds.

1. apps/api had 5 pre-existing F401 unused-import warnings that ruff
   --fix in CI silently auto-fixed (in-CI working copy) without committing
   back. Every PR touching apps/api saw "Found N errors (N-1 fixed,
   1 remaining)" noise that masked the real failure. Applied
   `ruff check --fix` and committed:
     - apps/api/plane/app/views/issue/sub_issue.py (Func, Q)
     - apps/api/plane/db/management/commands/lark_long_poll.py (build_url_preview_card)
     - apps/api/plane/tests/contract/api/test_assigned_work_items.py (uuid)
     - apps/api/plane/tests/contract/api/test_personal_tasks.py (APIClient)

2. CI's `pnpm turbo run check:types --affected` (and check:format,
   check:lint) was short-circuiting on the first failing package. The
   2026-05-21 cleanup discovered that a single @plane/i18n type error
   was hiding 11 latent type errors in apps/web for an unknown duration.
   Added `--continue` to all three turbo runs in
   `.github/workflows/pull-request-build-lint-web-apps.yml` so every
   package surfaces its own failures in one CI run, regardless of any
   prior package's outcome.

3. The husky pre-commit hook ran `pnpm exec oxlint --fix --deny-warnings`
   on staged files. apps/web carries 964 pre-existing oxlint warnings
   (within the CI budget of 11957), but `--deny-warnings` is 0-tolerance —
   so any author running `oxfmt --write` or otherwise re-staging a
   warning-laden file got their commit refused. CI's `--max-warnings=11957`
   already catches NEW warnings (any increase fails CI); pre-commit doesn't
   need to be stricter than that. Changed to `--fix --quiet` (only fail
   pre-commit on actual lint ERRORS, not warnings).
@JOBYINC JOBYINC merged commit 097485a into preview May 21, 2026
9 checks passed
@JOBYINC JOBYINC deleted the chore/dx-cleanup branch May 21, 2026 21:04
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