-
Notifications
You must be signed in to change notification settings - Fork 30
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
OCPERT-44 Check kernel tag early-kernel-stop-ship in cmd change-advisory-status #441
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@rioliu-rh The oar-check job failed by ModuleNotFoundError: No module named 'jq', how can we install jq in prow python env? |
Line 29 in 977f2f8
|
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.
Hi @ming1013,
Just minor structure comments.
Also wouldn't be better to structure the code more. I mean extract some the 3 parts described in the jira to functions to be easily testable or separate the parts by adding some comments?
@ming1013: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
# check kernel tag before change advisories' status | ||
ads = am.get_advisories() | ||
for ad in ads: | ||
if Advisory(errata_id=ad.errata_id, impetus=ad.impetus).check_kernel_tag(): |
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.
ad is Advisory object, don't have to re-init, ref: https://github.com/openshift/release-tests/blob/master/oar/core/advisory.py#L39
#Use koji api to query tags of this build | ||
session = koji.ClientSession("https://brewhub.engineering.redhat.com/brewhub") | ||
tags = session.listTags(build=rhos_meta_data) | ||
logger.info(f"Tags of this build is str{tags}") |
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.
logger.info(f"Tags of this build is str{tags}") | |
logger.info(f"Tags of this build is {tags}") |
logger.info(f"Tags of this build is str{tags}") | ||
for t in tags: | ||
if t["name"] == 'early-kernel-stop-ship': | ||
logger.info("Tag of early-kernel-stop-ship is detected") |
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.
logger.info("Tag of early-kernel-stop-ship is detected") | |
logger.info("kernel tag early-kernel-stop-ship is detected") |
""" | ||
#Check if impetus is image or not, if it's not image then skip this function. | ||
if self.impetus != AD_IMPETUS_IMAGE: | ||
logger.info("check kernel tag function skipped, only image advisory need to check.") |
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.
logger.info("check kernel tag function skipped, only image advisory need to check.") | |
logger.info("{self.impetus} advisory does not have RHCOS build, skip checking kernel tag") |
Check kernel tag from advisory build image. | ||
|
||
Returns: | ||
bool: True if kernel is tagged with early-kernel-stop-ship. |
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.
bool: True if kernel is tagged with early-kernel-stop-ship. | |
bool: True if kernel build is tagged with early-kernel-stop-ship. |
rhos_nvr_url = re.sub(r"-([\d.]+)-(\d+)$", r"/\1/\2", rhos_nvr) | ||
rhos_nvr_url_full = "https://download.eng.bos.redhat.com/brewroot/packages/"+rhos_nvr_url+"/metadata.json" | ||
rhos_meta_data_full = self._get(rhos_nvr_url_full) | ||
rhos_meta_data = [ |
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.
rhos_meta_data = [ | |
kernel_build = [ |
When kernel tag early-kernel-stop-ship is found, stop moving advisory status.