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

Update version.py for new versioning scheme #55942

Merged
merged 6 commits into from
Jan 26, 2020
Merged

Conversation

Ch3LL
Copy link
Contributor

@Ch3LL Ch3LL commented Jan 22, 2020

What does this PR do?

Updates version.py to work with new versioning scheme -> v3000, v3000.1 etc.

What issues does this PR fix or reference?

Fixes #55896

Previous Behavior

Would only work with date versioning (Major, Minor, Bugfix)

New Behavior

Now works with both date versioning and new versioning (3000, 3000.1, etc)

Tests written?

Yes

Commits signed with GPG?

Yes

@Ch3LL Ch3LL requested a review from a team as a code owner January 22, 2020 23:07
@ghost ghost requested a review from xeacott January 22, 2020 23:07
@Ch3LL Ch3LL changed the title Version fix Update version.py for new versioning scheme Jan 22, 2020
@Ch3LL Ch3LL requested a review from s0undt3ch January 22, 2020 23:09
@max-arnold
Copy link
Contributor

max-arnold commented Jan 23, 2020

Installed two minions:

  1. https://github.com/Ch3LL/salt.git@e6a89a7 (bootstrap-salt.sh -P -x python3 -f -g https://github.com/Ch3LL/salt.git -F -c /tmp git version_fix)
  2. https://github.com/saltstack/salt.git@12c5b33 (bootstrap-salt.sh -P -x python3 -f -g https://github.com/saltstack/salt.git -F -c /tmp git master)

Minion 1 (note the 6.None.0a8):

# salt-call test.version

local:
    6.None.0a8
# salt-call salt_version.less_than Fluorine
[INFO    ] The minion's version code name is less than 'Fluorine'.
local:
    True

^^^ should be False

# cat /usr/lib/python3/dist-packages/salt/_version.py
# This file was auto-generated by salt's setup

from salt.version import SaltStackVersion

__saltstack_version__ = SaltStackVersion(6, None, 0, 0, 'a', 8, 0, None)
# rm /usr/lib/python3/dist-packages/salt/_version.py
# salt-call test.version
local:
    3000

Minion 2:

# salt-call test.version
local:
    3000.0.0-n/a-12c5b33
# cat /usr/lib/python3/dist-packages/salt/_version.py
# This file was auto-generated by salt's setup

from salt.version import SaltStackVersion

__saltstack_version__ = SaltStackVersion(3000, 0, 0, 0, '', 0, -1, '12c5b33')
# rm /usr/lib/python3/dist-packages/salt/_version.py
# salt-call test.version
local:
    3000.0.0

@max-arnold
Copy link
Contributor

max-arnold commented Jan 23, 2020

Maybe it is worth adding a test that compares git-based versions like 3000-n/a-12c5b33

Also, maybe it would be safer to always have one dot in the version number, e.g., 3000.0 (I suspect some scripts and Jinja expressions in the wild do expect that)

@dmurphy18
Copy link
Contributor

@max-arnold The intention is that a single number would be dominant for point releases with a '.x' only when something broke and requires a quick fix within a few weeks of the point release. The intention being that there should be frequent point releases in the future.

@Ch3LL
Copy link
Contributor Author

Ch3LL commented Jan 23, 2020

@max-arnold thanks for catching that, really appreciate it. What was happening is we run a git describe to determine the version when doing a git install. In the instance of the bootstrap install it only clones the repo with a --depth of 1 and when that occurs git describe returns the commit sha instead of a version. I pushed up a fix which i checked with bootstrap:

root@ce3504e781f7:/# salt --version
salt 3000-n/a-c1e9742

root@ce3504e781f7:/# salt-call --local test.version
local:
    3000-n/a-c1e9742

any chance you can re-test as well?

I still have a couple more tests to write for this change to which i'll finish up tomorrow morning.

@dwoz dwoz merged commit 71b81cf into saltstack:master Jan 26, 2020
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.

Need to update version.py to work with new release version (3000)
7 participants