OSGeo / grass-addons

GRASS GIS Addons Repository
https://grass.osgeo.org/grass-stable/manuals/addons/
GNU General Public License v2.0
103 stars 154 forks source link

Link to source code on manual pages of addons point to master branch #601

Closed ecodiv closed 2 years ago

ecodiv commented 3 years ago

Name of the addon All addons

Describe the bug The links to the source code on the manual pages point to the master branch on Github.

To Reproduce Steps to reproduce the behavior:

  1. Open the manual page of any of the addons on https://grass.osgeo.org/grass78/manuals/addons/
  2. Click on 'source code' under the heading 'Source code'
  3. The source code in the master branch on Github is openen

Expected behavior The links to the source code on the manual pages point to the current release branch on Github.

System description (please complete the following information):

ecodiv commented 3 years ago

Relates to #1837 in grass repository

veroandreo commented 3 years ago

I think the line to change is this one: https://github.com/OSGeo/grass/blob/75dd60a694198f7bca17b7e3d6387b6eefa9bb7a/utils/mkhtml.py#L82

Then, once addons grass8 banch is created, we should change it accordingly again

wenzeslaus commented 2 years ago

Then, once addons grass8 banch is created, we should change it accordingly again

The grass8 was created.

echoix commented 2 years ago

Currently, the fix merged on September 26 seems to work, the source code link on the addon manual pages effectively points to the default branch.

The current behavior, for a grass78 addon manual page, the source url points of a grass78 page points to the grass8 branch. For example, the link in https://grass.osgeo.org/grass78/manuals/addons/v.flexure.html points to https://github.com/OSGeo/grass-addons/tree/grass8/src/vector/v.flexure, and for grass80, https://grass.osgeo.org/grass80/manuals/addons/v.flexure.html also points to https://github.com/OSGeo/grass-addons/tree/grass8/src/vector/v.flexure. It is not exactly what is expected, to point us to the file that generated the page, but is tolerable.

However, it is different than the manual pages for the core algorithms. For example, the link in a grass78 https://grass.osgeo.org/grass78/manuals/r.proj.html points to https://github.com/OSGeo/grass/tree/releasebranch_7_8/raster/r.proj and https://grass.osgeo.org/grass80/manuals/r.proj.html points to https://github.com/OSGeo/grass/tree/releasebranch_8_0/raster/r.proj.

To sum up:

Addons:

Core:

If this is ok, the issue can be closed.

tmszi commented 2 years ago

Addons:

* [x] https://grass.osgeo.org/grass78/manuals/addons/v.flexure.html -> https://github.com/OSGeo/grass-addons/tree/grass8/src/vector/v.flexure

Thanks for catching this. It is bug.

echoix commented 2 years ago

I tried finding the solution by myself before posting, but I can't understand completely which script is called to generate the docs for addons. But in the core grasse mkhtml.py, I see that the version number comes from parsing an environnement variable. Does that mean that when the grass78 addons docs are generated, they are run in the same grass8 "context"?

tmszi commented 2 years ago

I tried finding the solution by myself before posting, but I can't understand completely which script is called to generate the docs for addons. But in the core grasse mkhtml.py, I see that the version number comes from parsing an environnement variable.

Bug related with case when addons are compiled on our osgeo lxd container server (e.g. https://grass.osgeo.org/grass78/manuals/addons/v.flexure.html). If you try install addon locally via g.extension v.flexure, addon manual page will have to correct source code and history URL (provided you have compiled the GRASS 7.8 version from last releasebranch_7_8 git branch).

Does that mean that when the grass78 addons docs are generated, they are run in the same grass8 "context"?

G7/G8 add-ons are compiled separately on the osgeo lxd server container. The problem was that this variable had hardcoded version 8 as well for G7 addons.