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

ART-6684 Get latest nightly status #179

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

adobes1
Copy link
Contributor

@adobes1 adobes1 commented Apr 15, 2024

No description provided.

if status_code != 200:
logger.error('Server responded with status code %s', status_code)

return response.json()['tags'][0]['name']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail, especially when status_code is not 200.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed now

@@ -62,6 +62,43 @@ def get_failed_jobs(release_url, release_browser) -> str:
return payload


def get_latest_nightly_name(release_brower, release_stream) -> str:
url = f"https://{release_brower}.ocp.releases.ci.openshift.org/api/v1/releasestream/{release_stream}/tags"
Copy link
Contributor

@joepvd joepvd Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo. Maybe rename release_brower to arch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per Ximin's comment, I have removed the option to use architectures other than amd64


response = requests.get(url) # query API to get list of nightly tags
status_code = response.status_code
if status_code != 200:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable name is not needed, can call response.status_code directly here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, updated

@@ -307,6 +307,13 @@ def map_command_to_regex(so, plain_text, user_id):
"user_id": True,
"example": "Watch https://amd64.ocp.releases.ci.openshift.org/releasestream/4.13.0-0.ci/release/4.13.0-0.ci-2022-12-19-111818"
},
{
"regex": r"^Alert ?(if|when|on)? latest ? (?P<release_browser>[\w]+)? ?(?P<version>\d+.\d+) ?(stops being blue|fails|is rejected|is red|is accepted|is green)?$",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the regex could use some work. The ? are placed a bit randomly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have modified the pattern according to Ximin's suggestion, which simplified the regex quite a bit. Hopefully it is correct now

"flag": re.I,
"function": latest_nightly_color_status,
"user_id": True,
"example": "Alert when latest s390x 4.16 is accepted"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the pattern "watch latest 4.16", no need to match those extra words

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

if release_browser is None: # Assume amd64 if no arch given
release_browser = "amd64"

if release_browser == "amd64":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we usually only care about amd64, other arch like s390x don't have test jobs so won't need to wait.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I have updated it accordingly

@adobes1 adobes1 force-pushed the latest-nightly-status branch from abb2e93 to 1b30c6e Compare April 18, 2024 09:41
Copy link
Contributor

openshift-ci bot commented Apr 18, 2024

@adobes1: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security 1b30c6e link false /test security

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/test-infra repository. I understand the commands that are listed here.

@Ximinhan
Copy link
Contributor

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 22, 2024
@joepvd
Copy link
Contributor

joepvd commented Apr 22, 2024

/approve

Copy link
Contributor

openshift-ci bot commented Apr 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joepvd, Ximinhan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 22, 2024
@Ximinhan Ximinhan merged commit df5d9eb into openshift-eng:master Apr 29, 2024
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants