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!
a.l
Posts: 86
Joined: Thu Apr 09, 2020 7:14 pm

Re: Metadata: One Standard to Rule Them All

Post by a.l »

Hi all
Obviously I first find this thread after creating a feature request in https://forum.freecadweb.org/viewtopic.php?f=8&t=59804 ;)
In that thread I try to make a point of having version/changelog in a version (xml, json, whatever) file so there is an entry per update that the add-on manager can make use of and that the add-on creator/maintainer will have to update.
It would be really nice to see the new add-on manager come into fruition! Hope version/changelog will fit into that package format/requirements for the add-ons like you guys state in https://wiki.freecadweb.org/Package_Metadata . Maybe the package metadata is just about the current version and not like a version/changelog?
Thanks
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Metadata: One Standard to Rule Them All

Post by chennes »

It would be a simple matter to include a <changelog> tag if desired. Maybe something like:

Code: Select all

<changelog version=“1.2.3”>Fixed the bug from 1.2.2</changelog>
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: Sun Jul 04, 2021 7:47 pm
One question about something I'm not clear about (sorry if answer is already somewhere) : how do you plan to introduce metadata with macros? Today macros are stored in folders containing many of them. So it's not compatible with having one 'package.xml' describing each macro all in the same folder.
Should macros be separated each in its own folder? Or just having folders storing the metadata files?

Another one :) : did you plan that package can contain package(s)?

Thx
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Metadata: One Standard to Rule Them All

Post by chennes »

My plan with macros is three-fold: first, in the main FreeCAD-Macros repo we can have a single package.xml file that lists out each macro, its files, and potentially its icon (if the author wants to submit one), but still leave them all in the single centralized repository. Second, the macros on the wiki are a lost cause for metadata, as near as I can tell, I was just going to leave that code alone and hope it never breaks :) . And third, macro authors who would prefer to have more control over their structured and distribution (and source code!) can have their macro(s) in their own Git repo and have it added to the list of addons -- it will now show up correctly with the rest of the macros (and soon will actually get installed correctly... that's still a work in progress :D ).
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Metadata: One Standard to Rule Them All

Post by chennes »

openBrain wrote: Wed Oct 27, 2021 8:47 pm Another one :) : did you plan that package can contain package(s)?
The metadata standard is recursive, so content items can contain other content items (theoretically... not actually implemented yet), but you can only have one package.xml file.
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 9:08 pm My plan with macros is three-fold
Sounds good.

Probably at a moment it could be good to completely drop macro code from the wiki and only keep Github. Doing so, there are concerns about user living in countries where Github isn't accessible (however I don't know how this may have evolved since last US presidential election), but having an accessible mirror for them is probably not so complicated.

I think we should encourage people to publish their macros in the global repo rather than on their own (of course there are some exceptions). Macros tends to be generally unmaintained, and so it's good that anybody can push a PR that fixes a bug or adds a feature then the PR can be merged without waiting forever someone who left years ago. ;)
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 9:10 pm The metadata standard is recursive, so content items can contain other content items (theoretically... not actually implemented yet), but you can only have one package.xml file.
Not sure I was totally clear on this.
Let say you have 'SketcherMacros' as a package (that groups all macros for Sketcher) and 'PartDesignMacros' as another one (same for PartDesign).
Now we want to distribute a (meta) package called 'ILoveFeatureEditing' that shall bring all macros for both Sketcher and PartDesign.
The idea is that this last package only contains 2 items of type 'package' whose pointed resources are just the 2 'package.xml' files of the 2 previous packages. Of course it also has its own description, icon,...
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Metadata: One Standard to Rule Them All

Post by chennes »

openBrain wrote: Wed Oct 27, 2021 9:43 pm Now we want to distribute a (meta) package ...
Do you want it to truly be a meta-package, in that it doesn't actually contain the others, but simply references them and the Addon Manager deals with actually checking them out?
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 9:51 pm Do you want it to truly be a meta-package, in that it doesn't actually contain the others, but simply references them and the Addon Manager deals with actually checking them out?
Exactly. So if one of the packages is updated, the meta package will automatically be as it just contains pointers to other packages.

PS : doing so would allow to represent the locally installed macros/workbenches/themes of a user as a meta-package easy to transfer, backup,...
User avatar
chennes
Veteran
Posts: 3878
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Metadata: One Standard to Rule Them All

Post by chennes »

So probably something like:

Code: Select all

<content>
  <package>
    <name>Subpackage name</name>
    <url type="repository" branch="main>https://gitlab.com/chennes/TestRepo</url>
  </package>
</content>
Then the Addon Manager clones TestRepo into "Subpackage name". The core code would have to be tweaked to recurse when loading the package, but that's not a big deal.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply