Skip to content

Commit 92c9d78

Browse files
authored
Remove fork, update spotless, and smoke test framework improvements (#2283)
* Move micrometer instrumentation to distro * Remove fork * Pipelines - remove Java 11 install * Add TODOs * Remove commented out code * offline * Better caching * Less caching for now * Add TODOs * More * fix? * Revert "fix?" This reverts commit a312ec0. * maybe * wip * Simplify smoke tests * Consistent smoke test package naming * Spotless * Bring back test * Rename jre.master.txt * Remove outdated doc * Simplify fakeingestion * Simplify * Simplify * chmod * Simplify * fix * Update .pipelines/pipeline.user.windows.official.yml * Update .pipelines/pipeline.user.windows.official.nonrelease.yml * Update buildSrc/build.gradle.kts * fix
1 parent 0cde83b commit 92c9d78

File tree

526 files changed

+1724
-1106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

526 files changed

+1724
-1106
lines changed

.config/CredScanSuppressions.json

-14
This file was deleted.

.editorconfig

+10-10
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ ij_java_for_statement_wrap = normal
111111
ij_java_generate_final_locals = false
112112
ij_java_generate_final_parameters = false
113113
ij_java_if_brace_force = always
114-
ij_java_imports_layout = $*,|,*
114+
ij_java_imports_layout = $*, |, *
115115
ij_java_indent_case_from_switch = true
116116
ij_java_insert_inner_class_imports = false
117117
ij_java_insert_override_annotation = true
@@ -452,12 +452,12 @@ ij_scala_wrap_long_lines = false
452452
[.editorconfig]
453453
ij_editorconfig_align_group_field_declarations = false
454454
ij_editorconfig_space_after_colon = false
455-
ij_editorconfig_space_after_comma = false
455+
ij_editorconfig_space_after_comma = true
456456
ij_editorconfig_space_before_colon = false
457457
ij_editorconfig_space_before_comma = false
458458
ij_editorconfig_spaces_around_assignment_operators = true
459459

460-
[{*.ant,*.bpmn,*.fxml,*.jhm,*.jnlp,*.jrxml,*.plan,*.pom,*.rng,*.tld,*.wadl,*.wsdd,*.wsdl,*.xjb,*.xml,*.xsd,*.xsl,*.xslt,*.xul}]
460+
[{*.ant, *.bpmn, *.fxml, *.jhm, *.jnlp, *.jrxml, *.plan, *.pom, *.rng, *.tld, *.wadl, *.wsdd, *.wsdl, *.xjb, *.xml, *.xsd, *.xsl, *.xslt, *.xul}]
461461
ij_continuation_indent_size = 2
462462
ij_xml_align_attributes = false
463463
ij_xml_align_text = false
@@ -477,14 +477,14 @@ ij_xml_space_inside_empty_tag = false
477477
ij_xml_text_wrap = normal
478478
ij_xml_use_custom_settings = true
479479

480-
[{*.bash,*.sh,*.zsh}]
480+
[{*.bash, *.sh, *.zsh}]
481481
ij_shell_binary_ops_start_line = false
482482
ij_shell_keep_column_alignment_padding = false
483483
ij_shell_minify_program = false
484484
ij_shell_redirect_followed_by_space = false
485485
ij_shell_switch_cases_indented = false
486486

487-
[{*.gant,*.gradle,*.groovy,*.gson,*.gy}]
487+
[{*.gant, *.gradle, *.groovy, *.gson, *.gy}]
488488
ij_continuation_indent_size = 2
489489
ij_groovy_align_group_field_declarations = false
490490
ij_groovy_align_multiline_array_initializer_expression = false
@@ -663,7 +663,7 @@ ij_groovy_while_brace_force = never
663663
ij_groovy_while_on_new_line = false
664664
ij_groovy_wrap_long_lines = false
665665

666-
[{*.kt,*.kts}]
666+
[{*.kt, *.kts}]
667667
ij_continuation_indent_size = 2
668668
ij_kotlin_align_in_columns_case_branch = false
669669
ij_kotlin_align_multiline_binary_operation = false
@@ -740,7 +740,7 @@ ij_kotlin_wrap_elvis_expressions = 1
740740
ij_kotlin_wrap_expression_body_functions = 0
741741
ij_kotlin_wrap_first_method_in_call_chain = false
742742

743-
[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
743+
[{*.har, *.jsb2, *.jsb3, *.json, .babelrc, .eslintrc, .stylelintrc, bowerrc, jest.config}]
744744
ij_json_keep_blank_lines_in_code = 0
745745
ij_json_keep_indents_on_empty_lines = false
746746
ij_json_keep_line_breaks = true
@@ -752,12 +752,12 @@ ij_json_spaces_within_braces = false
752752
ij_json_spaces_within_brackets = false
753753
ij_json_wrap_long_lines = false
754754

755-
[{*.properties,spring.handlers,spring.schemas}]
755+
[{*.properties, spring.handlers, spring.schemas}]
756756
ij_properties_align_group_field_declarations = false
757-
ij_properties_keep_blank_lines = false
757+
ij_properties_keep_blank_lines = true
758758
ij_properties_key_value_delimiter = equals
759759
ij_properties_spaces_around_key_value_delimiter = false
760760

761-
[{*.yaml,*.yml}]
761+
[{*.yaml, *.yml}]
762762
ij_yaml_keep_indents_on_empty_lines = false
763763
ij_yaml_keep_line_breaks = true

.github/workflows/ci.yaml

+7-37
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,10 @@ jobs:
2525
uses: actions/setup-java@v1
2626
with:
2727
java-version: 11
28-
- name: Init and update otel submodule
29-
run: |
30-
git submodule init
31-
git submodule update
32-
- name: Restore cache
33-
uses: burrunan/gradle-cache-action@v1
34-
- name: Cache gradle wrapper
35-
uses: actions/cache@v2
36-
with:
37-
path: ~/.gradle/wrapper
38-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
39-
- name: Build otel-fork
40-
working-directory: otel
41-
# javadoc fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
42-
run: ./gradlew publishToMavenLocal -x javadoc
4328
- name: Test
44-
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
45-
run: ./gradlew check
29+
uses: gradle/gradle-build-action@v2
30+
with:
31+
arguments: check
4632
- name: Upload snapshot
4733
# only upload from windows since only that build includes etw
4834
if: matrix.os == 'windows-2019'
@@ -65,7 +51,7 @@ jobs:
6551
java-version: 11
6652
- id: set-matrix
6753
# "grep -v skipWinNative" is used to skip the warning message "Skipping build of :etw:native because skipWinNative=true"
68-
run: echo "::set-output name=matrix::{\"module\":[\"$(./gradlew -q :test:smoke:testApps:listTestApps | grep -v skipWinNative | xargs echo | sed 's/ /","/g')\"]}"
54+
run: echo "::set-output name=matrix::{\"module\":[\"$(./gradlew -q :smoke-tests:apps:listTestApps | grep -v skipWinNative | xargs echo | sed 's/ /","/g')\"]}"
6955

7056
smoke-test:
7157
needs: setup-smoke-test-matrix
@@ -82,26 +68,10 @@ jobs:
8268
uses: actions/setup-java@v1
8369
with:
8470
java-version: 11
85-
- name: Init and update otel submodule
86-
run: |
87-
git submodule init
88-
git submodule update
89-
- name: Restore cache
90-
uses: burrunan/gradle-cache-action@v1
91-
with:
92-
read-only: true
93-
- name: Cache gradle wrapper
94-
uses: actions/cache@v2
95-
with:
96-
path: ~/.gradle/wrapper
97-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
98-
- name: Build otel-fork
99-
working-directory: otel
100-
# javadoc fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
101-
run: ./gradlew publishToMavenLocal -x javadoc
10271
- name: Test
103-
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
104-
run: ./gradlew ${{ matrix.module }}:smokeTest
72+
uses: gradle/gradle-build-action@v2
73+
with:
74+
arguments: ${{ matrix.module }}:smokeTest
10575

10676
accept-pr:
10777
needs: [ build, smoke-test ]

.github/workflows/pr.yaml

+7-37
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,10 @@ jobs:
2626
uses: actions/setup-java@v1
2727
with:
2828
java-version: 11
29-
- name: Init and update otel submodule
30-
run: |
31-
git submodule init
32-
git submodule update
33-
- name: Restore cache
34-
uses: burrunan/gradle-cache-action@v1
35-
- name: Cache gradle wrapper
36-
uses: actions/cache@v2
37-
with:
38-
path: ~/.gradle/wrapper
39-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
40-
- name: Build otel-fork
41-
working-directory: otel
42-
# javadoc fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
43-
run: ./gradlew publishToMavenLocal -x javadoc
4429
- name: Test
45-
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
46-
run: ./gradlew check assemble
30+
uses: gradle/gradle-build-action@v2
31+
with:
32+
arguments: check assemble
4733
- name: Upload snapshot
4834
# only upload from windows since only that build includes etw
4935
if: matrix.os == 'windows-2019'
@@ -66,7 +52,7 @@ jobs:
6652
java-version: 11
6753
- id: set-matrix
6854
# "grep -v skipWinNative" is used to skip the warning message "Skipping build of :etw:native because skipWinNative=true"
69-
run: echo "::set-output name=matrix::{\"module\":[\"$(./gradlew -q :test:smoke:testApps:listTestApps | grep -v skipWinNative | xargs echo | sed 's/ /","/g')\"]}"
55+
run: echo "::set-output name=matrix::{\"module\":[\"$(./gradlew -q :smoke-tests:apps:listTestApps | grep -v skipWinNative | xargs echo | sed 's/ /","/g')\"]}"
7056

7157
smoke-test:
7258
needs: setup-smoke-test-matrix
@@ -83,26 +69,10 @@ jobs:
8369
uses: actions/setup-java@v1
8470
with:
8571
java-version: 11
86-
- name: Init and update otel submodule
87-
run: |
88-
git submodule init
89-
git submodule update
90-
- name: Restore cache
91-
uses: burrunan/gradle-cache-action@v1
92-
with:
93-
read-only: true
94-
- name: Cache gradle wrapper
95-
uses: actions/cache@v2
96-
with:
97-
path: ~/.gradle/wrapper
98-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
99-
- name: Build otel-fork
100-
working-directory: otel
101-
# javadoc fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
102-
run: ./gradlew publishToMavenLocal -x javadoc --stacktrace
10372
- name: Test
104-
# TODO enable build cache, either --build-cache here, or org.gradle.caching=true in gradle.properties
105-
run: ./gradlew ${{ matrix.module }}:smokeTest
73+
uses: gradle/gradle-build-action@v2
74+
with:
75+
arguments: ${{ matrix.module }}:smokeTest
10676

10777
accept-pr:
10878
needs: [ build, smoke-test ]

.gitmodules

-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
[submodule "otel"]
2-
path = otel
3-
url = https://github.com/microsoft/ApplicationInsights-Java.git
4-
branch = otel-fork

.lgtm.yml

-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
path_classifiers:
2-
submodule:
3-
- otel
41
extraction:
52
java:
63
index:
74
java_version: 11
8-
build_command: |
9-
# fails without this, guessing similar to https://github.com/github/codeql-action/issues/972
10-
export JAVA_TOOL_OPTIONS=--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
11-
12-
# needs Java 11, otherwise this could be done in before_index
13-
# javadoc fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
14-
./otel/gradlew --project-dir otel publishToMavenLocal -x javadoc
15-
./gradlew --no-daemon testClasses

.pipelines/pipeline.user.windows.buddy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ version:
77
build:
88
commands:
99
- !!buildcommand
10-
name: 'Assemble ApplicationInsights-Java JARs'
10+
name: 'Assemble'
1111
command: '.scripts/gradle.cmd'
12-
arguments: 'assemble'
12+
arguments: ':agent:agent:assemble --offline'
1313
artifacts:
1414
- to: 'Artifacts'
1515
include:

.pipelines/pipeline.user.windows.official.nonrelease.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ build:
1414
include:
1515
- '**/*'
1616
- !!buildcommand
17-
name: 'Assemble ApplicationInsights-Java JARs'
17+
name: 'Assemble'
1818
command: '.scripts/gradle.cmd'
19-
arguments: 'assemble'
19+
arguments: ':agent:agent:assemble --offline'
2020
artifacts:
2121
- to: 'Artifacts'
2222
include:

.pipelines/pipeline.user.windows.official.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ build:
1414
include:
1515
- '**/*'
1616
- !!defaultcommand
17-
name: 'Assemble ApplicationInsights-Java JARs'
17+
name: 'Assemble'
1818
command: '.scripts/gradle.cmd'
19-
arguments: 'publishToMavenLocal -DisRelease=true -Pai.etw.native.build=release'
19+
arguments: ':agent:agent:publishToMavenLocal -DisRelease=true -Pai.etw.native.build=release --offline'
2020
- !!buildcommand
2121
name: 'Copy files from maven local repository'
2222
command: '.scripts/copy-from-maven-local.cmd'

.pipelines/pipeline.user.windows.yml

+5-29
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ environment:
1010
versioning:
1111
commands:
1212
- !!defaultcommand
13+
# TODO (heya) what is this used for?
1314
name: 'Generate Version'
1415
command: '.scripts/version.cmd'
1516
# excluding our source code from being scanned for code sign validation
@@ -28,6 +29,7 @@ static_analysis_options:
2829
restore:
2930
commands:
3031
- !!defaultcommand
32+
# TODO (trask) test if this is needed, or maybe only needed for official release?
3133
name: 'Install Windows 10 SDK'
3234
command: '.scripts/installWindows10Sdk.cmd'
3335
logs:
@@ -36,39 +38,13 @@ restore:
3638
include:
3739
- '**/*.log'
3840
- !!defaultcommand
39-
name: 'Install Java 11 JDK'
40-
command: '.scripts/installJava11jdk.cmd'
41-
- !!defaultcommand
42-
name: 'Add OpenTelemetry to MavenLocal'
43-
command: '.scripts/ot-gradle.cmd'
44-
# javadoc fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
45-
arguments: 'publishToMavenLocal -x javadoc'
46-
# if connection reset issue continues, try:
47-
# -P org.gradle.internal.http.connectionTimeout=30000
48-
# -P org.gradle.internal.http.socketTimeout=30000
49-
# -P org.gradle.internal.repository.max.retries=10
50-
# -P org.gradle.internal.repository.initial.backoff=500
51-
- !!defaultcommand
52-
name: 'Download Dependencies'
41+
name: 'Download Dependencies and Java Toolchain (Java 11)'
5342
command: '.scripts/gradle.cmd'
54-
arguments: 'downloadDependencies'
55-
- !!defaultcommand
56-
name: 'List Installation Information'
57-
command: '.scripts/dumpInstallationInfo.cmd'
43+
arguments: 'test clean'
5844
test:
5945
commands:
60-
# - !!defaultcommand
61-
# name: 'Gradle Static Analysis'
62-
# command: '.scripts/gradle.cmd'
63-
# arguments: 'check -x test'
64-
# logs:
65-
# - to: 'Checks Reports'
66-
# include:
67-
# - '**/build/reports/**/*'
68-
# exclude:
69-
# - '**/build/reports/tests/**/*'
7046
- !!testcommand
71-
name: 'ApplicationInsights-Java Unit Tests'
47+
name: 'Run tests'
7248
command: '.scripts/gradle.cmd'
7349
arguments: 'test'
7450
fail_on_stderr: false

0 commit comments

Comments
 (0)