Skip to content

Add GitHub Copilot review instructions#2011

Open
theyostalservice wants to merge 4 commits intomainfrom
py/add-copilot-instructions
Open

Add GitHub Copilot review instructions#2011
theyostalservice wants to merge 4 commits intomainfrom
py/add-copilot-instructions

Conversation

@theyostalservice
Copy link
Copy Markdown
Contributor

Why

The MetricFlow maintainer team reviews a high volume of external contributions from contributors with varying experience levels. Configuring Copilot's automated review behavior with explicit, repo-specific instructions reduces the manual triage burden by catching common issues (missing issue links, CLA failures, missing changelogs, untested changes, interface changes without prior discussion) before a human reviewer is pulled in.

What

Adds .github/copilot-instructions.md with guidance across the following areas:

  • Pre-merge gates: issue linkage, CLA verification, changelog entry (changie)
  • PR scope and size: single-responsibility rule, commit structure expectations
  • Interface changes: explicit enumeration of protected surfaces (metricflow_semantic_interfaces/, query API, CLI, dataflow plan nodes, SQL rendering contracts) with OSI multi-org context
  • Semantic correctness: heightened scrutiny for aggregation, join fanout, time spine, cumulative/ratio/conversion metric logic
  • Cross-engine compatibility: flags dialect-specific SQL in shared rendering paths
  • Test snapshot management: regeneration and justification requirements when SQL generation changes
  • Package boundary enforcement: three-package architecture coupling rules
  • TENETS alignment: requires explicit tradeoff justification for correctness/performance/legibility/manipulability decisions
  • Performance: flags O(n²) patterns in compilation hot paths
  • Adapter scope boundary: redirects warehouse execution concerns out of the compiler
  • Review comment standards and out-of-scope guidance to avoid noise

Refs


Drafted by claude-sonnet-4-6 under the direction of @theyostalservice

Copilot AI review requested due to automatic review settings April 2, 2026 19:38
@cla-bot cla-bot bot added the cla:yes label Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a repository-specific .github/copilot-instructions.md file to steer GitHub Copilot’s automated PR reviews toward MetricFlow’s contribution gates and high-risk correctness areas, reducing maintainer triage load.

Changes:

  • Introduces Copilot review guidance covering pre-merge gates (issue/CLA/changelog), PR scope expectations, and interface-change escalation.
  • Adds checklists for semantic correctness, cross-engine SQL compatibility, snapshot-based testing expectations, and package boundary rules.
  • Documents reviewer comment standards and out-of-scope guidance to reduce review noise.

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 2, 2026 19:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

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 1 out of 1 changed files in this pull request and generated no new comments.


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

Copy link
Copy Markdown

Copilot AI left a comment

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 2 out of 2 changed files in this pull request and generated no new comments.


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

@theyostalservice theyostalservice requested a review from plypaul April 2, 2026 19:52
@theyostalservice theyostalservice marked this pull request as ready for review April 2, 2026 19:52
@theyostalservice theyostalservice requested a review from a team as a code owner April 2, 2026 19:52

- Bug fixes must include a regression test that would have failed before the fix.
- New features must include unit tests and, for anything that touches SQL generation, at least one snapshot test demonstrating expected output.
- Tests for pure Python logic belong in `tests_metricflow_semantics/` or `tests_metricflow_semantic_interfaces/`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not quite the right description. Maybe just that tests for code that is defined in metricflow go into test_metricflow, etc.

1. **Correctness** — the metric logic must be right
2. **Performance** — SQL should be efficient on the target compute platform
3. **Legibility** — generated SQL should be readable by an analyst
4. **Ease of manipulation** — the code that generates SQL should be maintainable
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oof, I should update TENENTS.md to move this up.


Every PR that introduces a user-visible change (new feature, bug fix, behavior change, deprecation) must include a file in `.changes/unreleased/` generated by `changie new`. If this entry is absent and the change is not purely internal (test-only, docs-only, CI-only), comment:

> This PR appears to be missing a `changie` changelog entry. Run `changie new` from the repo root, follow the prompts, and commit the generated file in `.changes/unreleased/`. Do not edit `CHANGELOG.md` directly. See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-or-modifying-a-changelog-entry) for details.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this handle the Skip Changelog tag?


### One PR, one concern

A PR should do one thing. This is the single most important property for receiving a fast, high-quality review. Mixed concerns — a bug fix bundled with a refactor, a new feature alongside unrelated cleanup — make it harder to reason about correctness and harder to revert individual changes if a regression is discovered. When a PR conflates independent concerns, suggest separation:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An exception for minor renames / cleanup in an separate commit would be helpful to allow.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants