docs: add Copilot repository and code review instructions#958
Open
alaahong wants to merge 4 commits into
Open
Conversation
- .github/copilot-instructions.md: repository-wide instructions covering project overview, build/test commands, code style, module structure, testing conventions, and CI checks - .github/instructions/code-review.instructions.md: path-specific Java review instructions with 8 priority checks and a pitfalls table derived from real bug fixes (sql.Date toInstant, negative value validation, premature ThreadLocal cleanup, missing defensive copy, FileWriter charset)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub Copilot repository-wide and Java-specific code review instructions to encode Apache Fesod project context and recurring review pitfalls, improving automated review quality and reducing repetitive feedback.
Changes:
- Adds repository-wide Copilot instructions covering project overview, build/test commands, module layout, testing conventions, and CI checks.
- Adds Java path-specific code review instructions (via
applyTo: "**/*.java") with prioritized review dimensions and a “common pitfalls” reference table.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/copilot-instructions.md | Adds repository-wide Copilot guidance (project context, build/test commands, conventions, module/test/CI overview). |
| .github/instructions/code-review.instructions.md | Adds Java-only code review focus areas and a compact pitfalls table for common regressions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
copilot-instructions.md: - Fix misleading 'builds on JDK 17+' — clarify CI builds on JDK 8-25 - Remove unclear '(\#|\ pattern)' parenthetical, explain Spotless importOrder - Attribute license header enforcement to Hawkeye workflow, not Spotless - Replace non-existent 'fesod-parent/' dir with '(root)' in module tree - Fix '@DisplayName(ReplaceUnderscores)' to reference junit-platform.properties code-review.instructions.md: - Attribute license header enforcement to Hawkeye workflow, not Spotless - Fix backslash-escaped '\|\|' rendering issue in markdown table - Use 'StandardCharsets.UTF_8' instead of 'UTF_8' for consistency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the pull request
Add GitHub Copilot custom instructions to improve automated code review quality and reduce repetitive review feedback on PRs. This follows the official GitHub Copilot repository instructions feature.
What's changed?
Background
Copilot code review on recent PRs (#954 etc.) raised valid points (e.g.,
FileWriterusing platform-default charset, deprecatedjava.util.Dateconstructors) that could have been caught earlier with proper repository context. These instructions encode project-specific conventions so Copilot can provide more accurate and actionable review feedback.Files added
.github/copilot-instructions.md— Repository-wide instructions (applies to all Copilot interactions):./mvnwwrapper, module-specific test commands, tag-based filtering@Tagsystem (unit, round-trip, read, write, format, fuzz).github/instructions/code-review.instructions.md— Path-specific Java review instructions (applyTo: "**/*.java"):toInstant()onjava.sql.Date/Time→UnsupportedOperationExceptionvalue == -1validation missing other negative valuesThreadLocalcleanup infinallyblockstoMutableListIfNecessary()defensive copy in buildersFileWriterplatform-default charset in testsDesign decisions
Checklist
(No unit tests required — this PR adds documentation/configuration files only. Spotless pre-push hook passed: all 482 Java files clean.)