alan-turing-institute / data-safe-haven

https://data-safe-haven.readthedocs.io
BSD 3-Clause "New" or "Revised" License
50 stars 14 forks source link

Add more informative error messages to context commands #1916

Closed craddm closed 2 weeks ago

craddm commented 1 month ago

:white_check_mark: Checklist

:vertical_traffic_light: Depends on

N/A

:arrow_heading_up: Summary

Adds more informative messages when users try to use context functions without first having created a context file.

Catches that user is not logged in when trying to create or teardown context infrastructure.

WIP: Catch that no context infrastructure is deployed

:closed_umbrella: Related issues

Closes #1897 Closes #1899

:microscope: Tests

tested locally

JimMadge commented 4 weeks ago

@craddm Is this ready for review?

craddm commented 4 weeks ago

Pretty much - some tests failing as the commands now error when not logged in with Azure CLI. Do we know how to handle that?

JimMadge commented 3 weeks ago

@craddm Shall I pick up this one?

github-actions[bot] commented 3 weeks ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  data_safe_haven/commands
  context.py
  data_safe_haven/context_infrastructure
  infrastructure.py
  data_safe_haven/exceptions
  __init__.py
  data_safe_haven/external/api
  azure_api.py 143, 183, 262, 299, 333, 417, 475, 520, 541, 581, 625, 653, 690, 728, 772, 829, 845-849, 925, 953, 1006, 1038
  data_safe_haven/external/interface
  azure_authenticator.py 67-68
Project Total  

This report was generated by python-coverage-comment-action

jemrobinson commented 3 weeks ago

@JimMadge : are you still responsible for this PR? Happy to take it over if you're busy.