Logging is now set up in depcheck.
Details
- Reviewers
kparal tflink jdulaney - Maniphest Tasks
- T336: depcheck: include dependency problems details on stdout
- Commits
- rDEPCK3ba8ad74c8d5: Enable logging in Depcheck
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
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 |
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 |
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 |
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.
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 |
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? |
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.
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 |
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 |
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
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