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

[master] Fix detection of Salt codename by "salt_version" execution module. #64554

Merged

Conversation

meaksh
Copy link
Contributor

@meaksh meaksh commented Jun 27, 2023

What does this PR do?

This PR fixes an issue and some kind of mess we have around Salt version detection and codename resolution.

Currently, the codename resolution (salt_version.get_release_number and salt_version.equal) seems broken in Salt:

# pip3 install salt
Collecting salt
  Downloading salt-3006.1.tar.gz (20.4 MB)
[...]
Successfully installed Jinja2-3.0.3 MarkupSafe-2.0.1 PyYAML-6.0 certifi-2023.5.7 charset-normalizer-2.0.12 contextvars-2.4 distro-1.8.0 idna-3.4 immutables-0.19 jmespath-0.10.0 looseversion-1.2.0 msgpack-1.0.5 psutil-5.9.5 pycryptodomex-3.18.0 pyzmq-25.0.2 requests-2.27.1 salt-3006.1 typing-extensions-4.1.1 urllib3-1.26.16

# salt-call --version
salt-call 3006.1

# salt-call --local grains.get saltversion
local:
    3006.1

# salt-call --local salt_version.equal Sulfur
local:
    False

# salt-call --local salt_version.get_release_number Sulfur
local:
    No version assigned.

Previous Behavior

As mentioned above, the salt_version.get_release_number and salt_version.equal execution module functions (and probably others) are not working fine.

Other codenames seems working fine:

# salt-call --local salt_version.get_release_number Neon
local:
    3000

After some debugging, I've noticed the following situations:

  • Codename definitions for Salt >= 3006 seems wrong at salt/version.py, as they map the version codename to the 300X.0 release but not to the entire 300X. This causes problems on codename detection.
  • There seems to be a mess with the usage of can_have_dot_zero function that causes wrong a detection of Salt versions.

New Behavior

Salt version resolution works fine now and versions are detected as expected:

# salt-call --local salt_version.get_release_number Sulfur
local:
    3006

# salt-call --local salt_version.equal Sulfur
local:
    True

Merge requirements satisfied?

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@meaksh meaksh requested a review from a team as a code owner June 27, 2023 12:08
@meaksh meaksh requested review from MKLeb and removed request for a team June 27, 2023 12:08
@salt-project-bot-prod-environment salt-project-bot-prod-environment bot changed the title Fix detection of Salt codename by "salt_version" execution module. [master] Fix detection of Salt codename by "salt_version" execution module. Jun 27, 2023
@meaksh meaksh temporarily deployed to ci June 27, 2023 12:58 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 12:58 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 12:59 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 13:16 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 13:20 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 13:36 — with GitHub Actions Inactive
@meaksh meaksh changed the title [master] Fix detection of Salt codename by "salt_version" execution module. [WIP] [master] Fix detection of Salt codename by "salt_version" execution module. Jun 27, 2023
@meaksh
Copy link
Contributor Author

meaksh commented Jun 27, 2023

This PR still need some changes. I set [WIP] tag and will update it soon.

@meaksh meaksh temporarily deployed to ci June 27, 2023 15:49 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 15:49 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 15:49 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 15:49 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 15:50 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 15:50 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 16:55 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 16:55 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 16:55 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 16:55 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 16:56 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 27, 2023 16:56 — with GitHub Actions Inactive
@meaksh meaksh changed the title [WIP] [master] Fix detection of Salt codename by "salt_version" execution module. [master] Fix detection of Salt codename by "salt_version" execution module. Jun 28, 2023
changelog/64554.fixed.md Outdated Show resolved Hide resolved
@s0undt3ch s0undt3ch linked an issue Jun 28, 2023 that may be closed by this pull request
9 tasks
@s0undt3ch s0undt3ch added the backport:3006.x Backport PR to 3006.x branch label Jun 28, 2023
@meaksh meaksh requested a review from Ch3LL June 30, 2023 11:50
@meaksh meaksh temporarily deployed to ci June 30, 2023 16:36 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 30, 2023 16:36 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 30, 2023 16:36 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 30, 2023 16:36 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 30, 2023 16:51 — with GitHub Actions Inactive
@meaksh meaksh temporarily deployed to ci June 30, 2023 17:00 — with GitHub Actions Inactive
@s0undt3ch s0undt3ch merged commit db5a9a1 into saltstack:master Jul 1, 2023
@meaksh meaksh deleted the master-fix-detection-of-salt-codename branch July 3, 2023 08:15
@s0undt3ch s0undt3ch added backport:complete PR Backported labels Jul 19, 2023
@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

9 similar comments
@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

@s0undt3ch
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
3006.x

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:complete PR Backported backport:3006.x Backport PR to 3006.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] modules.salt_version appears broken in Sulfur
5 participants