kaxil opened a new pull request, #62442: URL: https://github.com/apache/airflow/pull/62442
Complements #62440. With the increase in AI-generated PRs, we've been spending a lot of reviewer time catching the same mistakes: fabricated diffs, N+1 queries, architecture boundary violations, PRs that "fix" things in the wrong component, and code that looks plausible but breaks under real usage. This adds [GitHub Copilot custom instructions](https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot) scoped to **code review only** (`excludeAgent: coding-agent`) so Copilot can flag these patterns during PR review automatically. The rules are derived from patterns I've seen in recently closed/rejected PRs. What the instructions cover: - **Architecture boundaries** — scheduler must not run user code, workers must not access metadata DB directly, providers must not import core internals - **Database correctness** — N+1 queries, `run_id` uniqueness scoping, cross-DB compatibility, session discipline - **Code quality** — no `assert` in production, `time.monotonic()` for durations, bounded caches, `TYPE_CHECKING` guards - **Testing** — pytest patterns, `spec`/`autospec` mocks, `time_machine`, no issue numbers in docstrings - **API/UI** — `map_index` handling, Cadwyn versioning, React anti-patterns - **AI-slop signals** — fabricated diffs, unrelated files, description/code mismatch, narrating comments, empty descriptions, over-engineered solutions - **Quality signals** — regression tests for bug fixes, existing tests shouldn't need modification Also excludes `.github/instructions/` from `doctoc` and `insert-license` pre-commit hooks since `.instructions.md` files require YAML frontmatter at the very start of the file. ##### Was generative AI tooling used to co-author this PR? - [x] Yes — Cursor -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
