Skip to content

[TESTING] DO NOT MERGE : Feat/reimagine cr setup#152

Open
amaury901130 wants to merge 6 commits into
masterfrom
feat/reimagine-cr-setup
Open

[TESTING] DO NOT MERGE : Feat/reimagine cr setup#152
amaury901130 wants to merge 6 commits into
masterfrom
feat/reimagine-cr-setup

Conversation

@amaury901130

Copy link
Copy Markdown
Collaborator

Jira board reference:


What does this do?

Adds local Pushgate pre-push checks to the template with a committed .pushgate.yml configuration and documents the workflow in both template readmes. The config uses target_branch: master, starts AI review in advisory mode, and adds blocking deterministic checks for type-check, eslint, lint, lint:translations, and test, plus diff_size and forbidden_paths policies. This PR also updates the project creation CLI so new apps created with create-rootstrap-rn-app attempt to install Pushgate automatically after dependency installation.


Why did you do this?

The template now recommends Pushgate, but hooks are local and not tracked by git. Automating installation in the scaffold flow reduces onboarding misses, and documenting manual install/verification keeps existing clones and edge cases covered while ensuring the local checks stay consistent across new apps.

Who/what does this impact?

  • Developers creating apps from this template via create-rootstrap-rn-app.
  • Existing clones of this repository that need manual Pushgate installation.
  • CI/runtime app behavior is unaffected; changes are limited to local dev workflow and docs.

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

Notes:

  • Pushgate auto-install in the CLI is best-effort: if install fails (for example network/curl availability), project creation continues and docs include the manual installer command.

Screenshots / Previews

N/A — tooling and documentation changes only.

@amaury901130 amaury901130 requested a review from Copilot July 2, 2026 18:11
@amaury901130 amaury901130 requested a review from a team as a code owner July 2, 2026 18:11
@amaury901130 amaury901130 added the risk:low Config, copy, minor UI tweaks. Low blast radius. label Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

💯 Test Coverage

Lines Statements Branches Functions
Coverage: 56%
56.23% (347/617) 59.18% (174/294) 48.76% (118/242)

😎 Tests Results

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

@amaury901130 amaury901130 changed the title Feat/reimagine cr setup [TESTING] DO NOT MERGE : Feat/reimagine cr setup Jul 2, 2026

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.

Pull request overview

This PR updates the template’s developer workflow by introducing local Pushgate pre-push checks (with a committed .pushgate.yml), documenting the setup/usage in both readmes, and extending the scaffolding CLI to best-effort auto-install the Pushgate hook after dependency installation. It also introduces documentation/template guidance for PR risk labeling and adds a (currently standalone) gatekeeper script intended for label-based approval routing.

Changes:

  • Add versioned Pushgate configuration + a Husky pre-push bridge to run .git/hooks/pre-push.
  • Document Pushgate setup/skip behavior and a risk:* PR label system in README files and the PR template.
  • Update create-rootstrap-rn-app CLI flow to attempt Pushgate installation automatically after pnpm install.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
README.md Documents PR risk labels and Pushgate install/skip workflow.
README-project.md Adds Pushgate and PR risk label docs for generated projects.
cli/setup-project.js Adds installPushgate() helper and exports it for the CLI.
cli/index.js Calls installPushgate() after installing dependencies.
.pushgate.yml Introduces Pushgate v2 config with AI advisory mode + blocking deterministic checks.
.husky/pre-push Adds Husky hook to forward pushes to .git/hooks/pre-push (Pushgate).
.github/scripts/gatekeeper.js Adds script to compute required approvals based on risk:* + ai:* labels and set a commit status.
.github/PULL_REQUEST_TEMPLATE.md Adds “Layer 2: Risk Classification” section and setup checklist.
.github/copilot-instructions.md Adds repo-specific Copilot guidance and review classification labels.
.agents/skills/pr-description/SKILL.md Updates PR-description skill doc to include risk classification guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/setup-project.js
Comment on lines +27 to +32
consola.start('Installing Pushgate pre-push hook');
try {
await execShellCommand(
`cd ${projectName} && curl -fsSL https://raw.githubusercontent.com/rootstrap/ai-pushgate/main/install.sh | bash`
);
consola.success('Pushgate pre-push hook installed');
Comment thread cli/setup-project.js
Comment on lines +29 to +36
await execShellCommand(
`cd ${projectName} && curl -fsSL https://raw.githubusercontent.com/rootstrap/ai-pushgate/main/install.sh | bash`
);
consola.success('Pushgate pre-push hook installed');
} catch (error) {
consola.warn(
'Could not auto-install Pushgate. Run installer manually from the project root.'
);
Comment thread .husky/pre-push
Comment on lines +1 to +5
. "$(dirname "$0")/common.sh"

echo '>> Running Pushgate pre-push checks...'

"$(git rev-parse --git-common-dir)/hooks/pre-push" "$@" No newline at end of file
Comment thread .pushgate.yml
Comment on lines +40 to +43
review:
# Branch to diff against when collecting changes.
target_branch: master

Comment on lines +1 to +5
// Layer 4 - Classification and Routing Gatekeeper
//
// Routing table (required approvals):
//
// Risk \ AI findings | clean | minor | serious

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Comment thread cli/setup-project.js
Comment on lines +26 to +38
const installPushgate = async (projectName) => {
consola.start('Installing Pushgate pre-push hook');
try {
await execShellCommand(
`cd ${projectName} && curl -fsSL https://raw.githubusercontent.com/rootstrap/ai-pushgate/main/install.sh | bash`
);
consola.success('Pushgate pre-push hook installed');
} catch (error) {
consola.warn(
'Could not auto-install Pushgate. Run installer manually from the project root.'
);
}
};
Comment thread .husky/pre-push
Comment on lines +1 to +5
. "$(dirname "$0")/common.sh"

echo '>> Running Pushgate pre-push checks...'

"$(git rev-parse --git-common-dir)/hooks/pre-push" "$@" No newline at end of file
Comment thread .pushgate.yml
Comment on lines +40 to +43
review:
# Branch to diff against when collecting changes.
target_branch: master

@label-pr-severity-rs label-pr-severity-rs Bot added the ai:serious Security concerns, logic errors label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:serious Security concerns, logic errors 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