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

Add release "next" version command #52

Closed
wants to merge 1 commit into from
Closed

Add release "next" version command #52

wants to merge 1 commit into from

Conversation

Gustry
Copy link
Collaborator

@Gustry Gustry commented Apr 14, 2021

This would be convenient on CI, to make a package when it's not based on a "tag", but rather on a commit.
The version must always be lower in the metadata.txt otherwise QGIS Plugin Manager won't notify the user for a new version.

Fix #34

@Gustry Gustry force-pushed the next_version branch 2 times, most recently from 6f08efd to 0295331 Compare April 28, 2021 03:23
@Gustry Gustry marked this pull request as ready for review April 28, 2021 03:23
@Gustry
Copy link
Collaborator Author

Gustry commented Apr 28, 2021

Anything against the git_sha1 and the date_time added ?

It's for traceability, because it's not linked to any tag. Many packages can have the same version otherwise.

If needed, I can add them only if we are in the next command.

@Gustry Gustry requested review from Guts and 3nids and removed request for Guts April 28, 2021 03:27
@Gustry Gustry changed the title Add release next version command Add release "next" version command Apr 28, 2021
@Gustry
Copy link
Collaborator Author

Gustry commented Apr 28, 2021

Somehow, the new metadata info are not in the final zip when I use it on some plugins.

- When packaging or releasing, you can use these keywords :
- `latest` will make a package of the latest tag described in the changelog file.
- `next` will make a package of the possible smallest higher tag :
- `3.4.0` -> `3.4.1-alpha`
Copy link
Member

@3nids 3nids Apr 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it 3.4.1 ?

qgispluginci/release.py Outdated Show resolved Hide resolved

# Date/time in UTC
add_in_file(
"{}/metadata.txt".format(parameters.plugin_path),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"{}/metadata.txt".format(parameters.plugin_path),
f"{parameters.plugin_path}/metadata.txt",

qgispluginci/utils.py Outdated Show resolved Hide resolved
qgispluginci/utils.py Outdated Show resolved Hide resolved
@@ -49,6 +49,22 @@ def test_version_note_from_tag(self):
self.assertIsNone(version.prerelease)
self.assertFalse(version.is_prerelease)

def test_next_version(self):
""" Test to guess the next version. """
self.assertEqual(parse_tag("10.1.0").next_version().version, "10.1.1-alpha")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this because next version is experimental by default?

@Gustry
Copy link
Collaborator Author

Gustry commented Apr 29, 2021

  • 3.4.0 -> 3.4.1-alpha

Yes it is expected, to be the "smallest higher version", so by adding any pre-release string.

  • Timeline with this PR, the next makes 3.4.1-alpha:

    • t+0, you tag 3.4.0, the changelog contains 3.4.0
    • t+1, you start working for the next version, the CI will release 3.4.1-alpha
    • t+2, you continue working, the CI will release 3.4.1-alpha
    • t+3, you have finished this new version, you tag 3.4.1, QGIS will notify all users about the new version, including the one who you used the artifact from CI
  • Timeline if the next makes 3.4.1:

    • t+0, you tag 3.4.0, the changelog contains 3.4.0
    • t+1, you start working for the next version, the CI will release 3.4.1
    • t+2, you continue working, the CI will release 3.4.1
    • t+3, you have finished this new version, you tag 3.4.1, QGIS will notify only users from the tag 3.4.0. Users which have downloaded the artifact from CI 3.4.1 won't be warned by QGIS about the new tagged version.

This is based on some previous experiences with the QGIS Plugin Manager and some users who you have downloaded artifact. They forgot to come back to a normal "tagged" version because the Plugin Manager in QGIS was not notifying them until we make a higher proper tag.

I'm aware that it looks fragile for now. Of course I'm happy to have a better solution. It's just how QGIS Plugin manager works for now to notify new versions.

I hope I was clear :)

@Guts
Copy link
Collaborator

Guts commented Apr 29, 2021

I'm not sure that it's a good idea to make the next version experimental by default.

How to pick the type of pre-release? If I just want a beta or directly a release candidate or a post, can I do it?

We're speaking about the conventional, nearly standardized, semantic versioning so I think it would be better to implement it cleanly and work on QGIS Plugins Manager to make it fit also the convention, instead of keep stucked on a irregular implementation. No?

@Guts
Copy link
Collaborator

Guts commented Apr 29, 2021

Anything against the git_sha1 and the date_time added ?

It's for traceability, because it's not linked to any tag. Many packages can have the same version otherwise.

If needed, I can add them only if we are in the next command.

I don't see the related commit. Can you link to the lines of code please?

Not sure that it's a shared expectation so maybe it's better to use it only with this next command.

@Gustry
Copy link
Collaborator Author

Gustry commented Apr 29, 2021

I'm not sure that it's a good idea to make the next version experimental by default.

Hum, you mean that for zip package, we shouldn't set the "experimental" flag in the metadata.txt ?
Maybe true, it depends how you install it. Mostly, users will install it from the ZIP file, so QGIS Plugin manager doesn't care about "experimental flag". But if you set up a customs plugins.xml, indeed, maybe it would be a problem for some users.

How to pick the type of pre-release? If I just want a beta or directly a release candidate or a post, can I do it?

If your last tag in the changelog is a RC and in the CLI you ask a next version with alpha, what will do qgis-plugin-ci ?
That's why I did the full-auto way for me.

We're speaking about the conventional, nearly standardized, semantic versioning so I think it would be better to implement it cleanly and work on QGIS Plugins Manager to make it fit also the convention, instead of keep stucked on a irregular implementation. No?

Sorry, I don't understand. Everything is following semantic versioning here. QGIS is also following this convention.
What do you want to implement in QGIS ? A proper way to have continuous release of a plugin ?
@Guts The plugin manager handle well semantic versioning : https://github.com/qgis/QGIS/blob/master/python/pyplugin_installer/version_compare.py

Not sure that it's a shared expectation so maybe it's better to use it only with this next command.

Sure, I though about that, then I thought it doesn't bother to have this info in the metadata.txt. I can make the PR in QGIS documentation to add them : https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/plugins/plugins.html#plugin-metadata I can change that if needed.

For the code, look gitSha1 or dateTime. I have renamed to follow the convention in the metadata.txt which use lower camelcase for keys.

@3nids
Copy link
Member

3nids commented Mar 17, 2022

What's up here?

@Gustry
Copy link
Collaborator Author

Gustry commented Mar 17, 2022

I want to come back on it. Some code from this PR is in the new one #119

@Gustry Gustry force-pushed the next_version branch 2 times, most recently from f4f775b to c8fd893 Compare March 17, 2022 13:10
@Gustry
Copy link
Collaborator Author

Gustry commented Oct 10, 2023

Let's close it even if I'm still missing this feature.
I'm still impacted by this lack but I have some bash command in the CI script to overpass this PR in the meantime :

if [ -z "$CI_COMMIT_TAG" ]
then
  TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
  VERSION=$(echo ${TAG} | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}')-alpha
  echo "VERSION=${VERSION}" > build.env
  echo "STATUS=unstable" >> build.env
else
  echo "VERSION=${CI_COMMIT_TAG}" > build.env
  echo "STATUS=stable" >> build.env
fi

@Gustry Gustry closed this Oct 10, 2023
@Gustry
Copy link
Collaborator Author

Gustry commented Oct 10, 2023

branch moved to my own fork for archive

@Gustry Gustry deleted the next_version branch October 10, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a "qgis-plugin-ci package next" command
3 participants