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

composer meta analyzer: add DEBUG logging #4546

Merged

Conversation

valentijnscholten
Copy link
Contributor

Add some DEBUG log lines to help debugging (possible/future) problems.

@valentijnscholten valentijnscholten force-pushed the composer-meta-logging branch 2 times, most recently from e40789b to c089080 Compare January 12, 2025 14:56
Copy link

codacy-production bot commented Jan 12, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.01% (target: -1.00%) 58.82% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (bcd2651) 23013 18284 79.45%
Head commit (e74ea99) 23032 (+19) 18301 (+17) 79.46% (+0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4546) 17 10 58.82%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@valentijnscholten
Copy link
Contributor Author

As this was a relatively new / last minute feature some extra logging can be helpful. In my test instance with real world data I am not seeing the log lines I was expecting, so I am not if it's correctly using the V2 API now.

@nscuro
Copy link
Member

nscuro commented Jan 13, 2025

Some of the new log statements do not provide any context (i.e. repository, package URL). RepositoryMetaAnalyzerTask does currently not set any MDC variables, so logs would not be all-too-helpful I fear.

Two options:

  • Go the way of least resistance and add more context to the individual lines via .formatted
  • Add MDC variables in RepositoryMetaAnalyzerTask

The latter would also greatly help with driving #3234 forward.

@valentijnscholten
Copy link
Contributor Author

Hmm was expecting this, but hoped you would forget :-)

In practice I usually just add the Thread-Id to the log pattern and filter on that. But yeah, more context is helpful. I don't have time to do the MDC now, maybe in the other Composer related draft PR later on.

@nscuro nscuro added the enhancement New feature or request label Jan 13, 2025
@nscuro nscuro added this to the 4.13 milestone Jan 13, 2025
@nscuro nscuro merged commit d6e70f6 into DependencyTrack:master Jan 13, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants