alan-turing-institute / data-safe-haven

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

List of SRE configs available in the current context #2129

Closed craddm closed 2 months ago

craddm commented 3 months ago

:white_check_mark: Checklist

:vertical_traffic_light: Depends on

:arrow_heading_up: Summary

Adds a command to list the available and deployed SRE configs within the currently selected context.

(data-safe-haven) deploydsh@0b11d89ae8c5:/workspaces/data-safe-haven$ dsh config available
You are logged into the Azure CLI as:                                                                                                      
        user: Matthew Craddock (1b2a59f2-f3ea-42e7-b8b8-aeea30572764)                                                                      
        tenant: turing.ac.uk (4395f4a7-e455-4f95-8a9f-1fbaef6384f9)                                                                        
Are these details correct? [y/n] (y): y
Loaded stack shm-turtles-sre-donatello.                                                                                                    
Loaded stack shm-turtles-sre-leonardo.                                                                                                     
Loaded stack shm-turtles-sre-shimazu.                                                                                                      
Available SRE configurations for context 'turtles':
┏━━━━━━━━━━━┳━━━━━━━━━━┓
┃ SRE Name  ┃ Deployed ┃
┡━━━━━━━━━━━╇━━━━━━━━━━┩
│ donatello │          │
│ leonardo  │ x        │
│ shimazu   │          │
└───────────┴──────────┘

:closed_umbrella: Related issues

Closes #1812

:microscope: Tests

Tested locally on existing contexts/SHMs

github-actions[bot] commented 3 months ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  data_safe_haven/commands
  config.py 99-103
  data_safe_haven/external/api
  azure_sdk.py 862-868
Project Total  

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

jemrobinson commented 3 months ago

I'm comfortable including this in release-v5.0.0 since it isn't changing any of the testable surface. Can you change the target @craddm ?

JimMadge commented 2 months ago

@craddm Is this ready to merge? Would you like another review?