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

securedrop-admin check_for_updates is showing update needed when it should not #3579

Closed
kushaldas opened this issue Jun 26, 2018 · 3 comments
Labels
Milestone

Comments

@kushaldas
Copy link
Contributor

Description

./securedrop-admin check_for_updates is showing update needed when it should not

Steps to Reproduce

amnesia@amnesia:~/Persistent/securedrop$ git checkout develop
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
amnesia@amnesia:~/Persistent/securedrop$ git tag -a 0.10.0
amnesia@amnesia:~/Persistent/securedrop$ git checkout 0.8.0-rc3
Note: checking out '0.8.0-rc3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 20289641... SecureDrop 0.8.0~rc3
amnesia@amnesia:~/Persistent/securedrop$ ./securedrop-admin check_for_updates
INFO: Checking for SecureDrop updates...
Fetching origin
INFO: Update needed
amnesia@amnesia:~/Persistent/securedrop$ git describe
0.8.0-rc3
amnesia@amnesia:~/Persistent/securedrop$ git checkout 0.10.0 
Previous HEAD position was 20289641... SecureDrop 0.8.0~rc3
HEAD is now at 4720be05... Merge pull request #3570 from dachary/wip-i18n
amnesia@amnesia:~/Persistent/securedrop$ ./securedrop-admin check_for_updates
INFO: Checking for SecureDrop updates...
Fetching origin
INFO: Update needed
amnesia@amnesia:~/Persistent/securedrop$ git describe
0.10.0
amnesia@amnesia:~/Persistent/securedrop$ 

Expected Behavior

Should not say updated required.

Actual Behavior

Saying update needed.

Comments

Suggestions to fix, any other relevant information.

@redshiftzero
Copy link
Contributor

This impacts 0.10.0 and later:

amnesia@amnesia:~/Persistent/securedrop$ git tag -a 0.9.0
amnesia@amnesia:~/Persistent/securedrop$ ./securedrop-admin check_for_updates
INFO: Checking for SecureDrop updates...
Fetching origin
INFO: All updates applied
amnesia@amnesia:~/Persistent/securedrop$ git describe
0.9.0
amnesia@amnesia:~/Persistent/securedrop$ git tag -a 0.10.0
amnesia@amnesia:~/Persistent/securedrop$ ./securedrop-admin check_for_updates
INFO: Checking for SecureDrop updates...
Fetching origin
INFO: Update needed
amnesia@amnesia:~/Persistent/securedrop$ git describe
0.10.0

because the output of git tag (which is the subprocess call done in the update functionality) is not sorted:

0.1
0.10.0
0.2
0.2.1
0.3
0.3.1
0.3.10
0.3.11
0.3.12
0.3.2
0.3.3
0.3.4
0.3.5
0.3.6
0.3.7
0.3.7.post1
0.3.8
0.3.9
0.3pre
0.4
0.4.1
0.4.2
0.4.3
0.4.4
0.5
0.5.1
0.5.2
0.6
0.6-rc1
0.6-rc2
0.6-rc3
0.6-rc4
0.6-rc5
0.7.0
0.7.0-rc1
0.7.0-rc2
0.7.0-rc3
0.7.0-rc4
0.7.0-rc5
0.8-rc1
0.8.0
0.8.0-rc1
0.8.0-rc2
0.8.0-rc3
0.9.0

Ideally: We don't fix this and instead implement #3502

@redshiftzero redshiftzero added this to the 0.9 milestone Aug 20, 2018
@redshiftzero
Copy link
Contributor

Since we did not make progress on #3502 in this release cycle, this bug must be fixed in 0.9.0

@kushaldas
Copy link
Contributor Author

Implementing #3502 will take time and also not an easy task to implement and do QA a week before the release. For now I would suggest to sort the versions following semver sorting logic of setuptools and we will not need to install anything new. I will submit a PR on this.

kushaldas added a commit to kushaldas/securedrop that referenced this issue Aug 28, 2018
emkll pushed a commit that referenced this issue Aug 28, 2018
This is for
#3579

(cherry picked from commit 3b8fb8d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants