Metadata: One Standard to Rule Them All

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Metadata: One Standard to Rule Them All

Post by openBrain »

I even imagined something like :

Code: Select all

<content>
    <package url="url://path/to/pack1/package.xml" />
</content>
All other information can then be retrieved from the url.
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Metadata: One Standard to Rule Them All

Post by chennes »

I'll have to think about that -- I'm not a huge fan of a url straight to the package.xml file, I'd rather a url to the git repo and a named branch.

On that note, right now there's no support for specifying a specific git commit or tag, but as I was writing the Addon Manager code it seemed like that would be a useful thing. If the package.xml file lists a specific version, it seems to me in the abstract that should correspond not to the repo url as a whole, but to a specific commit in that repo/branch. But then to make a new release the author would have to modify two pieces of information, the version and the tag/commit hash. Any thoughts on adding an optional "tag" and/or "commit" attribute to the repo url attributes?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Metadata: One Standard to Rule Them All

Post by openBrain »

chennes wrote: Wed Oct 27, 2021 10:52 pm I'll have to think about that -- I'm not a huge fan of a url straight to the package.xml file, I'd rather a url to the git repo and a named branch.
Most probably you're right.:)
On that note, right now there's no support for specifying a specific git commit or tag, but as I was writing the Addon Manager code it seemed like that would be a useful thing. If the package.xml file lists a specific version, it seems to me in the abstract that should correspond not to the repo url as a whole, but to a specific commit in that repo/branch. But then to make a new release the author would have to modify two pieces of information, the version and the tag/commit hash. Any thoughts on adding an optional "tag" and/or "commit" attribute to the repo url attributes?
I think it's good that author have only to change one thing. I would change a bit how <url> works. Will take an example with FreeCAD repo (even if it has no real sense).
Now you have to do :

Code: Select all

<url type="repository" branch="master">https://github.com/FreeCAD/FreeCAD</url>
Instead I would remove the 'branch' attribute and use the full url mode. Above line becomes :

Code: Select all

<url type="repository">https://github.com/FreeCAD/FreeCAD/tree/master</url>
So if you want to point to the HEAD of another branch :

Code: Select all

<url type="repository">https://github.com/FreeCAD/FreeCAD/tree/releases/FreeCAD-0-19</url>
Or to a specific commit (it can then indifferently be on any branch) :

Code: Select all

<url type="repository">https://github.com/FreeCAD/FreeCAD/tree/4061c04</url>
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Metadata: One Standard to Rule Them All

Post by chennes »

Unfortunately that won't work: we need to construct "raw" and "blob" URLs in the Addon Manager for various purposes, so we need to know the canonical URL for the main repository, and I don't want to have to parse it out of the URL. I don't want to lose information by burying it in a URL that has to be parsed. As it is we have a problem with creating URLs because the three (now four) Git hosts that we support don't construct them all the same way, so we have to custom code each one.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
flachyjoe
Veteran
Posts: 1869
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: Metadata: One Standard to Rule Them All

Post by flachyjoe »

Hi!
Do you plane to list non-freecad python package dependencies in metadata?
When a workbench need a specific python package to run, the addon manager could then check its presence and warn the user.
- Flachy Joe -
Image
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Metadata: One Standard to Rule Them All

Post by chennes »

flachyjoe wrote: Sat Nov 06, 2021 5:51 pm Do you plane to list non-freecad python package dependencies in metadata?
Those Python dependencies are actually already specified in a separate file, so I wasn't going to duplicate that work here.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Metadata: One Standard to Rule Them All

Post by chennes »

I've been giving some more thought to the use of "email" as a sole contact method for maintainers and authors: it seems to me that this is already dating the standard, and it's only just begun! What do you think about replacing it with a more generic "contact" attribute (or something like that)? That string will be allowed to be arbitrary by the standard, with the idea that it can evolve over time, allowing maximum flexibility, so you could have something like:
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
mnesarco
Posts: 446
Joined: Thu Mar 26, 2020 8:52 pm

Re: Metadata: One Standard to Rule Them All

Post by mnesarco »

chennes wrote: Thu Dec 09, 2021 3:43 am I've been giving some more thought to the use of "email" as a sole contact method for maintainers and authors: it seems to me that this is already dating the standard, and it's only just begun! What do you think about replacing it with a more generic "contact" attribute (or something like that)? That string will be allowed to be arbitrary by the standard, with the idea that it can evolve over time, allowing maximum flexibility, so you could have something like:
Hi @chennes,

What do you think about something like:

Code: Select all

<author>
  <name> John Wayne </name>
  <contact type="email"> john@gmail.com </contact>
  <contact type="twitter"> @john </contact>
  <contact type="github"> https://github.com/wayne/whatever/issues </contact>
</author>
Post Reply