-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
[WIP] Algorithm to obtain metadata from an addon name #10
Comments
This is a very nice approach! Going a bit off-topic, I'm thinking that, instead of adding a download button like our current shop has (which I guess nobody uses), we can just have a section saying something like:
That would fit well with a SSG like this, and still handle all dependencies automatically with close to zero maintenance on our side. |
One worry I have with the frontend/js approach is SEO. I wonder if we could use the GitHub API on merge in the addons repos, to trigger a workflow here that would do a partial rebuild and therefore have the metadata in the static pages. |
Why do you think SEO would be affected? |
The frontend folks I frequent tend to tell me dynamic content negatively affects SEO. That was certainly true in the past. I never bothered to look for a definitive modern explanation for this, though. |
I will describe here a possible algorithm to obtain the metadata from a single addon name.
The main idea is to obtain the metadata from https://pypi.org/simple. The advantage of this approach is that it can be done in javascript in the browser, so the documentation page for an addon can be static, with a dynamic widget showing the metadata.
How to list the Odoo series for which the addon is available
In short:
https://pypi.org/simple/odoo-addon-{addon-name}/
exists, look at the available wheel versions (will give series >= 15)https://pypi.org/simple/odoo-addon{series}-{addon-name}/
Example :
curl -sSL -H "Accept: application/vnd.pypi.simple.v1+json" https://pypi.org/simple/odoo-addon-mis-builder | jq
Details TBC.
How to get a METADATA file for an addon and Odoo series
In short: find the URL of the last available wheel and add a
.metadata
suffix. This will give aMETADATA
file as described below.Details TBC.
Metadata details
Here we show the mapping from METADATA entries to
__manifest__.py
entries. Example.Home-Page
:website
(GitHub repo URL)Authors
:author
Summary
:summary
Requires-Dist
:depends
+external_dependencies["python"]
Version
:version
(plus one last digit, or plus.devN
for older series)License
:license
__manifest__
metadata that is not available:maintainers
The README is available in the METADATA files, so this may be exploitable in the browser? It is in .rst format, though.
TBC
The text was updated successfully, but these errors were encountered: