Skip to content

feat: add copilot-setup-steps.yml for Copilot cloud agent - #222

Merged
don-petry merged 4 commits into
mainfrom
feat/add-copilot-setup-steps
May 21, 2026
Merged

don-petry merged 4 commits into
mainfrom
feat/add-copilot-setup-steps

Conversation

@don-petry

Copy link
Copy Markdown
Contributor

Summary

Adds .github/workflows/copilot-setup-steps.yml to 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.md is missing — catching a misconfigured repo before the agent begins work.

Stack

Node.js 20 / pnpm 9 (TypeScript monorepo) + Go 1.24 (apps/api)

Steps:

  1. actions/checkout (SHA-pinned)
  2. pnpm/action-setup@v4 (SHA-pinned)
  3. actions/setup-node@v4 with Node 20 + pnpm cache
  4. pnpm install --frozen-lockfile
  5. actions/setup-go@v5 with go-version-file: apps/api/go.mod
  6. go mod download in apps/api
  7. Verify environment (tool versions + AGENTS.md check)

Standard

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>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 21, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 38 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 26178ad2-4f4d-4d31-ad99-cb6d8208a0f5

📥 Commits

Reviewing files that changed from the base of the PR and between d3b4e80 and 775ffd7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • .github/workflows/copilot-setup-steps.yml
  • package.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-copilot-setup-steps

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

don-petry and others added 3 commits May 20, 2026 22:02
…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>
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry marked this pull request as ready for review May 21, 2026 12:18
@don-petry
don-petry requested a review from a team as a code owner May 21, 2026 12:18
Copilot AI review requested due to automatic review settings May 21, 2026 12:18
@don-petry
don-petry merged commit ef1b467 into main May 21, 2026
25 of 27 checks passed
@don-petry
don-petry deleted the feat/add-copilot-setup-steps branch May 21, 2026 12:19

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread package.json
Comment on lines +21 to +23
"postcss": ">=8.5.10",
"brace-expansion": ">=5.0.6",
"ws": ">=8.20.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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 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.yml to install Node/pnpm deps and download Go modules, plus a verification step that fails if AGENTS.md is missing.
  • Updated package.json pnpm overrides to require newer versions of @xmldom/xmldom, postcss, brace-expansion, and ws.
  • Updated pnpm-lock.yaml to 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.

Comment on lines +66 to +74
- 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
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.

3 participants