T336: Enable logging in depcheck
ClosedPublic

Authored by jskladan on Sep 29 2014, 8:24 PM.

Details

Summary

Logging is now set up in depcheck.

Test Plan

Run depcheck, ie:

runtask -i f20-updates-testing-pending -t koji_tag -a x86_64 -j x86_64/31563 depcheck.yml

Diff Detail

Repository
rDEPCK task-depcheck
Lint
Lint Skipped
Unit
Unit Tests Skipped
jdulaney retitled this revision from to Quick fix for T336.Sep 29 2014, 8:24 PM
jdulaney updated this object.
jdulaney edited the test plan for this revision. (Show Details)
jdulaney added reviewers: tflink, kparal.
jdulaney set the repository for this revision to rDEPCK task-depcheck.
jdulaney added a project: task-depcheck.
jdulaney updated this revision to Diff 670.Oct 6 2014, 5:14 PM
jdulaney retitled this revision from Quick fix for T336 to T336: Enable logging in depcheck.
jdulaney updated this object.
jdulaney edited the test plan for this revision. (Show Details)
tflink requested changes to this revision.Oct 6 2014, 6:39 PM

In addition to the code duplication and multiple output issues - please restore the permissions of the files to what they were. I don't see a reason to change them around right now

depcheck/__init__.py
66

this is duplicated in squash_results - choose one and import it in the other place

85

why is this logging setup duplicated?

140

this doesn't need to be done in all cases, make sure that logging isn't re-initialized in the case where it is called from libtaskotron

depcheck/depcheck.py
63

same comment as above - why is this duplicated?

153

this dumps the output for every rpm file, making the output crazy long. this only needs to be output once

depcheck/squash_results.py
122

whitespace needs to be removed

123

why is this method in squash_results? It isn't even called from within this file

This revision now requires changes to proceed.Oct 6 2014, 6:39 PM
jdulaney added inline comments.Oct 7 2014, 8:14 PM
depcheck/__init__.py
66

That was an oversight on my part; deleting here.

140

This is executed outside of taskotron

depcheck/squash_results.py
123

Yes, but it calls several methods in squash_results and is called from within two other modules. It's as logical a place as any to put it.

tflink added inline comments.Oct 7 2014, 8:21 PM
depcheck/__init__.py
140

True, but that doesn't mean that it should be run every time, regardless of entry point. Please make it conditional so that it's only executed when the entry point is from the CLI and logging hasn't already been initialized

jdulaney updated this revision to Diff 678.Oct 8 2014, 12:36 AM

Fixed file perms

tflink requested changes to this revision.Oct 8 2014, 12:46 AM

The file permissions are still changed but that's a quick fix.

There are still a bunch of print statements that should be logging statements and I don't see any early, generic logging initialization for the cli use case (not running in taskotron).

depcheck/__init__.py
39

these imports aren't being used here

depcheck/depcheck.py
63

I'd rather see this as a module level logger instead of an class logger

depcheck/squash_results.py
131

this needs a checkname='depcheck' to get rid of all the $CHECKNAME in the TAP output

This revision now requires changes to proceed.Oct 8 2014, 12:46 AM
jdulaney updated this revision to Diff 680.Oct 8 2014, 2:16 AM

Still need to do logging when entering via CLI, but there's other work needed there, as well. Priority right now is running via taskotron.

jskladan requested changes to this revision.Oct 8 2014, 7:25 AM
jskladan added inline comments.
depcheck/__init__.py
37

Unused import

depcheck/depcheck.py
31

Unused import

40

I really do not quite understand why shoud report_format be part of the Depcheck class, especially since it never gets used (AFAIK). Is there any reason, that I missed, to have it there?

depcheck/metadata.py
33

unused import

depcheck/squash_results.py
3

unused import

This revision now requires changes to proceed.Oct 8 2014, 7:25 AM
jdulaney updated this revision to Diff 681.Oct 8 2014, 8:10 AM

Looking at the diff, the code now looks fine (see the inline comments though). I'll try and run it from cmdline & via taskotron, and will then decide on accept/request changes based on the actual performance.

depcheck/depcheck.py
34

Noticed one more unused import. Please check all the source codes for unnecessary imports.

depcheck/metadata.py
71

The newlines were probably useful in printouts, but I'm not sure it it necessary for the logging purposes. Any thoughts @tflink?

jskladan commandeered this revision.Oct 8 2014, 1:12 PM
jskladan edited reviewers, added: jdulaney; removed: jskladan.
jskladan updated this revision to Diff 682.Oct 8 2014, 1:28 PM
  • minor logging fixes

The diff as is now is tested & working with runtask.py from the current state of develop branch of libtaskotron.

In case you are wondering, the lines #22 and #23 in run_depcheck.py make the depcheck log at the same level as the libtaskotron does. This means that (e.g.) when using --debug argument for runtask.py you see not only the INFO level logs, but also the DEBUG logs.

tflink requested changes to this revision.Oct 8 2014, 2:13 PM

It's getting close! Just some minor concerns about logging levels and imports for the non-taskotron use case

depcheck/__init__.py
37

tempfile and platform are still used in the code (creating a tempdir in cli mode and arch autodetect, respectively). either the code needs to be removed or the imports need to be restored

depcheck/metadata.py
71

I think this should be at least a warning

depcheck/squash_results.py
65–66

this is not debug, it's an error and the comment should go away

94

this shouldn't be a debug message - warning at the very least

This revision now requires changes to proceed.Oct 8 2014, 2:13 PM
jskladan updated this revision to Diff 683.Oct 8 2014, 2:18 PM
  • Fixed according to review
jskladan updated this revision to Diff 684.Oct 8 2014, 2:33 PM
  • Fixed the 'no results' handling
tflink accepted this revision.Oct 8 2014, 2:42 PM

Other than a tiny indentation nit which can be fixed when pushed, looks good to me as long as the "no output" case has been tested (and I think it has).

depcheck/__init__.py
122

indentation doesn't match

This revision is now accepted and ready to land.Oct 8 2014, 2:42 PM
jskladan updated this revision to Diff 685.Oct 8 2014, 2:44 PM
  • Nitpicky nitpick - fixed indentation for a commented line
tflink accepted this revision.Oct 8 2014, 2:47 PM

Looks good to me, tested the "no results" case by hacking an empty results dict into the code and it works properly. Get this pushed and we can update dev

jskladan closed this revision.Oct 8 2014, 3:07 PM
jskladan updated this revision to Diff 686.

Closed by commit rDEPCK3ba8ad74c8d5 (authored by @jskladan).