Skip to content

chore: let agents handle Pushgate feedback and ignore tests in size limits - #189

Open
devs-rootstrap wants to merge 2 commits into
masterfrom
chore/pushgate-agent-workflow
Open

devs-rootstrap wants to merge 2 commits into
masterfrom
chore/pushgate-agent-workflow

Conversation

@devs-rootstrap

Copy link
Copy Markdown
Collaborator

Jira board reference:


What does this do?

  • .pushgate.yml: adds test files to ignore_paths (.ts/.tsx under __tests__/, *.test.ts(x), *.spec.ts(x) and .yaml/.yml Maestro flows under .maestro/). Pushgate counts changed lines after ignore_paths filtering, so tests no longer count toward policies.diff_size.max_changed_lines or ai.max_changed_lines (both 700). A comment explains how the setting works and what the trade-off is.
  • AGENTS.md: new "Pushing (Pushgate)" section for coding agents:
    • push with git -c pushgate.review-target=origin/<target_branch> push ... so the review-target prompt never shows up;
    • a clean run (no warnings and no findings) goes through with no confirmation;
    • blocking failures (type-check, lint, tests, forbidden paths) get fixed and don't count as review rounds;
    • review findings and warnings get applied, re-checked, committed and pushed again, for at most 3 rounds, then the human takes over with a summary of what is left;
    • never bypass the hook (--no-verify, skip flags, env vars) unless the human asks.
  • agent_docs/commands.md: one line pointing to that section.

Why did you do this?

Pushgate asks Continue with push? [y/N] whenever a check, policy or AI review reports a warning or finding. The card asks for agents to apply that feedback on their own for up to 3 rounds and to bring in a person only after that. It also asks for a push with no findings to need no keypress, and for tests to stop counting toward the PR size limit.

How Pushgate v3.5.0 behaves:

  • With zero warnings and findings it never prompts, so the "no Y when everything is OK" part already holds in advisory mode and only needed documenting.
  • With no interactive terminal it rejects the push instead of waiting.
  • It has no auto-fix and no setting that turns the prompt off.

So the 3-round loop is a rule in AGENTS.md, which CLAUDE.md tells agents to follow.

The test patterns match by file extension instead of whole folders. Because ignore_paths is applied before every policy, ignoring whole folders would also let a .env, *.pem or secrets/ file placed under __tests__/ or .maestro/ get past forbidden_paths.

Who/what does this impact?

  • Anyone pushing to this repo, and projects generated from the template (they inherit .pushgate.yml and AGENTS.md).
  • Trade-off: ignore_paths is global in Pushgate, so test files also skip the per-file eslint tool and the AI review. The always-run tools still type-check the Jest tests and run them. pnpm lint already skips __tests__/ (see eslint.config.mjs), and no pre-push tool runs the Maestro flows (pnpm e2e-test). Both points are written down in the yml comment and in AGENTS.md.
  • ai.mode, the size limits, the tools and the .husky hooks are unchanged.

How did you test this?

  • Tested on iOS
  • Tested on Android
  • Tested on a small device
  • Tested on a real device
  • Tested all flows related with this PR changes
  • Tested accessibility
  • Added tests

Verification

  • pnpm lint, pnpm type-check, pnpm lint:translations: pass.
  • pnpm test: 40/40 suites, 237/237 tests pass.
  • The new ignore_paths patterns were checked against the repo with the ignore library that Pushgate uses. They match the 40 Jest test files and the 11 Maestro flows. They don't match src/lib/test-utils.tsx, __mocks__/, or a .env/.pem file inside those folders.
  • The pre-push hook passed on this branch with pushgate.review-target=origin/master: all checks ok, 37/700 changed lines, and the AI review reported no findings.
  • Not verified on a device (config and docs only).

How to test locally

  1. git fetch origin && git checkout chore/pushgate-agent-workflow
  2. Change a file under __tests__/ plus a small source file, commit, and run git -c pushgate.review-target=origin/master push --dry-run origin HEAD:refs/heads/tmp-pushgate-check. The "Diff size" line should count only the source change.
  3. Read the "Pushing (Pushgate)" section in AGENTS.md.

Notes:

Assumptions:

  • "Apply the feedback automatically" is done through agent instructions in AGENTS.md, since Pushgate has no auto-fix of its own.
  • Maestro flows count as tests. __mocks__/ and src/lib/test-utils.tsx are test support code and are still counted.
  • The push command uses origin/<target_branch> because projects generated from the template may change review.target_branch (for example to develop).

Screenshots / Previews

Not applicable (config and docs only).

@devs-rootstrap
devs-rootstrap requested a review from a team as a code owner December 3, 2026 12:12
@devs-rootstrap
devs-rootstrap requested review from amaury901130, asdolo and fernandatoledo and a balanced review from Copilot December 3, 2026 12:12
@devs-rootstrap devs-rootstrap added the risk:low Config, copy, minor UI tweaks. Low blast radius. label Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

💯 Test Coverage

Lines Statements Branches Functions
Coverage: 65%
65.46% (491/750) 66.18% (227/343) 60.85% (185/304)

😎 Tests Results

Tests Skipped Failures Errors Time
237 0 💤 0 ❌ 0 🔥 26.016s ⏱️
👀 Tests Details • (65%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files65.4666.1860.8565.78 
report-only-changed-files is enabled. No files were changed in this commit :)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Extension-based exclusions in .pushgate.yml bypass forbidden_paths, allowing sensitive files that the security policy should block.

1 open issue
What changed in this PR

Overall Review: ai:serious

Updates the template’s Pushgate configuration and agent workflow to support automated feedback handling and exclude tests from size limits.

Changes:

  • Excludes Jest tests and Maestro flows, documenting the trade-offs.
  • Defines a three-round feedback loop with human escalation.
  • Links command documentation to the push workflow.
File Description
AGENTS.md Documents push commands, feedback handling, and safeguards.
agent_docs/​commands.md Links to the Pushgate workflow.
.pushgate.yml Adds test exclusions and explains their scope.

Review effort: Balanced

Comment thread .pushgate.yml
Comment on lines +257 to +258
- .maestro/**/*.yaml
- .maestro/**/*.yml

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Config, copy, minor UI tweaks. Low blast radius.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants