Skip to content
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

fix(logging): Remove lombok as source of slf4j-api #6616

Merged
merged 2 commits into from
Dec 5, 2022

Conversation

david-leifker
Copy link
Collaborator

Remove lombok as source of slf4j-api, convert to compileOnly where possible

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@david-leifker david-leifker marked this pull request as draft December 2, 2022 18:40
@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Dec 2, 2022
@github-actions
Copy link

github-actions bot commented Dec 2, 2022

Unit Test Results (build & test)

621 tests  ±0   617 ✔️ ±0   15m 41s ⏱️ -6s
157 suites ±0       4 💤 ±0 
157 files   ±0       0 ±0 

Results for commit e1c6f0b. ± Comparison against base commit 4876fdd.

♻️ This comment has been updated with latest results.

@david-leifker david-leifker force-pushed the fix-logging branch 2 times, most recently from 9d102c9 to 2ef5aa3 Compare December 2, 2022 20:32
@david-leifker david-leifker marked this pull request as ready for review December 2, 2022 20:38
@github-actions
Copy link

github-actions bot commented Dec 2, 2022

Unit Test Results (metadata ingestion)

       8 files         8 suites   58m 23s ⏱️
   766 tests    764 ✔️ 2 💤 0
1 534 runs  1 529 ✔️ 5 💤 0

Results for commit e1c6f0b.

♻️ This comment has been updated with latest results.

@david-leifker david-leifker added platform PR-s that make changes to core parts of the platform and removed product PR or Issue related to the DataHub UI/UX labels Dec 2, 2022
@RyanHolstien
Copy link
Collaborator

Looks like tests are failing, probably need a testCompile dep on logback

}

task run(type: JavaExec, dependsOn: build) {
main = "org.eclipse.jetty.runner.Runner"
args = [war.archivePath]
classpath configurations.jetty8
classpath configurations.jetty9
Copy link
Collaborator

Choose a reason for hiding this comment

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

thank you

@@ -15,7 +15,7 @@ dependencies {
compile externalDependency.gson
compile externalDependency.kafkaClients
compile externalDependency.kafkaAvroSerde
compile externalDependency.lombok
compileOnly externalDependency.lombok
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you!

'log4jApi': 'org.apache.logging.log4j:log4j-api:2.19.0',
'logbackClassic': "ch.qos.logback:logback-classic:$logbackClassic",
'slf4jApi': "org.slf4j:slf4j-api:$slf4jVersion",
'log4jCore': "org.apache.logging.log4j:log4j-core:$log4jVersion",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This ecosystem is still a bit convoluted to me, but why do we need all of these? Shouldn't we ideally just use logback and SLF4J?

Also, what is the purpose of log4j12Api?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately some dependencies include the need for the older log4j api and the actual log4j impl still. It might be possible to update and/or replace those overtime however updating to latest works for now.

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Thank you, David!

@jjoyce0510 jjoyce0510 merged commit 2de9d3d into datahub-project:master Dec 5, 2022
@david-leifker
Copy link
Collaborator Author

  1. removal of htrace, removed shaded log4j impl, which caused an slf4 forwarder to point to log4j forwarder (infinite loop)
  2. applied project wide transitive exclusions to directly pick versions and impl (logback)
  3. some upstream dependencies depend on the log4j-core, not just log4j-api, requires log4j-impl to compile
  4. slf4j unlike log4j doesn’t tolerate alt impls (or complains) or different impl versions, especially major ones
  5. lombok includes an slf4j-api version and we are incorrectly setting compile instead of compileOnly
  6. most of our modules are libraries and therefore should only bring in slf4j-api and not include an impl (exceptions frontend, war, consumers, etc). this leads to some runtimeOnly dependencies for library tests

cccs-Dustin pushed a commit to CybercentreCanada/datahub that referenced this pull request Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform PR-s that make changes to core parts of the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants