Skip to content

MPT-19004 Setup copilot instructions#229

Closed
albertsola wants to merge 1 commit intomainfrom
copilot-dev
Closed

MPT-19004 Setup copilot instructions#229
albertsola wants to merge 1 commit intomainfrom
copilot-dev

Conversation

@albertsola
Copy link
Contributor

@albertsola albertsola commented Mar 13, 2026

Closes MPT-19004

  • Added .github/copilot-instructions.md — comprehensive developer onboarding and reference covering project overview, Docker-based commands, architecture (clients, resources, services, mixins, models, RQL), coding conventions, error handling, HTTP client initialization, testing patterns (respx, async tests, fixtures), native commands, and a verification checklist
  • Updated Dockerfile dev stage to install curl and run the Copilot installer via curl -fsSL https://gh.io/copilot-install | bash

@albertsola albertsola requested a review from a team as a code owner March 13, 2026 14:57
@albertsola albertsola requested review from jentyk and robcsegal March 13, 2026 14:57
@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

📝 Walkthrough

Walkthrough

Adds a new developer guide at .github/copilot-instructions.md and updates the Dockerfile dev stage to install curl and run a Copilot installer script. (45 words)

Changes

Cohort / File(s) Summary
Developer Documentation
​.github/copilot-instructions.md
New comprehensive developer guide with project overview, Docker commands, architecture notes, coding conventions, testing patterns, native commands, and a verification checklist.
Development Environment
Dockerfile
In dev stage, added apt update && apt install -y curl and `curl -fsSL https://gh.io/copilot-install

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Jira Issue Key In Title ✅ Passed The PR title 'MPT-19004 Setup copilot instructions' contains exactly one Jira issue key in the required MPT-XXXX format at the beginning.
Test Coverage Required ✅ Passed PR modifies only documentation and build configuration files, not application code requiring test coverage.
Single Commit Required ✅ Passed The PR contains exactly one commit (4fd51ed Setup copilot instructions), satisfying the single commit requirement for clean git history.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/copilot-instructions.md (1)

128-137: Document the E2E fixture safety pattern here as well.

Please add a short note that read-only/safe mutations should reuse existing e2e_config resources, while destructive tests should use isolated create/cleanup fixtures.

Suggested addition
 ### Fixtures

 Common fixtures are in `tests/unit/conftest.py`:
 - `http_client` — `HTTPClient` instance
 - `async_http_client` — `AsyncHTTPClient` instance
+
+For E2E tests, prefer reusing `e2e_config` resources for read-only and safe mutations.
+Use per-test created fixtures only for destructive/dangerous scenarios.

Based on learnings: In the mpt-api-python-client E2E tests, the team intentionally reuses existing API resources (via e2e_config) for read-only operations and safe mutations, while destructive tests use isolated created fixtures.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/copilot-instructions.md around lines 128 - 137, Add a short E2E
fixture safety note to the fixtures section explaining that tests should reuse
existing e2e resources for read-only or non-destructive/safe mutations by using
the e2e_config fixture, while destructive tests must create isolated resources
and clean them up via dedicated create/cleanup fixtures; mention the pattern
used in mpt-api-python-client E2E tests (reuse via e2e_config vs isolated
create/cleanup) and give a one-line example guideline for each case.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/copilot-instructions.md:
- Around line 36-41: The fenced code block that starts with "MPTClient /
AsyncMPTClient" is unlabeled and triggers markdownlint MD040; add a language
hint by replacing the opening triple backticks with a labeled fence (for example
use "text") so the block becomes ```text followed by the existing lines and
closed with ```, ensuring the block content ("MPTClient / AsyncMPTClient ...
HTTPClient / AsyncHTTPClient (wraps httpx)") remains unchanged.

In `@Dockerfile`:
- Around line 19-20: Replace the unsafe "curl -fsSL
https://gh.io/copilot-install | bash" RUN step with a pinned, verified install:
install curl and ca-certificates via apt-get with --no-install-recommends and
clean apt lists, then either invoke the official installer while setting a
pinned VERSION environment variable (e.g. VERSION="vX.Y.Z") so the installer
performs SHA256 verification, or download the specific release artifacts
(copilot tarball and SHA256SUMS.txt), verify the checksum with sha256sum -c, and
install the binary to /usr/local/bin; update the Dockerfile RUN that currently
contains "curl -fsSL https://gh.io/copilot-install | bash" accordingly and
ensure the chosen VERSION value is explicit and checked.

---

Nitpick comments:
In @.github/copilot-instructions.md:
- Around line 128-137: Add a short E2E fixture safety note to the fixtures
section explaining that tests should reuse existing e2e resources for read-only
or non-destructive/safe mutations by using the e2e_config fixture, while
destructive tests must create isolated resources and clean them up via dedicated
create/cleanup fixtures; mention the pattern used in mpt-api-python-client E2E
tests (reuse via e2e_config vs isolated create/cleanup) and give a one-line
example guideline for each case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 197d7428-5a06-4357-88a9-dc813cc954e5

📥 Commits

Reviewing files that changed from the base of the PR and between 046a5fb and d7413ef.

📒 Files selected for processing (2)
  • .github/copilot-instructions.md
  • Dockerfile

@sonarqubecloud
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
Dockerfile (1)

20-20: ⚠️ Potential issue | 🟠 Major

Unpinned remote installer is still unresolved from the previous review.

Line 20 still executes curl ... | bash as root without an explicit pinned version/checksum flow, so reproducibility and supply-chain guarantees remain weak.

Suggested hardening (keeps dev-stage scope)
+ARG COPILOT_VERSION=v0.0.369
-RUN curl -fsSL https://gh.io/copilot-install | bash
+RUN curl -fsSL https://gh.io/copilot-install | VERSION="${COPILOT_VERSION}" PREFIX="/usr/local" bash
What is the current official GitHub Copilot installer guidance for Linux containers regarding VERSION pinning and checksum verification?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile` at line 20, The Dockerfile still runs the unpinned installer via
the command `RUN curl -fsSL https://gh.io/copilot-install | bash`; replace that
pattern with a pinned-and-verified flow: add build arguments (e.g.,
COPILOT_VERSION and COPILOT_SHA256), download the specific release installer to
a file using curl (not piping to bash), verify its checksum (sha256sum) against
COPILOT_SHA256, then execute the installer from the verified file (or fail the
build); ensure the installer is run with least privilege (drop to a non-root
user or use explicit flags) and fail fast on checksum mismatch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@Dockerfile`:
- Line 20: The Dockerfile still runs the unpinned installer via the command `RUN
curl -fsSL https://gh.io/copilot-install | bash`; replace that pattern with a
pinned-and-verified flow: add build arguments (e.g., COPILOT_VERSION and
COPILOT_SHA256), download the specific release installer to a file using curl
(not piping to bash), verify its checksum (sha256sum) against COPILOT_SHA256,
then execute the installer from the verified file (or fail the build); ensure
the installer is run with least privilege (drop to a non-root user or use
explicit flags) and fail fast on checksum mismatch.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 92d30305-1271-4a04-b45c-ca81ed7fefac

📥 Commits

Reviewing files that changed from the base of the PR and between d7413ef and 4fd51ed.

📒 Files selected for processing (2)
  • .github/copilot-instructions.md
  • Dockerfile

@d3rky
Copy link
Contributor

d3rky commented Mar 13, 2026

Could you pls, wait for the merge, I'm preparing the requirements/guideline about what to put into documentation, where this documentation should be, how to separate it from human/ai, how to share common knowledges, etc. I'll close this PR till that day. Thank you!

@d3rky d3rky closed this Mar 13, 2026
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