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

Add debug information to cache results #1015

Merged

Conversation

frankdekker
Copy link
Contributor

@frankdekker frankdekker commented Jul 2, 2023

Type: feature
Issue: -
Breaking change: no

Addendum to #1011

I found the lack information of the cache difficult to debug. There's no information presented regarding if the cache is used, which it is read from, or if the cache is still valid. I added a few cli flags to show more information:

Feature

  • Added CLI command flags: -v, -vv, -vvv. Which increments the verbosity of the output. Default is 'Normal'.
  • If no -v, -vv, or -vvv is specified, the behaviour is currently as it is now and nothing is printed.

Changes

  • Added OutputInterface based on Symfony's Console package. Should be drop-in replacement if at some point Symfony Console can/will be used.
  • Added NullOutput (for tests) and StreamOutput classes to be able to write output with verbosity level.
  • Added Debug output to several cache classes.
  • Added Verbosity levels: Quiet, Normal (default), Verbose, VeryVerbose and Debug. Currently only VeryVerbose and Debug is being written to.
  • Updated the documentation with the new cli flags.
  • Added coverage for my changes.

Note, this branch contains the changes from PR 1011. I don't seem to be able to target that PR in this PR.

@frankdekker frankdekker marked this pull request as ready for review July 2, 2023 10:07
@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2023

Codecov Report

Patch coverage: 92.20% and project coverage change: +0.15 🎉

Comparison is base (9d9e29f) 89.10% compared to head (91702eb) 89.26%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1015      +/-   ##
============================================
+ Coverage     89.10%   89.26%   +0.15%     
- Complexity     1160     1179      +19     
============================================
  Files           107      109       +2     
  Lines          2956     3027      +71     
============================================
+ Hits           2634     2702      +68     
- Misses          322      325       +3     
Impacted Files Coverage Δ
src/main/php/PHPMD/TextUI/CommandLineOptions.php 67.84% <75.00%> (+0.35%) ⬆️
.../main/php/PHPMD/Cache/ResultCacheEngineFactory.php 88.46% <80.00%> (-11.54%) ⬇️
src/main/php/PHPMD/Cache/ResultCacheFileFilter.php 100.00% <100.00%> (ø)
src/main/php/PHPMD/Cache/ResultCacheUpdater.php 100.00% <100.00%> (ø)
src/main/php/PHPMD/Console/Output.php 100.00% <100.00%> (ø)
src/main/php/PHPMD/Console/StreamOutput.php 100.00% <100.00%> (ø)
src/main/php/PHPMD/TextUI/Command.php 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

kylekatarnls
kylekatarnls previously approved these changes Jul 2, 2023
@kylekatarnls kylekatarnls dismissed their stale review July 2, 2023 12:59

The merge-base changed after approval.

Copy link
Member

@AJenbo AJenbo left a comment

Choose a reason for hiding this comment

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

Nice!

@AJenbo AJenbo merged commit a8d6cc3 into phpmd:master Jul 25, 2023
26 checks passed
@frankdekker frankdekker deleted the Add-debug-information-to-cache-results branch August 17, 2023 15:35
@ravage84 ravage84 added this to the 2.x (unspecific) milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants