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

Wrong logic in logs committime for username and token #1020

Open
1 of 3 tasks
mateusoliveira43 opened this issue Jun 9, 2023 · 0 comments
Open
1 of 3 tasks

Wrong logic in logs committime for username and token #1020

mateusoliveira43 opened this issue Jun 9, 2023 · 0 comments
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.

Comments

@mateusoliveira43
Copy link
Collaborator

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):.

  • Fix mistake
  • Write test to guarantee the problem is resolved

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

  • I agree to follow Pelorus's Code of Conduct
@mateusoliveira43 mateusoliveira43 added kind/bug Categorizes issue or PR as related to a bug. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant