Repository navigation
feat: add copilot-setup-steps.yml for Copilot cloud agent - #222
Conversation
Pre-installs all workspace dependencies before each Copilot cloud agent session using two stacks in sequence: 1. pnpm install --frozen-lockfile (Node.js/TypeScript monorepo) 2. go mod download in apps/api (Go 1.24 backend) Without this file the agent would need to discover and install deps itself — in a pnpm monorepo + Go workspace this is especially slow. Stack: Node.js 20 / pnpm 9 (monorepo) + Go 1.24 (apps/api) Template source: petry-projects/.github/standards/workflows/copilot-setup-steps.yml Standard: ci-standards.md §11 Copilot Cloud Agent Setup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…teps.yml - Fork guard: replace github.event.repository.fork (reflects base repo, always false for org repos) with github.event_name != 'pull_request' || head.repo.fork == false so external fork PRs are skipped while direct pushes and manual runs still run - Verify step: guard find .github/instructions with [ -d ] check to prevent pipefail abort when the directory is absent Addresses review comments on combsmith/.github#328 (Codex P1 and P2). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Avoid executing package lifecycle scripts during Copilot environment setup, matching SonarCloud recommendation for workflow hardening. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address dependency-audit vulnerabilities by enforcing patched minima in pnpm overrides: - @xmldom/xmldom >= 0.9.10 - postcss >= 8.5.10 - brace-expansion >= 5.0.6 - ws >= 8.20.1 Then regenerate pnpm-lock.yaml so the dependency graph resolves to safe versions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 775ffd735e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "postcss": ">=8.5.10", | ||
| "brace-expansion": ">=5.0.6", | ||
| "ws": ">=8.20.1", |
There was a problem hiding this comment.
Constrain overrides to avoid unintended major upgrades
These new overrides use open-ended ranges (>=...), so the next lockfile refresh can silently pull future major versions (for example ws@9 or postcss@9) across the entire tree, which is a regression risk for tooling that currently expects older majors. This commit already demonstrates that behavior by forcing broad transitive jumps in pnpm-lock.yaml (e.g. minimatch@3.1.5 now resolves via brace-expansion@5.0.6), so dependency updates may become unstable even when only trying to apply security patches; use bounded ranges (e.g. ^8.20.1) or exact patched versions instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated Copilot Cloud Agent “setup steps” workflow to pre-bootstrap the repo environment (pnpm + Go deps) before agent sessions, and updates pnpm overrides/lockfile to enforce newer transitive dependency versions.
Changes:
- Added
.github/workflows/copilot-setup-steps.ymlto install Node/pnpm deps and download Go modules, plus a verification step that fails ifAGENTS.mdis missing. - Updated
package.jsonpnpm overrides to require newer versions of@xmldom/xmldom,postcss,brace-expansion, andws. - Updated
pnpm-lock.yamlto reflect the new override resolutions.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/copilot-setup-steps.yml |
Adds Copilot Cloud Agent bootstrap workflow (checkout, pnpm install, Go deps download, environment verification). |
package.json |
Expands pnpm overrides to bump/select safer transitive dependency versions. |
pnpm-lock.yaml |
Applies the override-driven dependency resolution updates in the lockfile. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Set up pnpm | ||
| uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version: "20" | ||
| cache: "pnpm" | ||
|
|
| cache: "pnpm" | ||
|
|
||
| - name: Install Node.js dependencies | ||
| run: pnpm install --frozen-lockfile --ignore-scripts |
| if [ -f "AGENTS.md" ]; then | ||
| echo "✅ AGENTS.md ($(wc -l < AGENTS.md) lines)" | ||
| else | ||
| echo "❌ AGENTS.md — MISSING. Add this file per agent-standards.md." |
| - name: Set up Go | ||
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | ||
| with: | ||
| go-version-file: apps/api/go.mod |



Summary
Adds
.github/workflows/copilot-setup-steps.ymlto pre-install all workspace dependencies before each Copilot cloud agent session.Why this matters
Without this file, Copilot discovers and installs dependencies itself — in a pnpm monorepo + Go workspace this is especially slow and error-prone. Pre-installing deterministically ensures the agent always starts with exact, cached dependencies matching CI.
The verify step fails the job if
AGENTS.mdis missing — catching a misconfigured repo before the agent begins work.Stack
Node.js 20 / pnpm 9 (TypeScript monorepo) + Go 1.24 (apps/api)
Steps:
actions/checkout(SHA-pinned)pnpm/action-setup@v4(SHA-pinned)actions/setup-node@v4with Node 20 + pnpm cachepnpm install --frozen-lockfileactions/setup-go@v5withgo-version-file: apps/api/go.modgo mod downloadin apps/apiStandard
petry-projects/.github/standards/workflows/copilot-setup-steps.yml