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

Fix check_for_updates #3429

Merged
merged 2 commits into from
May 15, 2018
Merged

Fix check_for_updates #3429

merged 2 commits into from
May 15, 2018

Conversation

redshiftzero
Copy link
Contributor

Status

Ready for review

Description of Changes

Fixes #3426.

Changes proposed in this pull request:

  • Strips newline from current_tag in securedrop-admin check_for_updates

Test plan

All of the following should be done in Tails.

No updates needed case

  1. Check out 0.6
  2. Apply the diff in admin/securedrop_admin/__init__.py to 0.6
  3. Run ./securedrop-admin check_for_updates

You should see that updates are not needed: INFO: All updates applied

Updates needed case

  1. Check out a random branch that is not this one
  2. Add a new tag locally that has a higher version number than the current prod version of SecureDrop, e.g. 0.7.0
  3. Switch back to this branch
  4. Run ./securedrop-admin check_for_updates

You should see that updates are needed: INFO: Update needed

Deployment

Will go out in workstation update

Checklist

If you made changes to securedrop-admin:

  • Linting and tests (make -C admin test) pass in the admin development container

@emkll emkll self-requested a review May 15, 2018 22:17
@conorsch
Copy link
Contributor

Apply the diff in admin/securedrop_admin/init.py to 0.6

Generating the requested diff via:

git diff 0.6..fix-check-for-updates -- admin/securedrop_admin/__init__.py

Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix @redshiftzero , my local testing confirms this fixes the issue.

  • For update needed: checked out 0.6, applied the patch and created a 0.6.1 tag locally. check_for_updates returned INFO: Update needed
  • For All updates applied: checked out 0.6, applied the patch and deleted the previously created tag. check for updates returned INFO: All updates applied

I'll let @conorsch confirm the fix prior to merging

@conorsch conorsch requested review from conorsch and emkll May 15, 2018 22:30
@conorsch
Copy link
Contributor

Also confirming resolution. Steps I took:

  1. Deleted old 0.7.0 tag.
  2. For no-updates-needed-case: checked out 0.6, used git diff 0.6..fix-check-for-updates -- admin/securedrop_admin/__init__.py to generate patch, applied patch on 0.6. Observed "INFO: All updates applied".
  3. For updates-needed-case: checked out develop, branched to there-is-no-branch, tagged as 0.7.0 locally (unsigned), hopped back to feature branch fix-check-for-updates. Upon rerunning, observed "INFO: Update needed".

LGTM!

Copy link
Contributor

@conorsch conorsch left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

💯

@ghost
Copy link

ghost commented May 15, 2018

@redshiftzero no need for me to approve but just wanted to support the effort. 🍿 :-P

@codecov-io
Copy link

Codecov Report

Merging #3429 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3429   +/-   ##
========================================
  Coverage    85.87%   85.87%           
========================================
  Files           34       34           
  Lines         2167     2167           
  Branches       241      241           
========================================
  Hits          1861     1861           
  Misses         250      250           
  Partials        56       56

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6e62d6...2bffcef. Read the comment docs.

@redshiftzero redshiftzero merged commit b0c9d68 into develop May 15, 2018
@redshiftzero redshiftzero deleted the fix-check-for-updates branch May 15, 2018 22:59
@redshiftzero redshiftzero mentioned this pull request May 15, 2018
1 task
redshiftzero added a commit that referenced this pull request May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants