Skip to content

🐛 fix(autodetect): treat empty env var as not detected - #331

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-330
Oct 24, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-330

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #330

Bug

An environment variable set to an empty string (e.g., EDITOR=) was treated as a filled value, overriding template defaults ({{EDITOR=vim}}) and suppressing interactive prompts.

Fix

In src/autodetect.ts, updated the env fallback to treat empty strings the same as undefined values, matching the behavior of explicit --FOO= flags and git detectors (see #91).

Changes

  • Modified autodetect() to return undefined for empty env vars
  • Added test in src/autodetect.test.ts verifying empty vars are treated as not detected
  • Added changelog fragment at changelog.d/fixed-autodetect-empty-env.md
  • Regenerated dist/ files (dist/autodetect.js, .js.map, and test outputs)

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 24, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 24, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 24, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed — no findings from this perspective.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed — no findings from this perspective.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read src/autodetect.ts at 710b801 and its three callers (src/resolver.ts:137, src/commands.ts:145, src/ui.ts:45). The new value === '' check at src/autodetect.ts:126 makes the env fallback match what the git detectors already do (git() returns out || undefined, src/autodetect.ts:26), so an EDITOR= now falls through to the {{EDITOR=vim}} default at resolver.ts:144 and to the interactive prompt at resolver.ts:151 instead of resolving to ''. Rebuilt locally: dist/ is in sync with src/ (clean git status -- dist/) and npm test passes 462/462. Looks correct to me.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1

@hivecommons-hive
hivecommons-hive Bot merged commit 3e42ff9 into main Oct 24, 2026
14 of 15 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-330 branch October 24, 2026 18:27
@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#331710b801` sha256:52ebaf737ff4d2ab4bad75a4389bc6a9e89ac1131a680ee96a924d723c96555e — download from the dashboard or `hivectl review evidence #331`.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] autodetect: empty environment variable ('FOO=') overrides template default and suppresses prompt

0 participants