Skip to content

Commit 70a5147

Browse files
authored
Add CONTRIBUTING.md (#2721)
1 parent 07d40e3 commit 70a5147

File tree

5 files changed

+72
-32
lines changed

5 files changed

+72
-32
lines changed

CONTRIBUTING.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contributing
2+
3+
Pull requests for bug fixes are always welcome!
4+
5+
Before submitting new features or changes to current functionality, it is recommended to first
6+
[open an issue](https://github.com/microsoft/ApplicationInsights-Java/issues/new)
7+
and discuss your ideas or propose the changes you wish to make.
8+
9+
## Building
10+
11+
In order to build and test this whole repository you need JDK 11+.
12+
13+
### Building from source
14+
15+
Build using Java 11+:
16+
17+
```bash
18+
java -version
19+
```
20+
21+
```bash
22+
./gradlew assemble
23+
```
24+
25+
and then you can find the java agent artifact at
26+
27+
`agent/agent/build/libs/applicationinsights-agent-<version>.jar`.
28+
29+
## IntelliJ setup and troubleshooting
30+
31+
See [IntelliJ setup and troubleshooting](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/intellij-setup-and-troubleshooting.md)
32+
from the OpenTelemetry Java Instrumentation project.
33+
34+
## Style guide
35+
36+
See the [style guide](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/style-guideline.md).
37+
from the OpenTelemetry Java Instrumentation project.
38+
39+
## Running a smoke test in Intellij
40+
41+
Pick the smoke test that you want to run, e.g. `MongoTest`.
42+
If the smoke test is abstract, then pick one of its subclasses, e.g. `MongoTest$Tomcat8Java8Test`.
43+
Right-click on it and select run.
44+
45+
## Debugging a smoke test in Intellij
46+
47+
Add `-PsmokeTestRemoteDebug=true` to the gradle args, e.g.
48+
49+
![Update smoke test configuration](docs/intellij-debug-smoke-test-part-1.png)
50+
51+
Then create a Remote JVM Debug configuration, e.g.
52+
53+
![Create a Remote JVM Debug configuration](docs/intellij-debug-smoke-test-part-2.png)
54+
55+
Then run (not debug) the smoke test as above in [Running the smoke tests from Intellij](#running-a-smoke-test-in-intellij).
56+
57+
The JVM inside the container will wait remote debugger to be attached before starting.
58+
59+
Then go to Run > Debug, and select your Remote JVM Debug configuration.
60+
61+
## Error prone
62+
63+
While developing, if you find errorprone is getting in your way (e.g. it won't let you add
64+
`System.out.println` to your code), you can disable it by adding the following to your
65+
`~/.gradle/gradle.properties`:
66+
67+
```
68+
disableErrorProne=true
69+
```

README.md

+2-31
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,9 @@
44

55
See documentation at https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-in-process-agent.
66

7-
## If you need to build locally
7+
## If you need to build locally or want to contribute
88

9-
Download the main repo and submodule:
10-
11-
```
12-
git clone https://github.com/microsoft/ApplicationInsights-Java
13-
cd ApplicationInsights-Java
14-
```
15-
16-
Build the agent jar file:
17-
18-
```
19-
./gradlew :agent:agent:shadowJar
20-
```
21-
22-
The agent jar file should now be available under `agent/agent/build/libs`.
23-
24-
## If you are contributing...
25-
26-
We follow the same
27-
[style guidelines](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/style-guideline.md)
28-
and
29-
[recommended Intellij setup](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/intellij-setup.md)
30-
as the OpenTelemetry Java Instrumentation repo.
31-
32-
While developing, if you find errorprone is getting in your way (e.g. it won't let you add
33-
`System.out.println` to your code), you can disable it by adding the following to your
34-
`~/.gradle/gradle.properties`:
35-
36-
```
37-
disableErrorProne=true
38-
```
9+
See [CONTRIBUTING.md](CONTRIBUTING.md).
3910

4011
## Microsoft Open Source Code of Conduct
4112

39.3 KB
Loading
50.2 KB
Loading

smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/SmokeTestExtension.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class SmokeTestExtension
5757
AfterEachCallback,
5858
TestWatcher {
5959

60-
// use -PsmokeTestRemoteDebug=true at gradle command line to enable (see ai.smoke-test.gradle.kts)
60+
// add -PsmokeTestRemoteDebug=true to the gradle args to enable (see ai.smoke-test.gradle.kts)
6161
private static final boolean REMOTE_DEBUG = Boolean.getBoolean("ai.smoke-test.remote-debug");
6262

6363
private static final int TELEMETRY_RECEIVE_TIMEOUT_SECONDS = 60;

0 commit comments

Comments
 (0)