Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Environments: Updated Dev Box State logic - #139

Merged
Huzaifa Danish (huzaifa-d) merged 3 commits into
mainfrom
user/modanish/DevBoxStateUpdate2
Mar 14, 2024
Merged

Environments: Updated Dev Box State logic#139
Huzaifa Danish (huzaifa-d) merged 3 commits into
mainfrom
user/modanish/DevBoxStateUpdate2

Conversation

@huzaifa-d

@huzaifa-d Huzaifa Danish (huzaifa-d) commented Mar 13, 2024

Copy link
Copy Markdown
Contributor

Summary of the pull request

On the Environments page performing any operation on a dev box which resulted in a long running operation changed the status of the UI which was lost on pressing Sync. This has been fixed in the PR and now uses the same logic used by the Dev Box webapp to compute the status.

Validation steps performed

Performed starting, stopping, restarting and deleting to make sure the strings were correct.

image

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

Comment thread src/AzureExtension/DevBox/Constants.cs
Comment thread src/AzureExtension/DevBox/DevBoxInstance.cs
@bbonaby

Branden Bonaby (bbonaby) commented Mar 13, 2024

Copy link
Copy Markdown
Contributor

Nice, (not blocking) I think this fixes half the issue. I think the next issue is monitoring an operation done outside of Dev Home. E.g when the user clicks the start operation button. In Dev Homes UI, we update the state to "Starting", monitor the operation and then update the state in Dev Home when its complete.

However, if the user uses the Dev Portal website and clicks start, then clicks Dev Home's sync button. I believe with this change the state will correctly stay as "Starting" but the issue is we're not monitoring that operation since it didn't happen from our side.

I didn't have time to fully explore this option while I was updating the extension but I found that there was an API in preview

  1. https://github.com/Azure/azure-rest-api-specs/blob/0aa7ac99172545656aaae911ce13ad572ff0fac1/specification/devcenter/data-plane/Microsoft.DevCenter/preview/2023-10-01-preview/devbox.json#L1544
    1.1. https://github.com/Azure/azure-rest-api-specs/blob/main/specification/devcenter/data-plane/Microsoft.DevCenter/preview/2023-10-01-preview/examples/DevBoxOperations_List.json

that lists all operations for the last 90 days. We might be able to use this to get the latest operation and check whether its still in progress. If it is, then we can use the operation watcher to watch the operation and then update the state once it completes.

@huzaifa-d

Copy link
Copy Markdown
Contributor Author

I think monitoring an operation outside of Dev Home is a nice to have feature but not impearative. With this change, we are at parity with the web app and even the web app doesn't support outside monitoring.

Comment thread src/AzureExtension/DevBox/DevBoxInstance.cs Outdated
@huzaifa-d
Huzaifa Danish (huzaifa-d) deleted the user/modanish/DevBoxStateUpdate2 branch March 14, 2024 21:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants