Title: `coder show` incorrectly shows permanent resources as ephemeral. · Issue #1937 · coder/coder · GitHub
Open Graph Title: `coder show` incorrectly shows permanent resources as ephemeral. · Issue #1937 · coder/coder
X Title: `coder show` incorrectly shows permanent resources as ephemeral. · Issue #1937 · coder/coder
Description: OS Information OS: macOS Browser (if applicable): Architecture: coder --version: Coder v0.6.0-devel+56ec53d0 Steps to Reproduce Create a workspace with persistent resources (e.g. docker example with volume) coder show
Open Graph Description: OS Information OS: macOS Browser (if applicable): Architecture: coder --version: Coder v0.6.0-devel+56ec53d0 Steps to Reproduce Create a workspace with persistent resources (e.g. docker example wit...
X Description: OS Information OS: macOS Browser (if applicable): Architecture: coder --version: Coder v0.6.0-devel+56ec53d0 Steps to Reproduce Create a workspace with persistent resources (e.g. docker example wit...
Opengraph URL: https://github.com/coder/coder/issues/1937
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`coder show` incorrectly shows permanent resources as ephemeral.","articleBody":"## OS Information\r\n\r\n- OS: macOS\r\n- Browser (if applicable): \r\n- Architecture:\r\n- `coder --version`: Coder v0.6.0-devel+56ec53d0\r\n\r\n## Steps to Reproduce\r\n\r\n1. Create a workspace with persistent resources (e.g. docker example with volume)\r\n2. `coder show \u003cname>`\r\n\r\n## Expected\r\n\r\n`coder show` should list resources as permanent\r\n\r\n## Actual\r\n\r\n```\r\n% coder show test\r\n┌─────────────────────────────────────────────────────────────────┐\r\n│ RESOURCE STATUS ACCESS │\r\n├─────────────────────────────────────────────────────────────────┤\r\n│ docker_container.workspace ephemeral │\r\n│ └─ dev (linux, armv7) ⦾ connecting [7s] coder ssh test │\r\n├─────────────────────────────────────────────────────────────────┤\r\n│ docker_volume.home_volume ephemeral │\r\n└─────────────────────────────────────────────────────────────────┘\r\n```\r\n\r\n## Logs\r\n\r\n## Screenshot\r\n\r\n\u003c!-- Ideally provide a screenshot, gif, video or screen recording. -->\r\n\r\n## Notes\r\n\r\nWhat's going on here is that `coder show` is getting the resources for most recent build, which will only include resources at the most recent transition. Meanwhile, the CLI code derives the status of ephemeral / permanent based on whether there is a resource included for the stop transition. Since we only get start resources when querying the start job, the resources are always listed as ephemeral. You can see this clearly by stopping the workspace and then calling `coder show` again:\r\n\r\n```\r\n% coder show test\r\n┌───────────────────────────────────────────────┐\r\n│ RESOURCE STATUS ACCESS │\r\n├───────────────────────────────────────────────┤\r\n│ docker_volume.home_volume persistent │\r\n└───────────────────────────────────────────────┘\r\n```\r\n\r\nMore generally, I'm not sure \"status\" is the right word for ephemeral vs permanent, as typically object status implies something that can change.\r\n\r\nFinally, when we call `coder show`, I think users are going to be interested in not just whether the resource _would_ remain if the workspace were stopped (ephemeral vs permanent), but whether the resource _presently exists_.\r\n\r\n## Implementation notes:\r\nOptions\r\n1. Get out of the idea of predicting ephemeral vs persistent. Coder show just shows you what the current resources are\r\n2. Fix the identification of ephemeral vs persistent based on the templates \r\n3. Really fix this by rerunning the dry tunes every time the parameters for the workspace are changed. \r\n4. have `--dryrun` option and do the computation at that time. This would have the impact of not being 'predictive' in terms of ephemeral vs persistent. (separate ticket / feature)\r\n\r\n### Decision: Option 1\r\n\r\n## AC\r\ncoder show does not show a status anymore - only the current resources\r\ncoder template create only shows the start resources\r\ntests for the above\r\n\r\n","author":{"url":"https://github.com/spikecurtis","@type":"Person","name":"spikecurtis"},"datePublished":"2022-05-31T23:37:40Z","url":"https://github.com/coder/coder/issues/1937"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:00249997-c35b-df4d-770a-018ed55e6989 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB32:3DD488:1C98231:24456BF:6B015BC8 |
| html-safe-nonce | 20f4282aab441143a174da3b923cc13f9467554b477d7287bd760d1d89fef845 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjMyOjNERDQ4ODoxQzk4MjMxOjI0NDU2QkY6NkIwMTVCQzgiLCJ2aXNpdG9yX2lkIjoiMjIwNTM1NjQwOTk2MzUwMjUzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5e7e3291fb373246030fec6fc4a4cb05ba1c7720f6ed0025b60ec3d78fcb4c62 |
| hovercard-subject-tag | issue:1254532998 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/1937/issue_layout |
| twitter:image | https://opengraph.githubassets.com/60fc634580b74b1099cdd5673c4b278a4caee88a2a70d2edbbb2df141df828ae/coder/coder/issues/1937 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/60fc634580b74b1099cdd5673c4b278a4caee88a2a70d2edbbb2df141df828ae/coder/coder/issues/1937 |
| og:image:alt | OS Information OS: macOS Browser (if applicable): Architecture: coder --version: Coder v0.6.0-devel+56ec53d0 Steps to Reproduce Create a workspace with persistent resources (e.g. docker example wit... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | spikecurtis |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width