Skip to Content
flowpact

FP604 · needs-without-data

A job lists another job under `needs:` but never reads its outputs or result (opt-in).

CodeNameCategoryDefault severityReported by
FP604needs-without-dataGraph structure⚪ off (opt-in)lint, check, the action, the editor

Why it matters

Ordering-only dependencies are legitimate (deploy after test), but unexplained ones serialize the pipeline. This rule is off by default; enable it to audit the critical path.

How to fix

Remove the dependency if it is not needed for ordering, or keep it and disable the rule for that job.

Example

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - run: npm run lint
  test:
    needs: lint   # reads nothing from lint, and waits for it
    runs-on: ubuntu-latest
    steps:
      - run: npm test

Scope

Not reported in generated files, which are not edited by hand.

Accept one finding

When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build.

On its line, with an ignore comment alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (# v4.3.0 # flowpact: ignore[FP604] why):

.github/workflows/ci.yml
# flowpact: ignore[FP604] why it is acceptable here
<the line of the finding>

In the config, with an override, which can expire:

.github/flowpact/flowpact.config.yml
overrides:
  - rule: FP604
    target: <the finding's symbol>
    reason: Why it is acceptable here, at least 10 characters.
    expires: YYYY-MM-DD   # optional

target is the symbol the finding is about; to list them:

flowpact lint --format json | jq -r '.findings[] | select(.code == "FP604") | .symbol'

* matches within a path segment and ** across segments, so one entry accepts every finding whose symbol matches: target: '**#inputs.app-id' is that input in every workflow and action.

Change the severity

Change the severity (or turn the rule off) in .github/flowpact/flowpact.config.yml, by code or by name:

.github/flowpact/flowpact.config.yml
rules:
  FP604: warning
  # or: needs-without-data: error

Explain it in the terminal:

flowpact explain FP604
  • FP302 output-ref-without-needs: needs.<job> is read where the needs context does not contain <job>.

On this page