[Merged] PR #5131: Addon Manager Redesign

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #5131: Addon Manager Redesign

Post by chennes »

Keith, what do you think about something like this:

Code: Select all

<repository url="https://github.com/chennes/FreeCAD-Packages">
  <option ref="main" name="Stable"/>
  <option ref="dev" name="Development"/>
  <option ref="0.19.3" name="Release v0.19.3"/>
  <option ref="fc642482" name="Pre-alpha test"/>
</repository>
The Addon Manager would show that list of names in a drop-down box on the package details page, and when clicking "install" or "update", the selected git ref would be checked out. To change between them the user would visit the package details page and choose a different option from the menu, which would cause the "update" button to appear.
keithsloan52 wrote: Sat Dec 18, 2021 10:36 am .
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
keithsloan52
Veteran
Posts: 2756
Joined: Mon Feb 27, 2012 5:31 pm

Re: PR #5131: Addon Manager Redesign

Post by keithsloan52 »

chennes wrote: Sat Dec 18, 2021 11:53 pm Keith, what do you think about something like this:

Code: Select all

<repository url="https://github.com/chennes/FreeCAD-Packages">
  <option ref="main" name="Stable"/>
  <option ref="dev" name="Development"/>
  <option ref="0.19.3" name="Release v0.19.3"/>
  <option ref="fc642482" name="Pre-alpha test"/>
</repository>
The Addon Manager would show that list of names in a drop-down box on the package details page, and when clicking "install" or "update", the selected git ref would be checked out. To change between them the user would visit the package details page and choose a different option from the menu, which would cause the "update" button to appear.
keithsloan52 wrote: Sat Dec 18, 2021 10:36 am .
Hi Chris

I think it looks good.

Not really an issue for Addon Manager but think it would be good to have some indication in the workbench what branch it is using.
Not sure if one could add an Icon that was just text with branch name or adjust workbench name from say GDML to GDML-Beta.
Getting current branch from git seems to require use of a subprocess see https://www.programcreek.com/python/?Co ... git+branch Is there a way a workbench could check what the current Addon Manager selection is?
On the other hand checking with git would avoid any problems if things get out of sync.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: PR #5131: Addon Manager Redesign

Post by TheMarkster »

chennes wrote: Sat Dec 18, 2021 11:53 pm ping
I'm getting this error about not finding a file named metadata.txt with a raw github link showing the addon manager while installing one of my workbenches. Aside from that the workbench appears to install okay. Same for all 3 of them. I was getting a warning about the icon being already defined in the package.xml file so I commented out the define in InitGui.py and that seems to have fixed the warning message.
Snip macro screenshot-881850.png
Snip macro screenshot-881850.png (10.86 KiB) Viewed 3463 times
Edit: I should add it wasn't built from the very latest source. I have a git branch open that was current about 3 days ago and didn't want to have to rebuild.

Edit #2: I'm rebuilding from current master to test it again. Will take a little while.
Last edited by TheMarkster on Fri Dec 31, 2021 11:30 pm, edited 1 time in total.
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #5131: Addon Manager Redesign

Post by chennes »

I recently (like, last night) committed a cleanup fix that silences those warnings (since they aren't relevant for normal users). They are just log messages now.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: PR #5131: Addon Manager Redesign

Post by TheMarkster »

The error message still persists after building from latest source. Why is it looking for metadata.txt when the only file I need (AFAIK) is package.xml?
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #5131: Addon Manager Redesign

Post by chennes »

It's left over from the old version of the addon manager, it allows you to set Python package dependencies. I think the original addon manager didn't display the error messages from the dependency checker, though, so I'm not sure that completely worked. I haven't decided what to do with that checker yet.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: PR #5131: Addon Manager Redesign

Post by TheMarkster »

I see. I added an empty file and that has ended the error message.
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #5131: Addon Manager Redesign

Post by chennes »

I think I can easily make it disappear for real by telling the dependency resolver to treat the missing file as a successful dependency check, instead of a failing one. I'll add that to the PR I'm putting together, it seems silly for you to have to add an empty file.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: PR #5131: Addon Manager Redesign

Post by TheMarkster »

I had to go back to defining the icon in the workbench because older builds without the new addon manager get the default FreeCAD icon.
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: PR #5131: Addon Manager Redesign

Post by chennes »

Yes, you can safely leave it there for old versions: that warning message should be hidden now (just an entry in the log file).
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply