-
Notifications
You must be signed in to change notification settings - Fork 94
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
Stop searching platform groups after first match. #5398
Stop searching platform groups after first match. #5398
Conversation
Kicking tests |
[[aleph, bet, alpha, beta]] | ||
|
||
[platform groups] | ||
[[hebrew_letters]] | ||
platforms = alpha, beta | ||
[[[selection]]] | ||
method = definition order | ||
[[aleph]] | ||
platforms = alpha |
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.
This aleph
platform group is a little confusing to me
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.
Without the break the loop runs for .*_letters
, aleph
and hebrew_letters
in that order.
When it runs over .*_letters
it matches to hebrew_letters
(the platform_name
we inputted into the function. It then sets platform_name = aleph
from .*letters
list of platforms.
If we put the break in the iteration then stops. But without it the loop runs for aleph
and sets platform_name=alpha
.
Finally on the third iteration platform_name = alpha
which does not match hebrew letters
(this is OK behaviour).
The break is only needed if a platform_name set by an earlier platform group matches a later platform group. Otherwise it's just inefficient, because it keeps searching.
(The original test is checking that despite the name hebrew_letters
matches .*_letters
and not hebrew_letters
)
Ah, wrong base branch. Need to rebase onto 8.1.x |
d3ce313
to
b5e851a
Compare
b5e851a
to
18d1e4b
Compare
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 have suggested a comment in light of your explanation, to clarify the test
Can you add a description of the bug to the PR body?
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
[[aleph]] | ||
# Group with same name as platform to try and | ||
# trip up the platform selection logic after it | ||
# has processed [[.*_letters]] below |
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. That's a good idea, this test is wierd and non obvious
Feel free to add the following if you like.
[[aleph]] | |
# Group with same name as platform to try and | |
# trip up the platform selection logic after it | |
# has processed [[.*_letters]] below | |
[[aleph]] | |
# Group with same name as platform to try and | |
# trip up the platform selection logic after it | |
# has processed [[.*_letters]] below | |
# https://github.com/cylc/cylc-flow/pull/5398#discussion_r1130692633 |
or
[[aleph]] | |
# Group with same name as platform to try and | |
# trip up the platform selection logic after it | |
# has processed [[.*_letters]] below | |
[[aleph]] | |
# Group with same name as platform to try and | |
# trip up the platform selection logic after it | |
# has processed [[.*_letters]] below | |
# https://github.com/cylc/cylc-flow/pull/5398 |
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.
👍
Platform selection from a platform group was missing a
break
in thefor
loop, leading to the possibility of the wrong platform being selected.Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.