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

ENH(TEMP): disallow use of a known to be outdated version of dandi client #135

Closed
wants to merge 1 commit into from

Conversation

yarikoptic
Copy link
Member

Only if DANDI_ALLOW_OUTDATED env variable is set, it will be just a good old
warning. I wanted to provision some way to proceed in cases that some other
issue (connectivity, OS, whatnot) prevents people from using dandi cli version
checking

This is a band-aid toward upcoming "dandi-publish" RF until there is a way for a client to interrogate API about supported functionality.

…ient

Only if DANDI_ALLOW_OUTDATED env variable is set, it will be just a good old
warning.  I wanted to provision some way to proceed in cases that some other
issue (connectivity, OS, whatnot) prevents people from using dandi cli version
checking
@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #135 into master will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #135      +/-   ##
==========================================
- Coverage   64.77%   64.72%   -0.05%     
==========================================
  Files          37       37              
  Lines        2921     2923       +2     
==========================================
  Hits         1892     1892              
- Misses       1029     1031       +2     
Flag Coverage Δ
#unittests 64.72% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dandi/cli/command.py 65.33% <0.00%> (-1.79%) ⬇️

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 d4ef762...a67a047. Read the comment docs.

@yarikoptic
Copy link
Member Author

to test this, @satra, is there a way (env var, like ET_FORCE_CHECK) to force etelemetry a check (even if it did recently)?

@satra
Copy link
Member

satra commented Aug 4, 2020

don't have one at the moment (ET updates every 6 hours or so). i can manually delete the cache if needed. did not want to hand over cache refresh options to the world :)

# or external issues by merely disclosing its availability to effected users,
# while mandating users to update to the most recent version of the client
if not bool(os.environ.get("DANDI_ALLOW_OUTDATED", None)):
raise
lgr.warning(
"Failed to check for a more recent version available with etelemetry: %s",
Copy link
Member

Choose a reason for hiding this comment

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

this message seems more generic than perhaps we should use? you can use the flag raise_exception=True in the call to check_available_version and will return a RuntimeError if a bad version is running.

Copy link
Member Author

Choose a reason for hiding this comment

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

RuntimeError? submitted sensein/etelemetry-client#23

as for raise_exception=True - I should add it indeed but then, depending on etelemetry version I would not be reliably tell apart either it is outdated or some other exception has happened (there is sufficient amount of code outside of try/except in that function). I don't think we would like to stop on any exception etelemetry is throwing, but on that BadVersionException - so I will wait on destiny of that PR

@yarikoptic
Copy link
Member Author

I think we better just stick to the "deployment/server specific" handling of versions (than overall one as would be possible with ET), so I will close this PR in favor of #186

@yarikoptic yarikoptic closed this Aug 11, 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.

2 participants