-
Notifications
You must be signed in to change notification settings - Fork 152
Add script to remove uninstallable revisions from lock files #838
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
base: master
Are you sure you want to change the base?
Add script to remove uninstallable revisions from lock files #838
Conversation
bernt-matthias
left a comment
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 would suggest to make a (manual?) test run. But since after the fix step there is another lint step before the actual upate not much could got wrong... I guess :)
scripts/fix-uninstallable.py
Outdated
| if nxt: | ||
| if nxt in tool["revisions"]: | ||
| print(f"remove {cur} in favor of {nxt} {name} {owner}") | ||
| remove.append(cur) |
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 script will remove an uninstallable revision from the list if the next installable one is already in it.
|
Hi guys, I lost a but track here. I'm happy to merge it and keep the script here, but please feel also free to create a run-PR of this script so we see the impact and to clean the repo. Thanks |
|
@bernt-matthias I think this is close to perfect, I played with it and opened bernt-matthias#1 to fix the process of adding the next installable revision (and there is also some polish if you want), but apart from that this seems to work great. |
Hi @martenson .. Also have some improvements nearly ready. Will merge with your efforts and push soon. |
a938e34 to
d516d74
Compare
|
@bernt-matthias looks awesome, I'll test some more tomorrow. I think renaming of the script could improve its appeal: |
|
Two more comments:
TODO
Currently running this on this repos. Will need a bit. |
Well that seems like a toolshed bug :/
This tool seems pretty broken, the xml is likely invalid but maybe it was not before? I think in all these cases we shouldn't modify the lockfile. Maybe we could create an issue for each and try to track down the problems, if there are any takers. |
|
for the latest version I've also encountered this: the entry looks like this: so in my understanding this should just remove the |
|
So far, for me, deleting the temporary directory for this repo solved the problem (so maybe temporary problem with the remote?). Wondering if we should include stderr, stdout here. |
|
the specific repo seems broken :/ |
|
Works for me |
|
yeah, case-sensitive vs case-insensitive filesystem :/ |
65c3af4 to
384093b
Compare
|
To get an idea I added the changes to the Do not merge yet. Have another idea... |
|
I propose showing the changes after run in a separate PR, it makes this PR hard to approach to everyone else |
|
My idea/suggestion is the following: we could have an additional much simpler step that just determines the installed revisions of a given Galaxy instance. Then we just remove everything from the lock files that is not installed. Should be super simple to do. Should achieve similar results, but with much less resources: This script downloads GBs from the TS and just takes a lot of time -- at least for the first run - I guess subsequent runs will be much faster. |
|
@bernt-matthias I understand the urge to optimize but, as you said, to me this is basically a one-off cloning spree triggered only during the first run. Subsequent runs will have one repo to clone at most. |
Sure, but my main motivation would be that its much simpler, i.e. makes less assumptions on things that are "not well documented" and understood by only a few people. |
|
I think that is a fair take. It likely does not cover the situation where you actually want to update the revision of the repo that did not bump tool version and maybe other corner cases, but likely does majority of the cleanup we want. |
13c4779 to
e26d2f2
Compare
|
Isn't it possible to get the data from |
Which data? |
repository metadata (all tool info, including versions) For example, this has a lot of information, including the valid_tools that might be useful for our case: |
|
I see: the tool version could be extracted from the |
Why do we need all of them? |
|
Could be impossible to |
Do we need this? |
- fix determining next - load tools recursively - silence tool loading errors - also check installable revisions for equal versions and warn
e26d2f2 to
fdd2248
Compare
Tested this manually here: https://github.com/Helmholtz-UFZ/ufz-galaxy-tools
I also have code for parsing the tool versions from all the tool revisons (
get_all_versions) tested this. In all cases it was unbumped tool versions.