-
Notifications
You must be signed in to change notification settings - Fork 24
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
Define metadata.get_latest_konflux_build() #1271
base: main
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 |
@@ -224,7 +224,7 @@ async def get_latest_build( | |||
:param name: component name, e.g. 'ironic' | |||
:param group: e.g. 'openshift-4.18' | |||
:param outcome: 'success' | 'failure' | |||
:param assembly: non-standard assembly name, defaults to 'stream' if omitted | |||
:param assembly: assembly name, if omitted any assembly is matched |
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.
Hmm this behavior might do unexpected things, wondering why change this?
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.
That is required to mimic the behavior of metadata.get_latest_build. Always defaulting to stream
would make this impossible. I've also checked that we always pass in the assembly param when using the konflux_db function directly, so I don't see any risk in here.
:param completed_before: cut off timestamp for builds completion time | ||
:param extra_patterns: e.g. {'release': 'b45ea65'} will result in adding "AND release LIKE '%b45ea65%'" to the query | ||
""" | ||
|
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'm looking at the code for get_latest_brew_build
art-tools/doozer/doozerlib/metadata.py
Line 412 in de3d8b7
def get_latest_brew_build(self, default: Optional[Any] = -1, assembly: Optional[str] = None, extra_pattern: str = '*', |
We have params that are not used in this func, like component_name. Now that it's irrelevant, maybe we have a check that fails if the component name is different from what we determine
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 for the el_target
, there's a bunch of logic we have to default to something sane. want to suggest we have it here in some way
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.
component_name
is used by get_latest_brew_build
to get the package ID, and this is later used to fetch the builds:
builds = koji_api.listBuilds(packageID=package_id,
Overriding it to match something different from the metadata component name could be used in particular cases (e.g. olm bundles?) although I haven't found any occurrences of this. Either way, I feel this and other refactoring changes should be postponed as things are getting messy already and I want to limit changes to what's strictly needed for this task
Use it with scan-sources-konflux
e862a8b
to
0791e26
Compare
@locriandev: The following test failed, say
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. |
Follows:
Implement the new
metadata.get_latest_konflux_build()
function and start using it in scan-sources-konflux.Requires doozer to be called with the
--build-system=konflux
option.Test build: https://art-jenkins.apps.prod-stable-spoke1-dc-iad2.itup.redhat.com/job/aos-cd-builds/job/build%252Focp4-scan-konflux/8122/console