René's URL Explorer Experiment


Title: fix(cli): match TS secrets precedence and --remove-existing-container failure by aledbf · Pull Request #73 · spin-stack/devcontainer-cli · GitHub

Open Graph Title: fix(cli): match TS secrets precedence and --remove-existing-container failure by aledbf · Pull Request #73 · spin-stack/devcontainer-cli

X Title: fix(cli): match TS secrets precedence and --remove-existing-container failure by aledbf · Pull Request #73 · spin-stack/devcontainer-cli

Description: Two drifts from the reference Dev Container CLI v0.90.0. 1. --secrets-file values vs remoteEnv TS: every lifecycle hook runs with { ...remoteEnv, ...secrets } (injectHeadless.ts runLifecycleCommand), where remoteEnv is probeRemoteEnv's { ...shellEnv, ...params.remoteEnv, ...config.remoteEnv }. Precedence, lowest to highest: probed env, --remote-env, config remoteEnv, secrets. This applies to up and run-user-commands (dotfiles also get { ...remoteEnv, ...secrets }). exec and set-up take no secrets file. Before: Go put the secrets before --remote-env and the config's remoteEnv, so either one hid a secret of the same name. After: secrets go last, so they win. The two near-identical builders (hookRemoteEnv in up.go and lifecycleRemoteEnv in run_user_commands.go) are now one, hookRemoteEnv(probed, remoteEnvs, cfgRemoteEnv, secrets). set-up passes no secrets, as before. 2. up --remove-existing-container TS: findExistingContainer (singleContainer.ts) and openDockerComposeDevContainer (dockerCompose.ts) wrap removeContainer in output.start/output.stop with the text Removing Existing Container (Compose: Removing existing container.). A failure rejects with Command failed: rm -f , which the setup catch turns into ContainerError("An error occurred setting up the container."). It carries the container ID only for Compose, where container is already assigned. up prints the error JSON and exits 1. Before: Go wrote an info line Removing existing container ..., ignored the removal error (_ = …), and went on. After: Go emits the same start/stop pair (no stop on failure, as in TS) and fails up with the same error JSON and exit 1. The engine error stays wrapped for errors.Is/As. The documented divergence (#844, docs/DIVERGENCES.md) is unchanged: the removal still happens before initializeCommand and the disallowed-Features check. Tests TestHookRemoteEnvOrdersLaterSourcesLast (updated): a secret beats --remote-env and the config's remoteEnv of the same name, and the config's remoteEnv beats --remote-env. Replaces TestLifecycleRemoteEnvOrder, whose function was folded in. Before this change both tests asserted the old order. TestRemoveExistingContainer: for image and Compose configs, success emits the start/stop pair. Failure emits only start and returns the TS error output (message, description, containerId only for Compose, --docker-path honored), wrapping the daemon error. New runtime parity cases up.secrets-override-remote-env-success and run-user-commands.secrets-override-remote-env-success: a hook prints TOKEN (set by secrets, --remote-env, and config remoteEnv) and CONFIG_WINS (set by --remote-env and config remoteEnv). Against an origin/main binary both cases fail with config/config vs TS SecretValue1/config. With this change both match. No parity case covers a failing removal: Go removes through the Engine API, so a --docker-path wrapper cannot make only Go's removal fail. The unit test covers it. Checks (all run from the branch worktree) go build ./...: ok go tool task lint: ok BASE=origin/main go tool task mutate: 3 refused, 0 survived TMPDIR=/var/tmp/ go tool task test:race: ok go tool task parity:contract: 114 matched. The 2 failures, read-configuration.features-configuration-local-feature-{key-order,metadata}-success, come from a stray /tmp/.git on the dev machine and are unrelated. go tool task test:e2e: ok PARITY_COMMAND=up,run-user-commands go tool task parity:runtime: 109 matched, 22 failed, 4 arm64 skipped. Locally the stray /tmp/.git changes remoteWorkspaceFolder for workspaces under /tmp: 17 of the 21 pre-existing failures also fail with an origin/main binary (same /tmp symptom, plus up.compose-with-name-success). 2 passed when rerun alone. One was a Go timeout under load, the other a cleanup race. up.image-reuses-base-image-success also passed when rerun alone. up.compose-without-workspace-folder-uses-root-success is flaky on both binaries. The TS and Go sides share a Compose project name, and Go sometimes finds the TS side's container while it is being removed ("container is marked for removal"). It reproduces with the origin/main binary. The two new cases hit the same /tmp symptom here. With their workspace moved to /var/tmp they match, and they fail against origin/main as described above. 🤖 Generated with Claude Code

Open Graph Description: Two drifts from the reference Dev Container CLI v0.90.0. 1. --secrets-file values vs remoteEnv TS: every lifecycle hook runs with { ...remoteEnv, ...secrets } (injectHeadless.ts runLifecycleCommand...

X Description: Two drifts from the reference Dev Container CLI v0.90.0. 1. --secrets-file values vs remoteEnv TS: every lifecycle hook runs with { ...remoteEnv, ...secrets } (injectHeadless.ts runLifecycleCommand...

Opengraph URL: https://github.com/spin-stack/devcontainer-cli/pull/73

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c6f0d876-b43e-77eb-fc93-a051f4112103
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB84E:EECB:857650:C2F701:6AF6EA6A
html-safe-nonce49ce0a778f80324e6691ec5222bf662ce7ce4afada8698fb44842be5a24e274d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODRFOkVFQ0I6ODU3NjUwOkMyRjcwMTo2QUY2RUE2QSIsInZpc2l0b3JfaWQiOiI5MTc0OTA1MzU1NjQzNTc4OTg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc6b08eda3610519969b6891bacda304e4d9f4647ea18ca3027a459b39860ce9c
hovercard-subject-tagpull_request:5290384490
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/spin-stack/devcontainer-cli/pull/73/files
twitter:imagehttps://avatars.githubusercontent.com/u/161571?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/161571?s=400&v=4
og:image:altTwo drifts from the reference Dev Container CLI v0.90.0. 1. --secrets-file values vs remoteEnv TS: every lifecycle hook runs with { ...remoteEnv, ...secrets } (injectHeadless.ts runLifecycleCommand...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None19e5351f91f68268b5c88c922504b59eeb230085b5d92546247a28dff0c02812
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/spin-stack/devcontainer-cli git https://github.com/spin-stack/devcontainer-cli.git
octolytics-dimension-user_id253817182
octolytics-dimension-user_loginspin-stack
octolytics-dimension-repository_id1297553254
octolytics-dimension-repository_nwospin-stack/devcontainer-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1297553254
octolytics-dimension-repository_network_root_nwospin-stack/devcontainer-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release25a4eb53c5e867cec09489ddfc8dc9916f51d01e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/spin-stack/devcontainer-cli/pull/73/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fspin-stack%2Fdevcontainer-cli%2Fpull%2F73%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fspin-stack%2Fdevcontainer-cli%2Fpull%2F73%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=spin-stack%2Fdevcontainer-cli
Reloadhttps://github.com/spin-stack/devcontainer-cli/pull/73/files
Reloadhttps://github.com/spin-stack/devcontainer-cli/pull/73/files
Reloadhttps://github.com/spin-stack/devcontainer-cli/pull/73/files
spin-stackhttps://github.com/spin-stack
devcontainer-clihttps://github.com/spin-stack/devcontainer-cli
Codehttps://github.com/spin-stack/devcontainer-cli
Issueshttps://github.com/spin-stack/devcontainer-cli/issues
Pull requests3 (3)https://github.com/spin-stack/devcontainer-cli/pulls
Actionshttps://github.com/spin-stack/devcontainer-cli/actions
Security and qualityhttps://github.com/spin-stack/devcontainer-cli/security
Insightshttps://github.com/spin-stack/devcontainer-cli/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fspin-stack%2Fdevcontainer-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fspin-stack%2Fdevcontainer-cli%2Fissues%2Fnew%2Fchoose
aledbfhttps://github.com/aledbf
mainhttps://github.com/spin-stack/devcontainer-cli/tree/main
secrets-remoteenv-and-removalhttps://github.com/spin-stack/devcontainer-cli/tree/secrets-remoteenv-and-removal
Conversation 0 https://github.com/spin-stack/devcontainer-cli/pull/73
Commits 2 https://github.com/spin-stack/devcontainer-cli/pull/73/commits
Checks 13 https://github.com/spin-stack/devcontainer-cli/pull/73/checks
Files changed https://github.com/spin-stack/devcontainer-cli/pull/73/files
Please reload this pagehttps://github.com/spin-stack/devcontainer-cli/pull/73/files
fix(cli): match TS secrets precedence and --remove-existing-container failure https://github.com/spin-stack/devcontainer-cli/pull/73/files#top
Show all changes 2 commits https://github.com/spin-stack/devcontainer-cli/pull/73/files
cf21a9c fix(cli): let --secrets-file values win over remoteEnv in hooks aledbf Nov 13, 2026 https://github.com/spin-stack/devcontainer-cli/pull/73/commits/cf21a9c86b3fa387bef9cc6c52d1fb90adb9c1cb
33d1477 fix(cli): report a failed --remove-existing-container removal aledbf Nov 13, 2026 https://github.com/spin-stack/devcontainer-cli/pull/73/commits/33d147765b4178e44b9959ff447ad34adbedac28
Clear filters https://github.com/spin-stack/devcontainer-cli/pull/73/files
Please reload this pagehttps://github.com/spin-stack/devcontainer-cli/pull/73/files
Please reload this pagehttps://github.com/spin-stack/devcontainer-cli/pull/73/files
parity-matrix.yaml https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-dd6a00d02f71b8af40e9134f99072205175e8014a85550c5a476d653587e7d3e
run_user_commands.go https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-a74bd290e9ac427d62878996767f3e91fc78c8a5e7a71882c108477eeb69a013
run_user_commands_held_test.go https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-0cec303d3232076c21a1f8434cc674674615f39287d9c7244d6cdcb72784c23c
setup.go https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-ba05ea7924ec410cb264a96e1c56d2d4547ceba28d177fa9841a134f676210b3
up.go https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-e4159340a020b2901eae16cf8957d0bea9af63523ad9754862feb45a400e2190
up_held_test.go https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-eedb480e3b098326710a9b40f7037250e07336c52f0e19066e34c743435ebefc
docs/parity/parity-matrix.yamlhttps://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-dd6a00d02f71b8af40e9134f99072205175e8014a85550c5a476d653587e7d3e
View file https://github.com/spin-stack/devcontainer-cli/blob/33d147765b4178e44b9959ff447ad34adbedac28/docs/parity/parity-matrix.yaml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/spin-stack/devcontainer-cli/pull/73/{{ revealButtonHref }}
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-dd6a00d02f71b8af40e9134f99072205175e8014a85550c5a476d653587e7d3e
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-dd6a00d02f71b8af40e9134f99072205175e8014a85550c5a476d653587e7d3e
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-dd6a00d02f71b8af40e9134f99072205175e8014a85550c5a476d653587e7d3e
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-dd6a00d02f71b8af40e9134f99072205175e8014a85550c5a476d653587e7d3e
internal/cli/run_user_commands.gohttps://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-a74bd290e9ac427d62878996767f3e91fc78c8a5e7a71882c108477eeb69a013
View file https://github.com/spin-stack/devcontainer-cli/blob/33d147765b4178e44b9959ff447ad34adbedac28/internal/cli/run_user_commands.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/spin-stack/devcontainer-cli/pull/73/{{ revealButtonHref }}
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-a74bd290e9ac427d62878996767f3e91fc78c8a5e7a71882c108477eeb69a013
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-a74bd290e9ac427d62878996767f3e91fc78c8a5e7a71882c108477eeb69a013
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-a74bd290e9ac427d62878996767f3e91fc78c8a5e7a71882c108477eeb69a013
internal/cli/run_user_commands_held_test.gohttps://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-0cec303d3232076c21a1f8434cc674674615f39287d9c7244d6cdcb72784c23c
View file https://github.com/spin-stack/devcontainer-cli/blob/33d147765b4178e44b9959ff447ad34adbedac28/internal/cli/run_user_commands_held_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/spin-stack/devcontainer-cli/pull/73/{{ revealButtonHref }}
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-0cec303d3232076c21a1f8434cc674674615f39287d9c7244d6cdcb72784c23c
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-0cec303d3232076c21a1f8434cc674674615f39287d9c7244d6cdcb72784c23c
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-0cec303d3232076c21a1f8434cc674674615f39287d9c7244d6cdcb72784c23c
internal/cli/setup.gohttps://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-ba05ea7924ec410cb264a96e1c56d2d4547ceba28d177fa9841a134f676210b3
View file https://github.com/spin-stack/devcontainer-cli/blob/33d147765b4178e44b9959ff447ad34adbedac28/internal/cli/setup.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/spin-stack/devcontainer-cli/pull/73/{{ revealButtonHref }}
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-ba05ea7924ec410cb264a96e1c56d2d4547ceba28d177fa9841a134f676210b3
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-ba05ea7924ec410cb264a96e1c56d2d4547ceba28d177fa9841a134f676210b3
internal/cli/up.gohttps://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-e4159340a020b2901eae16cf8957d0bea9af63523ad9754862feb45a400e2190
View file https://github.com/spin-stack/devcontainer-cli/blob/33d147765b4178e44b9959ff447ad34adbedac28/internal/cli/up.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/spin-stack/devcontainer-cli/pull/73/{{ revealButtonHref }}
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-e4159340a020b2901eae16cf8957d0bea9af63523ad9754862feb45a400e2190
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-e4159340a020b2901eae16cf8957d0bea9af63523ad9754862feb45a400e2190
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-e4159340a020b2901eae16cf8957d0bea9af63523ad9754862feb45a400e2190
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-e4159340a020b2901eae16cf8957d0bea9af63523ad9754862feb45a400e2190
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-e4159340a020b2901eae16cf8957d0bea9af63523ad9754862feb45a400e2190
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-e4159340a020b2901eae16cf8957d0bea9af63523ad9754862feb45a400e2190
internal/cli/up_held_test.gohttps://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-eedb480e3b098326710a9b40f7037250e07336c52f0e19066e34c743435ebefc
View file https://github.com/spin-stack/devcontainer-cli/blob/33d147765b4178e44b9959ff447ad34adbedac28/internal/cli/up_held_test.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/spin-stack/devcontainer-cli/pull/73/{{ revealButtonHref }}
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-eedb480e3b098326710a9b40f7037250e07336c52f0e19066e34c743435ebefc
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-eedb480e3b098326710a9b40f7037250e07336c52f0e19066e34c743435ebefc
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-eedb480e3b098326710a9b40f7037250e07336c52f0e19066e34c743435ebefc
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-eedb480e3b098326710a9b40f7037250e07336c52f0e19066e34c743435ebefc
https://github.com/spin-stack/devcontainer-cli/pull/73/files#diff-eedb480e3b098326710a9b40f7037250e07336c52f0e19066e34c743435ebefc
Please reload this pagehttps://github.com/spin-stack/devcontainer-cli/pull/73/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.