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

relax major version match regex in find_related_easyconfigs using for --review-pr #4385

Merged
merged 1 commit into from
Dec 26, 2023

Conversation

migueldiascosta
Copy link
Member

motivated by discussion on slack where eb --review-pr 19271 is showing only a very old related easyconfig, because it's the only one that has a .patch (as in major.minor.patch) version component

@migueldiascosta migueldiascosta marked this pull request as draft November 21, 2023 10:38
Copy link
Contributor

@smoors smoors left a comment

Choose a reason for hiding this comment

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

for maximum flexibility it would be nice if we could somehow tell EB: "please don't filter any versions, i will do the filtering with --review-pr-filter".

@@ -472,7 +472,7 @@ def find_related_easyconfigs(path, ec):
if len(parsed_version) >= 2:
version_patterns.append(r'%s\.%s\.\w+' % tuple(parsed_version[:2])) # major/minor version match
if parsed_version != parsed_version[0]:
version_patterns.append(r'%s\.[\d-]+\.\w+' % parsed_version[0]) # major version match
version_patterns.append(r'%s\.[\d-]+(\.\w+)*' % parsed_version[0]) # major version match
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just like this:

Suggested change
version_patterns.append(r'%s\.[\d-]+(\.\w+)*' % parsed_version[0]) # major version match
version_patterns.append(r'%s\.\w+' % parsed_version[0]) # major version match

Copy link
Member Author

Choose a reason for hiding this comment

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

@smoors this makes test_find_related_easyconfigs fail, at least as it is now, because it also matches easyconfigs with different toolchains and versionsuffixes (note that these version_patterns are only part of the actual regex, the toolchain and versionsuffixes patterns are inserted in the next block)

to be clear, although my suggestion doesn't make the tests fail, I'm also not sure if it won't change the behaviour in some unintended way, which is way I marked the PR as draft :)

@migueldiascosta
Copy link
Member Author

for maximum flexibility it would be nice if we could somehow tell EB: "please don't filter any versions, i will do the filtering with --review-pr-filter".

I suppose we can do that, it should be just a matter of passing filter_ecs when calling find_related_easyconfigs from review_pr and when it's not None use only that to filter the potential_paths

@migueldiascosta
Copy link
Member Author

for maximum flexibility it would be nice if we could somehow tell EB: "please don't filter any versions, i will do the filtering with --review-pr-filter".

I suppose we can do that, it should be just a matter of passing filter_ecs when calling find_related_easyconfigs from review_pr and when it's not None use only that to filter the potential_paths

@smoors indeed, it's trivial to do, but note that when a PR includes many easyconfigs, we would be replacing eb's filtering per easyconfig with a filter that is the same for all easyconfigs in the PR, it may end up being counterproductive...

@smoors
Copy link
Contributor

smoors commented Nov 22, 2023

@smoors indeed, it's trivial to do, but note that when a PR includes many easyconfigs, we would be replacing eb's filtering per easyconfig with a filter that is the same for all easyconfigs in the PR, it may end up being counterproductive...

indeed, my idea was to make this optional, as you don't always want this.

to avoid having to define yet another cmd line option for this, maybe we can do something like --review-pr-filter=full:<regex> to indicate that the user wants full control over the filtering?

this is just an idea of course, doesn't need to be in this PR

@boegel boegel changed the title relax major version match regex in find_related_easyconfigs relax major version match regex in find_related_easyconfigs Nov 22, 2023
@boegel boegel added the bug fix label Nov 22, 2023
@boegel boegel added this to the next release (4.9.0?) milestone Nov 22, 2023
@boegel
Copy link
Member

boegel commented Dec 6, 2023

@migueldiascosta Any reason why this is marked as draft?

@migueldiascosta migueldiascosta marked this pull request as ready for review December 7, 2023 01:59
@boegel boegel added the change label Dec 26, 2023
@boegel boegel changed the title relax major version match regex in find_related_easyconfigs relax major version match regex in find_related_easyconfigs using for --review-pr Dec 26, 2023
@boegel boegel merged commit 05d6af2 into easybuilders:develop Dec 26, 2023
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants