Skip to content

feat: support carryforward flags on parallel finish - #762

Merged
TheKevJames merged 2 commits into
masterfrom
kjames/carryforward-flags
Jul 22, 2026
Merged

feat: support carryforward flags on parallel finish#762
TheKevJames merged 2 commits into
masterfrom
kjames/carryforward-flags

Conversation

@TheKevJames

Copy link
Copy Markdown
Owner

Closes #382

What

Adds support for Coveralls' carryforward flags on the parallel-build finish webhook. When a parallel build is missing jobs (common in monorepos), Coveralls can carry forward the coverage for the named flags from a previous build.

How to use

coveralls finish --carryforward=flag1,flag2
# or via env var:
COVERALLS_CARRYFORWARD=flag1,flag2 coveralls finish
# or via the `carryforward` key in .coveralls.yml / pyproject.toml

Details

  • New Config.carryforward field. It is a client-behaviour field (webhook/finish-only), deliberately kept out of PAYLOAD_FIELDS so it never leaks into the /jobs payload.
  • parallel_finish() adds carryforward as a top-level key in the /webhook payload (matching coverallsapp/coverage-reporter), omitted when empty/unset.
  • --carryforward is exposed only on the finish subcommand.
  • Env var COVERALLS_CARRYFORWARD and config-file key carryforward supported via the standard resolution chain.
  • Docs updated in the parallel/finish section.

Test-file split

tests/cli_test.py and tests/api/resolve_test.py were already at the --max-module-lines=500 pylint limit, so any addition tripped too-many-lines. To make room (and give headroom for future growth):

  • tests/cli_test.py → a per-subcommand tests/cli/ package (debug_test.py, finish_test.py, save_test.py, upload_test.py, submit_test.py) with shared constants/helpers in tests/cli/helpers.py.
  • CI-service-detection cases split out of tests/api/resolve_test.py into tests/api/resolve_ci_test.py.

No tests were removed; the full suite still reports the same count (185 passed, 1 skipped). A narrow name-tests-test exclude was added for the non-test helpers.py support module.

Split the oversized cli_test.py into a per-subcommand tests/cli/ package
and the CI-detection cases out of resolve_test.py so both stay under the
max-module-lines limit as they grow.

changelog:
``coveralls finish`` now accepts ``--carryforward`` (also
``COVERALLS_CARRYFORWARD`` or the ``carryforward`` config-file key) to
carry forward coverage flags for jobs missing from a parallel build.
…clude

Address review of the carryforward change:

- coveralls_kwargs no longer hand-mirrors the CLI option set; it derives the
  forwarded override keys from _make_coveralls itself, so the baseline cannot
  silently drift as options are added or removed.
- Move the shared cli test support out of helpers.py into conftest.py, which
  name-tests-test exempts, so the lint exclude added earlier is reverted.
@TheKevJames
TheKevJames merged commit edf6c57 into master Jul 22, 2026
16 checks passed
@TheKevJames
TheKevJames deleted the kjames/carryforward-flags branch July 22, 2026 18:19
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.

feature request: carryforward flags

1 participant