-
Notifications
You must be signed in to change notification settings - Fork 25
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
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 |
@thegreyd: 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. |
@@ -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, |
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.
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')) |
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 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, |
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.
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?
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.
ah, just that I wrote this code when that func didn't exist :D
I'm good to use that 👍
No description provided.