-
Notifications
You must be signed in to change notification settings - Fork 86
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
[openshift-tekton-resources] early-exit #4656
base: master
Are you sure you want to change the base?
[openshift-tekton-resources] early-exit #4656
Conversation
|
||
|
||
def early_exit_desired_state(*args: Any, **kwargs: Any) -> dict[str, Any]: | ||
return fetch_tkn_providers(saas_file_name=None) |
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.
the order of saas files in dict values may affect equal check in different run.
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.
can you explain more?
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.
fetch_tkn_providers(saas_file_name=None)
returns a dict, key is provider name, value is a list of saas files
saas_files = fetch_saas_files(saas_file_name)
the order of saas files returned from gql maybe different, lead to desired state not equal to last one even if no saas file changed, may need to change it to dict[str, set[str]]
to be stable.
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.
have we seen this behavior in the past?
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.
yes, changed many early exit state from list to set/dict for diff issues
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.
dict keys order doesn't matter, just list values.
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.
wdyt 6fad5ed?
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.
since here we are not using typed query, saas_files
is added to gql response dynamicly, it should be safe to use set
here, unless we want to keep it ordered for other purpose.
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.
either
for provider_name in tkn_providers:
tkn_providers[provider_name]["saas_files"].sort(key=lambda sf: sf["name"])
or
if "saas_files" not in tkn_providers[provider_name]:
tkn_providers[provider_name]["saas_files"] = set()
tkn_providers[provider_name]["saas_files"].add(sf)
no need to sorted
for dict keys.
what's a standard promotion in this case? |
part of https://issues.redhat.com/browse/APPSRE-10864
by using early exit we reduce run time of this integration in case the MR does not affect tekton resources.
for example, a standard promotion.