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

Define metadata.get_latest_konflux_build() #1271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

locriandev
Copy link
Contributor

@locriandev locriandev commented Jan 15, 2025

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

@locriandev locriandev requested review from thegreyd and vfreex January 15, 2025 11:10
Copy link
Contributor

openshift-ci bot commented Jan 15, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from locriandev. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -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
Copy link
Contributor

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?

Copy link
Contributor Author

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
"""

Copy link
Contributor

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

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

Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

openshift-ci bot commented Jan 16, 2025

@locriandev: 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 0791e26 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-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants