-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
mkhtml: check for addon_path #3571
Conversation
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.
Condition if addon_path is not None:
should be inside body of get_git_commit_from_rest_api_for_addon_repo()
function, line 294. See the code line comment on the line 291, please.
Lines 278 to 294 in afce9ea
def get_git_commit_from_rest_api_for_addon_repo( | |
addon_path, | |
src_dir, | |
git_log=None, | |
): | |
"""Get Git commit from remote GitHub REST API for addon repository | |
:param str addon_path: addon path | |
:param str src_dir: addon source dir | |
:param dict git_log: dict which store last commit and commnit date | |
:return dict git_log: dict which store last commit and commnit date | |
""" | |
# Accessed date time if getting commit from GitHub REST API wasn't successful | |
if not git_log: | |
git_log = get_default_git_log(src_dir=src_dir) | |
grass_addons_url = ( |
Because if addon is not official addon, func must return date (access date of addon directory) with git_log
variable, example {'commit': 'unknown', 'date': 'Wednesday Apr 10 11:48:39 2024'}
, line 293.
And date and time inside manual page looks like
Accessed: Wednesday Apr 10 11:48:39 2024
instead of
Latest change: Wednesday Mar 01 21:08:00 2023 in commit:1a96f69ccf430caa03bec8dbfc990c07c81f3164
Attached patch file:
patch.zip
Apply patch with:
git am < 0001-utils-do-not-make-unnecessary-request-to-addons-repo.patch
… addon path is None
Thanks for the feedback, I applied it. But this way there is no chance the information can be retrieved from the |
Only official addons are supported now (during addon compilation is downloaded source code without Git repo, and getting commit is done by request/response from the official GitHub GRASS GIS Addons repository) . Else branch with Lines 407 to 409 in 49e1353
I apologize for close/reopen PR. I accidentally hit Close with comment button. |
Ok thanks for clarification! I am not sure about the failing Python Code Quality Checks though. The error there doesn't seem to be related to linting:
@tmszi is it possible to retry the failing check? I don't have access rights to do so. |
It seemed like an intermittent failure.. |
That could be the cause, yes, now it runs through :) May someone with merge rights merge this? |
… addon path is None (#3571) --------- Co-authored-by: Tomas Zigo <[email protected]>
This PR suggests to add a check for an empty addon_path.
The default value is set to
addon_path = None
in L889 and there are circumstances where it is not overwritten. As far as I see it, this would prevent the code from requesting a wrong path in the following method returning the latest commit of the whole addon repository instead of the latest commit for the addon.Manual page generation here is really new to me so I am not sure about all the different variations in which this script might be called and if I oversee something. Background is that I am using the script to generate manual pages for addons not in the official addon repository and this PR would prevent multiple unneccessary requests to the github API.