Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

alan0428a
Copy link
Contributor

@alan0428a alan0428a commented Mar 15, 2025

Add missing dependencies because of upgrading to logging-parent 12.0.0
relate PR: apache/logging-parent#265

Checklist

  • ./mvnw verify succeeds (if it fails due to code formatting issues reported by Spotless, simply run spotless:apply, and retry)
  • Changelog entry file in src/changelog/.0.x.x folder
  • Tests for the changes are provided
  • Commits are signed (optional, but highly recommended)

Copy link
Contributor

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alan0428a,

Thanks! 💯

@alan0428a
Copy link
Contributor Author

alan0428a commented Mar 16, 2025

@ppkarwasz
When I built locally, I can see it failed to build log4j-docgen, because there is a warning in DescriptorGenerator. And the compile settting is failOnWarning=true for that package. Not sure why it shows up now. Do we want to make the change as it suggested?

/Users/alanyu/Repos/logging-log4j-tools/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/DescriptorGenerator.java:[618,71] [VoidUsed] Using a Void-typed variable is potentially confusing, and can be replaced with a literal `null`.
    (see https://errorprone.info/bugpattern/VoidUsed)
  Did you mean 'return super.visitExecutable(element, null);'?

@ppkarwasz
Copy link
Contributor

@alan0428a,

/Users/alanyu/Repos/logging-log4j-tools/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/DescriptorGenerator.java:[618,71] [VoidUsed] Using a Void-typed variable is potentially confusing, and can be replaced with a literal `null`.
    (see https://errorprone.info/bugpattern/VoidUsed)
  Did you mean 'return super.visitExecutable(element, null);'?

The usage of Void in that code is due the visitor API that has a type parameter we don't use.
Currently I pass to super the parameters that the method receives, but we can replace it with null.

Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much @alan0428a! I've dropped some remarks.

Note that you also need to update generate-email.sh too:

Index: .github/generate-email.sh
===================================================================
diff --git a/.github/generate-email.sh b/.github/generate-email.sh
--- a/.github/generate-email.sh	(revision faafe70f9b65a2f64a963cd5bf3040358c175e88)
+++ b/.github/generate-email.sh	(date 1739530067671)
@@ -28,12 +28,12 @@
 
 fail_for_invalid_args() {
     stderr "Invalid arguments!"
-    stderr "Expected arguments: <vote|announce> <version> <commitId>"
+    stderr "Expected arguments: <vote|announce> <version> <commitId> <nexusUrl>"
     exit 1
 }
 
 # Check arguments
-[ $# -ne 3 ] && fail_for_invalid_args
+[ $# -ne 4 ] && fail_for_invalid_args
 
 # Constants
 PROJECT_NAME="Apache Log4j Tools"
@@ -43,6 +43,7 @@
 PROJECT_REPO="https://github.com/apache/logging-log4j-tools"
 PROJECT_VERSION="$2"
 COMMIT_ID="$3"
+NEXUS_URL="$4"
 PROJECT_DIST_URL="https://dist.apache.org/repos/dist/dev/logging/$PROJECT_ID/$PROJECT_VERSION"
 
 # Check release notes file
@@ -71,7 +72,7 @@
 GitHub: $PROJECT_REPO
 Commit: $COMMIT_ID
 Distribution: $PROJECT_DIST_URL
-Nexus: https://repository.apache.org/content/repositories/orgapachelogging-<FIXME>
+Nexus: $NEXUS_URL
 Signing key: 0x077e8893a6dcc33dd4a4d5b256e73ba9a0b592d0
 Review kit: https://s.apache.org/logging-parent-release-review-kit

See the logging-parent release notes for details.

@ppkarwasz
Copy link
Contributor

@alan0428a,

The new Error Prone from logging-parent version 12.1.0 is complaining about a return statement:

Warning:  /home/runner/work/logging-log4j-tools/logging-log4j-tools/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocData.java:[185,28] [AssignmentExpression] The use of an assignment expression can be surprising and hard to read; consider factoring out the assignment to a separate statement.
    (see https://errorprone.info/bugpattern/AssignmentExpression)

Can you fix this?

@ppkarwasz ppkarwasz moved this from To triage to In progress in Log4j bug tracker Apr 27, 2025
@alan0428a
Copy link
Contributor Author

@ppkarwasz fixed. Thanks.

@ppkarwasz
Copy link
Contributor

Apparently there is still one required change: the workflows in .github/workflows must be migrated from @rel/11.3.0 to @rel/12.1.0.

@alan0428a
Copy link
Contributor Author

@ppkarwasz
Oh, that's true. Thanks for checking. Updated.

@ppkarwasz
Copy link
Contributor

@alan0428a,

Thanks, this is ready to merge!

In all our repos we require signed Git commit, which means that I can not merge until all commits are signed.
This means that you need to:

  1. You need to add your GPG key to your Github account.
  2. You need to sign all commits, e.g. by rebasing:
    git rebase --force-rebase --gpg-sign origin/main

@alan0428a alan0428a force-pushed the bump-logging-parent-12.0.0 branch from cc57a5c to dc6cde7 Compare May 9, 2025 14:25
@alan0428a
Copy link
Contributor Author

@ppkarwasz
Thanks! I've signed all commits.

@ppkarwasz ppkarwasz merged commit 843beda into apache:main May 9, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Log4j bug tracker May 9, 2025
@ppkarwasz
Copy link
Contributor

@alan0428a, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants