-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
g.extension: fix getting addons path if input JSON file doesn't exist #2717
g.extension: fix getting addons path if input JSON file doesn't exist #2717
Conversation
@tmszi Perhaps you could test with removing the exclusion line for Mac tests:
The test was almost always failing, so I excluded it. |
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'm sorry, I don't know why the information is needed, why it is okay when it is not there, or why it can't be obtained in another way.
However, as far as fixing the failure in #2706, this PR does the job.
I'm not sure about the exception type and the wording of the message.
I understand your complaint and it is relevant, the quality of my PR depends on how much time I can invest in it. Explanation is in the function doc string: grass/scripts/g.extension/g.extension.py Lines 1318 to 1340 in 237814f
If addons_paths.json file doesn't exist (due exceeded GitHub API limitation which is 60 request per IP address per 1 hour), multi-addons installation work, but for multi-addons which contains addons which install HTML manual page only is printed warning message line 1371 (is not relevant in this use case, we don't needed to check metadata for these addons, and therefore is used grass/scripts/g.extension/g.extension.py Lines 1357 to 1376 in 237814f
But on the other hand, the end user will not encounter this bug under normal circumstances (outside the CI env), because the addons_paths.json file is always downloaded after the first use of |
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.
Thanks for updating this. It looks good, but the code needs a comment on why it is okay to return the empty list. Or the information can be in the function doc string describing its behavior.
The addons = []
statement at line 1287 should be really only before the last for loop. The new return should just return []
. This makes is more clear what the code is supposed to do.
Given all the rate limit issues and improvements in git, maybe we should consider abandoning the API? Here are some git commands we may use as subprocesses, that do - and that also reasonably fast - what we currently use the API for:
And completely free of dependencies proprietary or hosting specific solutions... |
Here is some related python code:
|
git subprocesses and sparse checkouts are probably also the way to go to replace SVN (#2834) |
That looks very promising! I wouldn't mind having that for 8.3 :) |
Please test #2895 |
@tmszi shall I bump this PR to 8.4.0? |
Let's keep it at version 8.3.0, please. I'll try to implement @ninsbl suggestions as soon as possible and test it. |
af6d5f7
to
69b8f86
Compare
@ninsbl I implemented your suggestion to replace getting addons files paths from the GitHub REST API by cloning addons Git repository. The addons_paths.json JSON file is replaced by the addons Git repository directory grass-addons. |
@ninsbl my implemented solution doen't work correctly with |
To determine which multi-addons install only the manual HTML page.
69b8f86
to
c4411ae
Compare
Replace using GitHub REST API for getting addons paths JSON file: g.extension prefix param arg ($GRASS_ADDON_BASE) dir plus /addons_paths.json file. with Git repository Path: g.extension prefix param arg ($GRASS_ADDON_BASE) dir plus /grass-addons dir.
c4411ae
to
1665303
Compare
Refactoring to use git instead of GitHub REST API
To be backported with #2895. |
…SGeo#2717) Replace using GitHub REST API for getting addons paths JSON file: g.extension prefix param arg (default $GRASS_ADDON_BASE) dir plus /addons_paths.json file. with Git addons repository Path: g.extension prefix param arg (default $GRASS_ADDON_BASE) dir plus /grass-addons dir.
To determine which multi-addons install only the manual HTML page. Fixes #2706.
Removes
-j
flag (which generated JSON file containing the download URLs of the official Addons)