Skip to content
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

Implement versioning, releases and release notes #71

Open
5iver opened this issue Jan 13, 2019 · 9 comments
Open

Implement versioning, releases and release notes #71

5iver opened this issue Jan 13, 2019 · 9 comments

Comments

@5iver
Copy link
Member

5iver commented Jan 13, 2019

I'd like to do a simple version check on OH startup, to compare the core package version with what is in GH and log a message. This could be done for community packages too. So far, we haven't utilized GH releases, and hopefully there is a way to tie in a script after each merge to update the core package version number and release notes, so that it is automated.

  • Compare core to GH, and log/notiy if there is an update available. This could go into core.init.py, but that would slow things down, or the startup delay script. An Item and cron rule would probably be cleanest.
  • Community modules and scripts can optionally set a minimum core version, which gets compared to core, and then messages (maybe exit?) if the core version is not new enough. This can go into the scriptLoaded function.
  • Compare core to OH version. Core will need a minimum OH version to be set.
@mjcumming
Copy link

Scott,

Openhabian would be a great way to do this - and to install Jython.

I am not sure I want scripts autoupdating them selves... prefer to do an update manually.

@5iver
Copy link
Member Author

5iver commented Jan 13, 2019

I am not sure I want scripts autoupdating them selves... prefer to do an update manually.

I agree... I was thinking more along the lines of a log message that there is updated code. Community scripts may require a certain version of the core package, and kick out errors if an older version is being used (I'm currently running into this with the OWM script and changes to core.items and a new core.links). The ability to refer to a version will also help when issues are reported.

My reference to an automated script was not in regards to deployment, but for updating the release notes (I'll try to make it clearer in the OP).

@diijkstra
Copy link
Contributor

diijkstra commented Jan 29, 2019

Great idea to have any version identifier!
I think for starter we should add __version__ attribute to core module plus log on initialization (or maybe fancy item? ;-) ). Did you though about versioning scheme (ex. semantic versioning )? I think I can hack something today ;-)

I would also love to have proper distribution (think setuptools and pip friendly).

@fastlorenzo
Copy link

fastlorenzo commented Jan 29, 2019 via email

@5iver
Copy link
Member Author

5iver commented Jan 29, 2019

I have some changes to commit for Jython 2.7.1 compatibility, and I'll include updating all of the files with a version. I'm thinking the original_(<-2.3) branch could go in as 0.1.0, and I'll just start incrementing with 1.0.0. I'll also play with releases in GH, by putting one out for the old stuff. Community stuff should to use it's own individual versioning.

I'm thinking we will need two flavors of version checking...

  • Compare core to GH, and log/notiy if there is an update available. This could go into core.init.py, but that would slow things down, or the startup delay script. An Item and cron rule would probably be cleanest.
  • Community modules and scripts can optionally set a minimum version, which gets compared to core, and then messages (maybe exit?) if the core version is not new enough. This can go into the scriptLoaded function.

If someone wants to get these together, that would be great!

I would also love to have proper distribution (think setuptools and pip friendly).

Distribution will come in the form of a bundle that users can select in Paper UI!

Maybe you should create a repo per community module? Might be easier to maintain/install

I don't think so. For distribution and organization, one repo seems best. This repo is a starting point, and the whole repo could potentially move under OH... maybe even bundles made available for each community submission. The NGRE and collaboration on automation will be big in OH 3. I've got Jython scripted actions working in Paper UI, and can distribute templates. Once the ESH migration is done, I'll submit a PR for it, and package the OWM script as a template that you can import through Paper UI, directly from GH!

@fastlorenzo
Copy link

fastlorenzo commented Jan 29, 2019

Community stuff should to use it's own individual versioning.

Sounds like a good plan, but how will you manage GitHub tags for community stuff if they are in the main repo ?

The NGRE and collaboration on automation will be big in OH 3. I've got Jython scripted actions working in Paper UI, and can distribute templates. Once the ESH migration is done, I'll submit a PR for it, and package the OWM script as a template that you can import through Paper UI, directly from GH!

Awesome! That would be great to help users installing the modules

Compare core to GH, and log/notiy if there is an update available. This could go into core.init.py, but that would slow things down, or the startup delay script. An Item and cron rule would probably be cleanest.

I agree with the Item/cron approach as otherwise the check would only be done at startup

@diijkstra
Copy link
Contributor

Sounds like a good plan, but how will you manage GitHub tags for community stuff if they are in the main repo?

I think whole repo (OH-JS) can be tagged and released as one release, but each Community 'plugin' can have its own version. One could see a release of new plugins once the release of all repo is done.

I'm thinking we will need two flavors of version checking...

I would definitively add third one, a check against of OpenHAB version against supported by core. Simple, one time only, on startup. Good thing for not backward compatible changes in ESH/OpenHAB.

Community modules and scripts can optionally set a minimum version, which gets compared to core, and then messages (maybe exit?) if the core version is not new enough. This can go into the scriptLoaded function.

You mean external stuff from this repository? If so, than yes - I would really used in my private stuff. If you mean modules and scripts inside this repository, I think it should be enforced that they are compatible or dropped.

@5iver
Copy link
Member Author

5iver commented Jan 29, 2019

Sounds like a good plan, but how will you manage GitHub tags for community stuff if they are in the main repo ?

I'm kind of hoping we have more of an official solution before we need it here. We can think about more repos when there are some more submissions! 😄

Awesome! That would be great to help users installing the modules

Not modules... just scripts. A lot of the modules will get absorbed into a scripting API, and there'll be an installer bundle.

I think whole repo (OH-JS)

And Groovy... hopefully Kotlin!

I would definitively add third one, a check against of OpenHAB version against supported by core.

Yes! A core minimum supported OH version.

Max could be done too, but we'd have to maintain a table that would need to be downloaded each time. Seems like too much.

If you mean modules and scripts inside this repository, I think it should be enforced that they are compatible or dropped.

An example of what I was thinking... the OWM script needs the changes in core.items and the new core.links. So, the check would warn that the core did not meet the min version requirement.

Changes to core could/will break scripts, just like openhab-core breaks bindings, so there will be some maintenance. But I agree, if they aren't updated in time for a release, then they should be somehow separated, like into a 'Not Compatible' directory.

@5iver 5iver added the jython label May 22, 2019
@5iver 5iver pinned this issue May 25, 2019
@5iver 5iver removed the jython label Jun 28, 2019
@TareqK
Copy link

TareqK commented Jul 27, 2019

For release notes and docs, has anybody looked into making living documents from code/ adding documented unit tests for examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants