Tag at Github and release new plugin versions easily

Tag at Github and release new plugin versions easily

by David Mudrák -
Number of replies: 13
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

As was initially announced at the October 2014 developer meeting, we were working on the Plugins directory improvements that would allow plugin maintainers to easily release new plugin versions based on Git tags. I am happy to announce some progress on this feature.

The Plugins directory now integrates with Github, the most popular hosting site for Moodle plugins code. When adding a new version of a plugin, the list of available tags are fetched from the Github and presented in a drop-down menu.

Screenshot of the new widget to upload tagged version of the plugin

Selecting the tag and pressing the "Release" button does two things:

  • The ZIP of the tagged version is loaded into the filepicker so that you do not need to upload it manually.
  • The fields VCS tag, Changelog URL and Alternate download URL are automatically pre-populated with a reasonable value.

To be able to use this new feature, you just have to make sure that the Source control URL field of your plugin record points to the Github repository of the plugin. And of course, you have to tag your code in advance. You can read more on Git tags in their documentation.

Together with this improvement, we also slightly changed another feature. As you probably know, the contents of the README file is used as the default value of the Release notes for the new version. From now on, if there is a file called CHANGES in the root of your repository, it will be used instead of the README file as the source for the release notes. Extensions .md, .txt, .htm and .html are supported, too (with Markdown being recommended as it proved to lead to well formatted text in both web and text terminal interface).

I hope you will enjoy these small yet nice improvements.

Average of ratings: Useful (9)
In reply to David Mudrák

Re: Tag at Github and release new plugin versions easily

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yay! This is brilliant smile

In reply to David Mudrák

Re: Tag at Github and release new plugin versions easily

by Charles Fulton -
Picture of Core developers Picture of Plugin developers Picture of Testers

This sounds fantastic--if only I had something to release...

In reply to Charles Fulton

Re: Tag at Github and release new plugin versions easily

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Cool David smile


Does it automatically rename the folder in the 'zip'?  i.e. one of the existing 'system' tick boxes for the manual method.

Is the licence automatically set at pubic domain rather than creative commons?

In reply to Gareth J Barnard

Re: Tag at Github and release new plugin versions easily

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

IIRC, the "Rename root directory" option is checked by default, regardless the way how you upload the ZIP. I have not checked the license set for the auto-loaded file, it is probably using the default value now.

In reply to David Mudrák

Re: Tag at Github and release new plugin versions easily

by Tomasz Muras -
Picture of Core developers Picture of Plugin developers Picture of Plugins guardians Picture of Translators

Functionality is awesome, it makes it much easier to release new version - thank you!

I'm pretty sure I've left "Rename root directory" checked and yet I ended up with original (as exported from github) directory name. I guess renaming does not work for plugins in "other" category. It would be nice to rename the directory into something - e.g. plugin name.

Thanks again,
Tomek

In reply to Tomasz Muras

Re: Tag at Github and release new plugin versions easily

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

I guess you are right. Renaming plugins that are not valid Moodle components with frankenstyle name associated is a bit tricky though. I assume that in 99% of cases, the user will want to rename and/or move the folder anyway. So in this particular case, my +1 to leave it as it is.

In reply to David Mudrák

Re: Tag at Github and release new plugin versions easily

by Andrew Downes -

I really enjoyed using this - very smooth. One issue I've hit though is that it doesn't handle submodules - it leaves an empty folder. Is this a known issue? 

I'm not sure where to report bugs with the plugins directory, so I'm mentioning it here and will also add it to the Moodle Tracker

The plugin in question that uses submodules is the Tin Can launch link: https://moodle.org/plugins/pluginversion.php?id=9883 and on github: https://github.com/garemoko/moodle-mod_tincanlaunch

Thanks!

In reply to Andrew Downes

Re: Tag at Github and release new plugin versions easily

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Well, does hitting the download link on github lead to downloading the module together with subplugins? We are simply using Github API to obtain the ZIP files.

In any case, Plugins directory issues are to be reported into the Moodle tracker, project "MDLSITE", component "moodle.org/plugins"
In reply to David Mudrák

Re: Tag at Github and release new plugin versions easily

by Andrew Downes -

Tracker issue: https://tracker.moodle.org/browse/MDLSITE-4333

Clicking download as zip on Github also has the same problem and it seems like a problem for a few projects on the internet.

One solution is here: http://stackoverflow.com/questions/12936014/include-a-github-submodule-automatically-in-download#comment17557974_12950790

Another is to say that the Github integration does not support plugins with submodules and force me to build the zip file by hand. Probably the best option if use of submodules is rare. 

I guess another would be some way for plugins to declare code library dependencies. Currently if two plugins use TinCanPHP, then the library has to be included in each plugin. 

In reply to David Mudrák

Re: Tag at Github and release new plugin versions easily

by Bas Brands -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers

Thanks very much! This is awesome!

In reply to David Mudrák

Re: Tag at Github and release new plugin versions easily

by Flotter Totte -
Picture of Plugin developers

Great, thanks!

To show my happiness I just released a new plugin smile