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

get_latest_build enhancements for ART DB #1058

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thegreyd
Copy link
Contributor

No description provided.

Copy link
Contributor

openshift-ci bot commented Oct 17, 2024

[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 thegreyd. For more information see the Kubernetes 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

@thegreyd thegreyd changed the title Implement list builds and get_latest_build methods for ART DB get_latest_build enhancements for ART DB Oct 17, 2024
Copy link
Contributor

openshift-ci bot commented Oct 17, 2024

@thegreyd: 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 bf11fff 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.

@@ -183,6 +184,57 @@ def branch_major_minor(self) -> str:
split = self.branch().split('-') # e.g. ['rhaos', '4.8', 'rhel', '8']
return split[1]

def get_latest_build_art_db(self,
Copy link
Contributor

Choose a reason for hiding this comment

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

ART db is currently ambiguous, as we still have MariaDB in place. Maybe this can be named get_latest_konflux_build or the like?

if not query_options:
query_options = {}

order_by_opt = query_options.get('order', ('start_time', 'desc'))
Copy link
Contributor

Choose a reason for hiding this comment

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

I fear this free approach could lead to error. I would rather enforce setting up dedicated params that restrict the user's freedom to make mistakes. An example is how search_builds_by_fields() does it

artifact_type, completed_before, {'limit': 1, 'order': ('start_time', 'desc')})
return builds[0] if builds else None

async def list_builds(self,
Copy link
Contributor

Choose a reason for hiding this comment

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

Overall, it looks like all this function can do can already by done by search_builds_by_fields(), which has a simpler API (hence more flexibility) and enforces correctness (for example, when ordering results). Is there some capability it lacks that I did not notice? Or, what are you trying to achieve that this function can't already do?

Copy link
Contributor Author

@thegreyd thegreyd Nov 12, 2024

Choose a reason for hiding this comment

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

ah, just that I wrote this code when that func didn't exist :D
I'm good to use that 👍

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