-
-
Notifications
You must be signed in to change notification settings - Fork 95
Feature: Adding repository based instructions as a support to GitHub copilot #1297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Feature: Adding repository based instructions as a support to GitHub copilot #1297
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@firasrg how are you testing and evaluating it? Did you try to see if the quality of AI suggestions improved with that file or not?
A lot of the content feels to me like the AI easily knows that and does not need any help on it. For example the language of the project, which build tool it uses or all the dependencies. I am pretty sure the AI is totally capable of analysing our gradle files to understand that we are using for example caffeine and knows that caffeine is used for making caches. And especially listings like that tend to rot quickly. No one will think about this copilot file when we add a new dependency or remove existing dependencies. So this file will quickly get outdated in that regard.
overall i think this instruction file focuses way too much on explaining details that an AI already has access to. it should instead focus on giving insights on how we code, which class to use for what. how exactly to make commands, routines, user interactions, how we use the jda tester for writing mocked unit tests, ... thats the kind of info AI lacks. it needs to be given a brain, not "this directory contains this file".
so i doubt the file, as it is right now, is actually improving AI results much. and in worse case, it could poison it because the file currently contains a bunch of things that will have rotten in, say 2 years.
.github/copilot-instructions.md
Outdated
**Languages** | ||
- Java: the primary language for the project. | ||
- SQL: for database creation and management. | ||
- Groovy: for build-tool's configurations. | ||
|
||
**Build & Dependency Management** | ||
- Gradle v8: the build tool used for managing dependencies and building the project. | ||
- Shadow plugin: for creating a fat JAR with all dependencies included. | ||
- Jib plugin: for building Docker images directly from Gradle. | ||
|
||
**Framework :** JDA (Java Discord API): the main framework for interacting with Discord's API. | ||
|
||
**Database** | ||
- SQLite: for local database storage. | ||
- jOOQ (ORM): for database interactions and schema generation. | ||
|
||
**Logging** | ||
- Log4j v2: the logging framework used for logging messages. | ||
- log4j-slf4j2-impl: for bridging SLF4J to Log4j v2. | ||
|
||
**JSON/XML/CSV Processing** | ||
- Jackson (core, dataformat-csv, dataformat-xml, datatype-jsr310, sealed-classes) | ||
|
||
**Utilities** | ||
- jsr305: for annotations from JSR-305. | ||
- JetBrains Annotations: for annotations from JetBrains. | ||
- urlbuilder: for building URLs. | ||
- jsoup: for parsing HTML and extracting data. | ||
- jlatexmath (+ font modules): for rendering LaTeX math expressions. | ||
- ascii-table: for rendering ASCII tables. | ||
- url-detector | ||
- caffeine (caching) | ||
- github-api (kohsuke) | ||
- commons-text | ||
- rssreader | ||
- com.theokanning.openai-gpt3-java (api, service) | ||
|
||
**Testing** | ||
- JUnit Jupiter | ||
- Mockito | ||
|
||
**Code Quality** | ||
- Spotless | ||
- SonarLint | ||
|
||
**Containerization** | ||
- Docker Compose | ||
- Jib (for container image building) | ||
|
||
**Version Control & CI/CD** | ||
- Git v2 | ||
- GitHub Actions (for CI/CD, under `.github/workflows`) | ||
- Dependabot (for dependency updates, under `.github/dependabot.yml`) | ||
- Docker | ||
|
||
**IDE/Editor Support** | ||
- IntelliJ IDEA | ||
- Eclipse | ||
- GitHub Codespaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels unnecessary, does this actually help the AI? i have my doubts
.github/copilot-instructions.md
Outdated
- Jib (for container image building) | ||
|
||
**Version Control & CI/CD** | ||
- Git v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should not include a version at all or at least have the latest one (2.50.1
as of typing this).
The AI might interpret this as something along the lines of "v2.0.0" and might reason:
Oh, we should not consider features and bugfixes done after that version.
Which is precisely something we don't want the AI to think.
We also do not want to come back to this file every time Git updates to a new version so it is recommended to skip mentioning the version altogether.
.github/copilot-instructions.md
Outdated
- Groovy: for build-tool's configurations. | ||
|
||
**Build & Dependency Management** | ||
- Gradle v8: the build tool used for managing dependencies and building the project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a good idea to include the specific Gradle version here (8.14.2, from gradle.properties) to be more specific about which features are available to us and which ones are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've considered that, but potential updates in v8.* would require updating this value too, which could be forgotten. Even if remembered, it might be a burdensome task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So instead you can tell it:
Be aware of the Gradle version in use. It is written in the file gradle.properties.
Or not mention it at all, because the AI is probably smart enough to figure out all versions of all tools and dependencies - given that it analyzes the entire repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zabuzard following github's docs, I think that it may not analyze it well without the instructions in this file, because its default behavior is to focus on opened files only.
#1299 (which just got merged) makes this easier. Now you probably only have to tell the AI to read the files in the |
7caf207
to
81b7c92
Compare
|
This PR adds a
copilot-instruction.md
file to guide GitHub Copilot in generating code suggestions that align with TJ-Bot's standards. The file covers:I was thinking about adding more than these, then I backed down as it could be redundant to Wiki's content. Please review, thanks!
closes #1295