-
Notifications
You must be signed in to change notification settings - Fork 51
fix: dont show deploy screen when deploy is skipped #1585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import { ConfigIO } from '../../../lib'; | ||
| import { ensureDefaultDeploymentTarget } from './ensure-target'; | ||
| import { createHash } from 'node:crypto'; | ||
| import { readFile } from 'node:fs/promises'; | ||
| import { dirname, join } from 'node:path'; | ||
|
|
@@ -73,3 +74,22 @@ export async function canSkipDeploy(configIO: ConfigIO): Promise<boolean> { | |
| return false; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Checks whether a deploy is needed, handling target auto-population. | ||
| * Returns true if deploy can be safely skipped (no changes detected). | ||
| * Returns false if deploy is needed or if the check itself fails. | ||
| * | ||
| * This is the high-level entry point used by both the browser-mode gate | ||
| * (command.tsx) and the terminal-mode gate (DevScreen) to avoid showing | ||
| * deploy UI when there's nothing to deploy. | ||
| */ | ||
| export async function isDeploySkippable(): Promise<boolean> { | ||
| try { | ||
| const configIO = new ConfigIO(); | ||
| await ensureDefaultDeploymentTarget(configIO); | ||
| return await canSkipDeploy(configIO); | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In practice these are usually the same, but it's a footgun for any future caller and means this helper silently ignores the workingDir that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had initially passed in workingDir but it didnt work because config lives in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing test coverage. No tests were added for
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behavior change: harness pre-selection is lost on the new fast path.
For a harness-only project with a single harness and an up-to-date deploy, the previous flow rendered
DevScreen, which setselectedHarness = harnesses[0]and calledonLaunchBrowser({ harnessName }), sorunBrowserModewas invoked withharnessName: harnesses[0]and the web UI opened with that harness pre-selected.This new branch (
needsTuiDeploy === false) bypasses the TUI entirely and callsrunBrowserModewith noharnessNameandagentName: opts.runtime(which isundefinedfor harness-only projects). End result: the user lands in the web UI without anything pre-selected, even though we know exactly which harness they want.This also affects
--skip-deployfor harness-only projects, which now follows this same fast path.Two ways to fix:
command.tsxbefore callingrunBrowserMode(mirrorDevScreen's logic: whenisHarnessOnly && project.harnesses?.length === 1, passharnessName: project.harnesses[0].name).pickerResult-like selection here so both branches converge on the samerunBrowserModecall.Option 1 is the smaller change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed. web ui auto-selects the first option in dropdown if nothing is supplied