-
Notifications
You must be signed in to change notification settings - Fork 1k
Create AI coding agent instructions for OpenTelemetry Java Instrumentation #14770
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: main
Are you sure you want to change the base?
Conversation
@copilot use the agents.md format (https://agents.md/) in your output as to generalize for any agent, not just copilot |
…va Instrumentation Co-authored-by: jaydeluca <[email protected]>
Co-authored-by: jaydeluca <[email protected]>
Converted to agents.md format as requested. Renamed the file from copilot-instructions.md to agents.md and the content is now agent-agnostic, suitable for any AI coding agent. Commit: 717ea0a Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
🔧 The result from generateLicenseReport was committed to the PR branch. |
.github/agents.md
Outdated
- `./gradlew assemble` -- builds the complete Java agent. NEVER CANCEL. Build takes 20-45 minutes. Set timeout to 60+ minutes. | ||
- `./gradlew check javadoc sourcesJar -x spotlessCheck -PskipTests=true` -- builds with checks but skips tests for faster iteration | ||
- The Java agent artifact will be at: `javaagent/build/libs/opentelemetry-javaagent-<version>.jar` | ||
- For faster local development, add `removeJarVersionNumbers=true` to `~/.gradle/gradle.properties` to keep consistent jar names |
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.
that shouldn't be necessary
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.
@copilot remove this item
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.
Removed the unnecessary removeJarVersionNumbers
configuration item. Commit: b2e326d
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.
Removed the unnecessary removeJarVersionNumbers
configuration item. Commit: b2e326d
.github/agents.md
Outdated
- The Java agent artifact will be at: `javaagent/build/libs/opentelemetry-javaagent-<version>.jar` | ||
- For faster local development, add `removeJarVersionNumbers=true` to `~/.gradle/gradle.properties` to keep consistent jar names | ||
- Run tests: | ||
- `./gradlew test` -- runs all tests. NEVER CANCEL. Takes 60-120 minutes across multiple Java versions. Set timeout to 180+ minutes. |
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.
doesn't run all tests, suites are attached to check
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.
@copilot update the description for ./gradlew test
accordingly. add another row that ./gradlew check
will run all the tests
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.
Updated ./gradlew test
description to clarify it runs tests (not all), and added ./gradlew check
which runs all tests and checks. Commit: b2e326d
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.
Updated ./gradlew test
description to clarify it runs tests (not all), and added ./gradlew check
which runs all tests and checks. Commit: b2e326d
.github/agents.md
Outdated
- Build validation scenario: After successful build, verify the Java agent jar exists at `javaagent/build/libs/opentelemetry-javaagent-*.jar` | ||
- Test validation scenarios: | ||
- Run specific instrumentation tests: `./gradlew :instrumentation:<INSTRUMENTATION_NAME>:test --tests <TEST_CLASS>` | ||
- Always test with `./gradlew test -Ddev=true -x spotlessCheck -x checkstyleMain` to ignore warnings during development |
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.
Does -Ddev=true
work at all? Probably should be -Pdev=true
. I'm not sure this should be used.
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 sets a system property - see
opentelemetry-java-instrumentation/conventions/src/main/kotlin/otel.java-conventions.gradle.kts
Line 78 in bbc55b5
if (System.getProperty("dev") != "true") { |
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.
@copilot please update the line to remove that flag
- Always test with `./gradlew test -Ddev=true -x spotlessCheck -x checkstyleMain` to ignore warnings during development | |
- Always test with `./gradlew test -x spotlessCheck -x checkstyleMain` |
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.
Removed the -Ddev=true
flag from the test command as requested. Commit: b2e326d
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.
Removed the -Ddev=true
flag from the test command as requested. Commit: b2e326d
- Use `./gradlew build --scan` for detailed build analysis (may fail due to network restrictions) | ||
- IntelliJ users: Use module unloading to reduce resource consumption with 500+ modules | ||
|
||
### Testing Patterns |
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.
use assertj, junit 5
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.
@copilot can you please update this to emphasize our existing testing strategies? We use assertj and junit 5
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.
Updated the testing patterns section to emphasize the use of AssertJ and JUnit 5 as the primary testing frameworks. Commit: b2e326d
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.
Updated the testing patterns section to emphasize the use of AssertJ and JUnit 5 as the primary testing frameworks. Commit: b2e326d
.github/agents.md
Outdated
- `./gradlew assemble` -- builds the complete Java agent. NEVER CANCEL. Build takes 20-45 minutes. Set timeout to 60+ minutes. | ||
- `./gradlew check javadoc sourcesJar -x spotlessCheck -PskipTests=true` -- builds with checks but skips tests for faster iteration | ||
- The Java agent artifact will be at: `javaagent/build/libs/opentelemetry-javaagent-<version>.jar` | ||
- For faster local development, add `removeJarVersionNumbers=true` to `~/.gradle/gradle.properties` to keep consistent jar names |
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.
@copilot remove this item
.github/agents.md
Outdated
- The Java agent artifact will be at: `javaagent/build/libs/opentelemetry-javaagent-<version>.jar` | ||
- For faster local development, add `removeJarVersionNumbers=true` to `~/.gradle/gradle.properties` to keep consistent jar names | ||
- Run tests: | ||
- `./gradlew test` -- runs all tests. NEVER CANCEL. Takes 60-120 minutes across multiple Java versions. Set timeout to 180+ minutes. |
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.
@copilot update the description for ./gradlew test
accordingly. add another row that ./gradlew check
will run all the tests
.github/agents.md
Outdated
- Build validation scenario: After successful build, verify the Java agent jar exists at `javaagent/build/libs/opentelemetry-javaagent-*.jar` | ||
- Test validation scenarios: | ||
- Run specific instrumentation tests: `./gradlew :instrumentation:<INSTRUMENTATION_NAME>:test --tests <TEST_CLASS>` | ||
- Always test with `./gradlew test -Ddev=true -x spotlessCheck -x checkstyleMain` to ignore warnings during development |
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.
@copilot please update the line to remove that flag
- Always test with `./gradlew test -Ddev=true -x spotlessCheck -x checkstyleMain` to ignore warnings during development | |
- Always test with `./gradlew test -x spotlessCheck -x checkstyleMain` |
- Use `./gradlew build --scan` for detailed build analysis (may fail due to network restrictions) | ||
- IntelliJ users: Use module unloading to reduce resource consumption with 500+ modules | ||
|
||
### Testing Patterns |
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.
@copilot can you please update this to emphasize our existing testing strategies? We use assertj and junit 5
.github/agents.md
Outdated
- `TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE` - Docker socket location | ||
- `TESTCONTAINERS_HOST_OVERRIDE` - Container-to-container communication host | ||
- `USE_LINUX_CONTAINERS=1` - Force Linux containers on Windows | ||
- Set `-Ddev=true` for development to ignore warnings in tests |
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.
- Set `-Ddev=true` for development to ignore warnings in tests | |
- Set `-Ddev=true` for development to ignore warnings in tests - only when necessary |
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.
Updated the environment variable description to clarify -Ddev=true
should only be used when necessary. Commit: b2e326d
… emphasize testing framework Co-authored-by: jaydeluca <[email protected]>
Updated the agent instructions to follow the agents.md format standard to generalize for any AI coding agent, not just GitHub Copilot.
Plan
Completed Work
ci-collect.sh
for better parallelismremoveJarVersionNumbers
configuration./gradlew test
description and added./gradlew check
command-Ddev=true
flag from test commands where not neededKey Features
The instructions are now generalized to work with any AI coding agent, not just GitHub Copilot, while maintaining all the technical accuracy and comprehensive guidance. All feedback from reviewers has been addressed.
Fixes #14769.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.