Skip to content

feat: execute all steps and collect errors at end of chain#1640

Open
jescalada wants to merge 4 commits into
mainfrom
make-chain-execute-all-steps
Open

feat: execute all steps and collect errors at end of chain#1640
jescalada wants to merge 4 commits into
mainfrom
make-chain-execute-all-steps

Conversation

@jescalada

Copy link
Copy Markdown
Contributor

Description

This PR implements one of fogwall's quality-of-life features: collecting all errors in the chain and reporting to the user, so they don't have to make multiple pushes and fix one-by-one. This still fails mid-chain if non-validator steps (parsePush, pullRemote, writePack, etc.) error out.

collectibleSteps are defined in chain.ts (steps that can be collected and reported later, as opposed to immediately failing).

image

Related Issue

Resolves #

Checklist

General

Documentation

  • Documentation has been added/updated for any new features

Configuration

  • If configuration schema (config.schema.json) was modified:
    • TypeScript types regenerated (npm run generate-config-types)
    • Schema reference docs regenerated (npm run gen-schema-doc)

Tests

  • Tests have been added/updated for new functionality
  • Unit tests pass (npm test)
  • Linting and formatting pass (npm run lint and npm run format:check)
  • Type checks pass (npm run check-types)

@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit 76cde94
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/6a4e3dd4948a480008154f47

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.72727% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.92%. Comparing base (3186da2) to head (76cde94).

Files with missing lines Patch % Lines
src/proxy/chain.ts 92.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1640      +/-   ##
==========================================
+ Coverage   85.87%   85.92%   +0.04%     
==========================================
  Files          84       84              
  Lines        8109     8161      +52     
  Branches     1376     1395      +19     
==========================================
+ Hits         6964     7012      +48     
- Misses       1117     1121       +4     
  Partials       28       28              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jescalada jescalada marked this pull request as ready for review July 8, 2026 12:50
@jescalada jescalada requested a review from a team as a code owner July 8, 2026 12:50

@coopernetes coopernetes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just a few notes/suggestions.

* single push, instead of stopping at the first failed check. Security and infrastructure
* failures still stop the chain immediately.
*/
collectAllChainErrors?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be configurable? Seems like a sensible new default. Since it only affects the response behaviour back to git clients, it shouldn't be considered a breaking change and needing a toggle.

Comment thread src/proxy/chain.ts
const collectibleSteps = new Set<Processor['exec']>([
proc.push.checkMessages,
proc.push.checkAuthorEmails,
proc.push.checkHiddenCommits,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this step resolved an exploit, I would recommend making this one a "fail out early" step. The rest of the checks are sound and should run when a valid push with a set of walkable (traceable from base HEAD/main) refs is sent.

Comment thread src/proxy/chain.ts
* such as repository authorisation, user push permission, or later steps
* depending on their output (pullRemote, writePack, getDiff)
*/
const collectibleSteps = new Set<Processor['exec']>([

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth adding a class/object property like private readonly boolean isCollectible directly on the Processor type? Then each step can self-declare it's behaviour and this list doesn't need to remain statically defined (and needing updates when new checks are introduced).

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