You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "jsoref (via GitHub)" <gi...@apache.org> on 2023/03/02 21:38:13 UTC

[PR] Produce artifacts for reproducible builds (logging-log4j2)

jsoref opened a new pull request, #1321:
URL: https://github.com/apache/logging-log4j2/pull/1321

   * Merges The two build reproducibility steps
   * Adds steps to capture the artifacts from a failed reproducibility
   
   Fixes #1318 
   
   ## Checklist
   
   - [x] use `main` otherwise
   - [ ]`./mvnw verify` succeeds (if it fails due to code formatting issues reported by Spotless, simply run `spotless:apply` and retry)
   - [ ] Changes contain an entry file in the `src/changelog/.2.x.x` directory
   - [ ] Tests for the changes are provided
   - [ ] [Commits are signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) (optional, but highly recommended)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Produce artifacts for reproducible builds (logging-log4j2)

Posted by "jsoref (via GitHub)" <gi...@apache.org>.
jsoref commented on code in PR #1321:
URL: https://github.com/apache/logging-log4j2/pull/1321#discussion_r1123749953


##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build reproducibility report.
       # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare

Review Comment:
   This was failing before we could get anything close to helpful human reporting



##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build reproducibility report.
       # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1
             fi
           done
+          if [ -n "$failed" ]; then
+            exit $failed

Review Comment:
   This way users can see all the faults, and then it fails.



##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build reproducibility report.
       # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1

Review Comment:
   The old code was fail on first found fault instead of telling users about all the faults



##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build reproducibility report.
       # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1
             fi
           done
+          if [ -n "$failed" ]; then
+            exit $failed
+          fi
 
+      - name: Reports for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@v3
+        with:
+          name: target-artifacts-${{matrix.os}}
+          path: "**/target/*.buildcompare"
+      - name: Artifacts for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@v3
+        with:
+          name: target-artifacts-${{matrix.os}}
+          path: "*/target/*.jar"
+      - name: Artifacts for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@v3
+        with:
+          name: target-artifacts-${{matrix.os}}
+          path: "*/target/reference/*.jar"

Review Comment:
   And when it fails, we assemble an artifact that contains information that would hopefully help a user understand why it failed...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Produce artifacts for reproducible builds (logging-log4j2)

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on code in PR #1321:
URL: https://github.com/apache/logging-log4j2/pull/1321#discussion_r1124627405


##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build reproducibility report.
       # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1
             fi
           done
+          if [ -n "$failed" ]; then
+            exit $failed
+          fi
 
+      - name: Reports for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
+        with:
+          name: target-artifacts-${{matrix.os}}
+          path: "**/target/*.buildcompare"
+      - name: Artifacts for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
+        with:
+          name: target-artifacts-${{matrix.os}}
+          path: "*/target/*.jar"
+      - name: Artifacts for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
+        with:
+          name: target-artifacts-${{matrix.os}}
+          path: "*/target/reference/*.jar"

Review Comment:
   ```suggestion
         - name: Upload artifacts for troubleshooting
           if: failure() && steps.report-reproducible.outcome == 'failure'
           uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
           with:
             name: reproducubility-failure-context-${{matrix.os}}
             path: |
               **/target/*.buildcompare
               **/target/*.jar
               **/target/reference/*.jar
   
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Produce artifacts for reproducible builds (logging-log4j2)

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on code in PR #1321:
URL: https://github.com/apache/logging-log4j2/pull/1321#discussion_r1124627405


##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build reproducibility report.
       # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1
             fi
           done
+          if [ -n "$failed" ]; then
+            exit $failed
+          fi
 
+      - name: Reports for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
+        with:
+          name: target-artifacts-${{matrix.os}}
+          path: "**/target/*.buildcompare"
+      - name: Artifacts for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
+        with:
+          name: target-artifacts-${{matrix.os}}
+          path: "*/target/*.jar"
+      - name: Artifacts for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
+        with:
+          name: target-artifacts-${{matrix.os}}
+          path: "*/target/reference/*.jar"

Review Comment:
   ```suggestion
         - name: Upload reproducibility failure context artifacts
           if: failure() && steps.report-reproducible.outcome == 'failure'
           uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
           with:
             name: reproducubility-failure-context-${{matrix.os}}
             path: |
               **/target/*.buildcompare
               **/target/*.jar
               **/target/reference/*.jar
   
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Produce artifacts for reproducible builds (logging-log4j2)

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on code in PR #1321:
URL: https://github.com/apache/logging-log4j2/pull/1321#discussion_r1123772601


##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build reproducibility report.
       # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1
             fi
           done
+          if [ -n "$failed" ]; then
+            exit $failed
+          fi
 
+      - name: Reports for report build reproducibility
+        if: failure() && steps.report-reproducible.outcome == 'failure'
+        uses: actions/upload-artifact@v3

Review Comment:
   IIRC Github produces security alerts if we use the tag of an action instead of the SHA1.



##########
.github/workflows/build.yml:
##########
@@ -67,25 +67,43 @@ jobs:
       # `clean verify artifact:compare` is required to generate the build reproducibility report.
       # For details, see: https://maven.apache.org/guides/mini/guide-reproducible-builds.html#how-to-test-my-maven-build-reproducibility
       - name: Report build reproducibility
+        id: report-reproducible
         timeout-minutes: 10
         shell: bash
         run: |
           ./mvnw \
             --show-version --batch-mode --errors --no-transfer-progress \
             -DskipTests=true \
-            clean verify artifact:compare
-
-      - name: Verify build reproducibility
-        shell: bash
-        run: |
+            clean verify artifact:compare || failed=1
           for report_file in target/*.buildcompare **/target/*.buildcompare; do
             if ! grep -q "^ko=0$" "$report_file"; then
               echo "Spotted build reproducibility failure in \`$report_file\`:"
               cat "$report_file"
-              exit 1
+              failed=1

Review Comment:
   Since [MARTIFACT-35](https://issues.apache.org/jira/browse/MARTIFACT-35) was fixed in version 3.4.0, we can also get rid of the `for` loop.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Produce artifacts for reproducible builds (logging-log4j2)

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy merged PR #1321:
URL: https://github.com/apache/logging-log4j2/pull/1321


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Produce artifacts for reproducible builds (logging-log4j2)

Posted by "niwatrueangkham (via GitHub)" <gi...@apache.org>.
niwatrueangkham commented on PR #1321:
URL: https://github.com/apache/logging-log4j2/pull/1321#issuecomment-1454808234

   Niwatrueangkham 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org