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

[23.0] Allow duplicate labels in linter if outputs contain filters #15933

Conversation

bernt-matthias
Copy link
Contributor

duplicated labels may be OK if there are filters

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

node=output
)
else:
lint_ctx.error(f"Tool output [{name}] uses duplicated label '{label}'", node=output)
Copy link
Member

Choose a reason for hiding this comment

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

Both should probably just be warnings ? Functionality is not impacted, which I think is what errors should be about.

filter_node = output.find(".//filter")
if filter_node is not None:
lint_ctx.info(
f"Tool output [{name}] uses duplicated label '{label}', double check if filters imply disjoint cases",
Copy link
Member

Choose a reason for hiding this comment

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

What case triggered this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just had it here: galaxyproject/tools-iuc#5291 .. but found it acceptable in this case to use different labels. Can't remember a really good example.

Point is that we (probably?) need to allow for the possibility to have two outputs that are never outputed together (i.e. they use disjoint filters). Then it might OK to allow for the same label. For instance if from_work_dir needs to be different when a flag is set or not set.

Since it seemed pretty hard (or impossible) to check the filters if they are disjoint I thought that its best to just check if there is a filter.

Copy link
Member

Choose a reason for hiding this comment

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

Then it might OK to allow for the same label. For instance if from_work_dir needs to be different when a flag is set or not set.

I'd move the output to the right place or use the same output name, which is much friendlier for predicting what outputs will be generated. I think a warning is just the right level here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we make this a warning then the outcome (IUC wise) would be the same (galaxyproject/tools-iuc#5260), ie. the PR workflow would fail.

But, given your idea to skip linting for the push to master/main we could just raise the fail level to error for the merge.

Just tell me your preference (warning / info) and I will change it.

Copy link
Member

@mvdbeek mvdbeek May 9, 2023

Choose a reason for hiding this comment

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

warning is the right level IMO, galaxyproject/tools-iuc#5291 was improved by the new label and I think in many / all instances there are tweaks that would make the tool better as in either more userfriendly or more predictable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about this example @mvdbeek: galaxyproteomics/tools-galaxyp#721 ?

Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry, can you point out what I should look at there ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is an output dataset and an output collection which are mutually exclusive. They have the same name which I find acceptable in this case.

Copy link
Member

Choose a reason for hiding this comment

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

ok, so you're also saying it should be a warning ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, according to my intuition of the meaning of "warning".

@bernt-matthias
Copy link
Contributor Author

Ready from my side. Test failures seem unrelated to me.

@mvdbeek
Copy link
Member

mvdbeek commented Jul 24, 2023

Ready from my side. Test failures seem unrelated to me.

I still think warning is the right thing to do. what we do with warnings in the IUC is another question that has more than one answer.

@mvdbeek
Copy link
Member

mvdbeek commented Jul 24, 2023

Or let's rephrase it, it sure shouldn't be an error, if you can move the info to a warning we can merge this and refine later if necessary. I'd also target 23.0 at this point.

@bernt-matthias bernt-matthias force-pushed the topic/fix-output-label-linter branch from 111ba2e to c684e0b Compare July 25, 2023 11:11
@bernt-matthias bernt-matthias changed the base branch from release_22.05 to release_23.0 July 25, 2023 11:11
@bernt-matthias
Copy link
Contributor Author

OK. Rebased.

Guess for IUC we should disable the linter in the PR workflow runs for the merge to master?

@bernt-matthias bernt-matthias changed the title [22.05] fix linter: duplicated label check [23.0] fix linter: duplicated label check Jul 25, 2023
@mvdbeek mvdbeek merged commit 89b063f into galaxyproject:release_23.0 Jul 25, 2023
@bernt-matthias bernt-matthias deleted the topic/fix-output-label-linter branch July 27, 2023 18:38
@mvdbeek mvdbeek changed the title [23.0] fix linter: duplicated label check [23.0] Allow duplicate labels in linter if outputs contain filters Jul 29, 2023
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.

2 participants