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

[22.01] Fix macro parsing #13373

Merged
merged 7 commits into from
Feb 16, 2022

Conversation

bernt-matthias
Copy link
Contributor

fixes #13277

follow up on #13186 and #12978

The mentioned PRs tried to store the path to macro files for xml nodes loaded from imported macros (to get a more meaningful lint error message). Unfortunately lxml does this by adding a xml:base attribute to the nodes which has all sorts of side effects:

  • xsd linting stumbles over these forbidden attributes
  • for some reason just storing this attribute increases the time needed for parsing the tools dramatically (for OpenMS which heavily use macros from ~16s to 50s)

The primary change of this PR is to revert storing this additional information.

The subsequent commits aim at speeding up parsing a bit more: So far imported macros were added to the macros node just to be removed again at the end. Now they are directly stored in lists.

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

so far imported macro element were inserted into the macros element
of the tool xml .. just to be removed again in the end (except for
template macros)

so it seems cleaner (and maybe a bit faster) to store the macros
in lists (kept in a dict separating xml, token, and template macros)
@bernt-matthias bernt-matthias marked this pull request as draft February 15, 2022 08:58
@mvdbeek mvdbeek modified the milestones: 22.05, 22.01 Feb 15, 2022
@bernt-matthias
Copy link
Contributor Author

I guess we should test this against IUC?

I'm not 100% satisfied how the code looks like (in comparison with the 21.09 state) .. but maybe this can be "fixed" later? What do you think?

Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
We only create XmlMacroDef later on.
@mvdbeek
Copy link
Member

mvdbeek commented Feb 16, 2022

Tested in galaxyproject/tools-iuc#4367 (comment) and looks good.

Copy link
Member

@mvdbeek mvdbeek left a comment

Choose a reason for hiding this comment

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

This looks good and fixes the visualization macro parsing, so let's get it in ?

@mvdbeek
Copy link
Member

mvdbeek commented Feb 16, 2022

I'm gonna take the liberty and move it out of draft, hope that's ok @bernt-matthias!

@mvdbeek mvdbeek marked this pull request as ready for review February 16, 2022 19:11
@mvdbeek mvdbeek merged commit c14eca9 into galaxyproject:release_22.01 Feb 16, 2022
@github-actions
Copy link

This PR was merged without a "kind/" label, please correct.

@bernt-matthias bernt-matthias deleted the fix/macro_parsing branch March 14, 2022 15:05
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