-
Notifications
You must be signed in to change notification settings - Fork 27
Add sub command for product increment approval #222
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
base: master
Are you sure you want to change the base?
Conversation
I added the "not-ready" label because this needs os-autoinst/openQA#6592. I tested this locally against my openQA instance and IBS, e.g. via:
I didn't test the approval for real but it is simply using the function that the bot also uses for other approvals so it most likely works. |
623738e
to
4a523df
Compare
required=False, | ||
type=str, | ||
default="sle", | ||
help="The DISTRI parameter of relevant scheuled products on openQA", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/scheuled/scheduled/
required=False, | ||
type=str, | ||
default="15.99", | ||
help="The VERSION parameter of relevant scheuled products on openQA", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here and in next arguments
relevant_request = request | ||
break | ||
else: | ||
log.info("Checking specified request %i", args.request_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be debug as it only states what the process is doing, not any result like the other info calls you introduced
+ "/".join(relevant_states) | ||
) | ||
return 0 | ||
log.info("Found request %s", relevant_request.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO debug, not info
log.info("Found request %s", relevant_request.id) | ||
|
||
# query openQA for job results | ||
log.info("Checking openQA job results") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
return 0 | ||
log.info("Found request %s", relevant_request.id) | ||
|
||
# query openQA for job results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant as the log message already states that
res = self.client.get_scheduled_product_stats(params) | ||
log.debug("Job statistics:\n%s", pformat(res)) | ||
|
||
# return earily if there are no jobs or jobs are still pending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
map(lambda id: f" - {openqa_url}/tests/{id}", info["job_ids"]) | ||
) | ||
reasons_to_disapprove.append( | ||
f"The following openQA jobs ened up with result '{result}':\n{job_list}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo "ened"
"--obs-project", | ||
required=False, | ||
type=str, | ||
default="SUSE:SLFO:Products:SLES:15.99:TEST", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found it a bit weird that the parameter is implies the build.opesuse.org but the default project cant be found there. I guess just --project
would do better fit. wdyt?
cmdincrementapprove.add_argument( | ||
"--accepted", | ||
action="store_true", | ||
help="Consider accepted requests/reviews as well", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not clear to me what this does as parameter. I guess I am missing a lot more but this is the first place I would look to find out. How does it fit in the increment-approve
or how is different without?
def test_not_ok_openqa_jobs(caplog, fake_not_ok_jobs, monkeypatch): | ||
run_approver(caplog, monkeypatch) | ||
last_message = [x[-1] for x in caplog.record_tuples][-1] | ||
assert "The following openQA jobs ened up with result 'failed'" in last_message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: s/ened/end/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good but I have a small observation. tests/test_incrementapprover.py has some tests which I would call them unit tests. Although I found the descriptions more general. For example test_not_ok_openqa_jobs
doesnt show what should I expect from this test in regard of the behaviour but only the focus on the test, which is failing jobs. Do you think you could provide some alternatives which explain what are the expectation from IncrementApprover?
Related ticket: https://progress.opensuse.org/issues/184690