Skip to content

fix(runtime): treat null env as run mismatch - #35

Merged
roodboi merged 1 commit into
mainfrom
dimitri/fix-runtime-null-env-mismatch
Mar 31, 2026
Merged

fix(runtime): treat null env as run mismatch#35
roodboi merged 1 commit into
mainfrom
dimitri/fix-runtime-null-env-mismatch

Conversation

@roodboi

@roodboi roodboi commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • treat a stored base env (null) as a mismatch when hack run --env ... targets a different overlay
  • keep --no-deps disabled unless the live stack env matches the requested env
  • add a regression test for base-vs-overlay run behavior

Verification

  • bun test tests/project-run-command.test.ts
  • bun run typecheck
  • bun x ultracite check src/commands/project.ts tests/project-run-command.test.ts

@changeset-bot

changeset-bot Bot commented Mar 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3a0dd44

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@roodboi
roodboi merged commit 96a2818 into main Mar 31, 2026
3 checks passed
@roodboi
roodboi deleted the dimitri/fix-runtime-null-env-mismatch branch March 31, 2026 21:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a0dd44e80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/project.ts
runtimeState?.envName !== null &&
runtimeState?.envName !== opts.requestedEnvName
) {
if (runtimeState && runtimeState.envName !== opts.requestedEnvName) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compare runtime env against effective run env

The new mismatch check treats any stored non-null runtime env as incompatible when --env is omitted, because handleRun passes requestedEnvName as envName ?? null and resolveComposeEnvOverrides can still select a non-base default overlay. In that common env.defaultOverlay case, this condition makes hack run stop using --no-deps even when the live stack env actually matches the effective env, causing unnecessary dependency startup on every run.

Useful? React with 👍 / 👎.

roodboi pushed a commit that referenced this pull request Mar 31, 2026
## <small>2.0.2 (2026-03-31)</small>

* Merge pull request #35 from hack-dance/dimitri/fix-runtime-null-env-mismatch ([96a2818](96a2818)), closes [#35](#35)
* fix(runtime): treat null env as run mismatch ([3a0dd44](3a0dd44))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant