Wrong logic in logs committime for username and token #1020
Labels
good first issue
Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
OpenShift version
Not related to OpenShift
Problem description
In https://github.com/dora-metrics/pelorus/blob/master/exporters/committime/app.py#L187 the logic is wrong, it should be
if not (self.username or self.token):
.In https://github.com/dora-metrics/pelorus/blob/master/exporters/committime/app.py#L191 the logic is correct (but because of previous mistake, it does not work), but can be simplified to
if not (self.username and self.token):
.Steps to reproduce
Set token for commitime and run it. Ex.:
export TOKEN=fake_token python exporters/committime/app.py
Check that the logs contain
WARNING No API_USER and no TOKEN given. This is okay for public repositories only.
Current behavior
Logs give wrong information about username and token.
Expected behavior
Logs should give the right information about username and token (for both scenarios).
Code of Conduct
The text was updated successfully, but these errors were encountered: