Skip to content

Commit 49dd55e

Browse files
committed
feat(webapp): make native build server the default in build settings
Switch the native build server from opt-in to opt-out. It's now enabled by default and stored as a new `disableNativeBuildServer` opt-out key, so previously-saved `useNativeBuildServer: false` values aren't mistaken for deliberate opt-outs. Clarify in the UI that build settings apply to GitHub-triggered and native build server deployments.
1 parent d34b699 commit 49dd55e

3 files changed

Lines changed: 26 additions & 8 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Make the native build server the default in project build settings. It's now opt-out, stored as a new `disableNativeBuildServer` key. Also clarifies in the UI that build settings apply to GitHub-triggered and native build server deployments.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings.integrations/route.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ const UpdateBuildSettingsFormSchema = z.object({
112112
.refine((val) => !val || val.length <= 500, {
113113
message: "Pre-build command must not exceed 500 characters",
114114
}),
115+
// Positive checkbox in the UI ("Use native build server"). It is checked by
116+
// default; we store the inverse as `disableNativeBuildServer`.
115117
useNativeBuildServer: z
116118
.string()
117119
.optional()
@@ -152,7 +154,8 @@ export const action: ActionFunction = async ({ request, params }) => {
152154
installCommand: installCommand || undefined,
153155
preBuildCommand: preBuildCommand || undefined,
154156
triggerConfigFilePath: triggerConfigFilePath || undefined,
155-
useNativeBuildServer: useNativeBuildServer,
157+
// Native build server is the default, so we only persist the opt-out.
158+
disableNativeBuildServer: useNativeBuildServer ? undefined : true,
156159
});
157160

158161
if (resultOrFail.isErr()) {
@@ -321,6 +324,10 @@ export default function IntegrationsSettingsPage() {
321324

322325
<div>
323326
<Header2 spacing>Build settings</Header2>
327+
<Hint className="mb-2">
328+
These settings apply to GitHub-triggered deployments and deployments built with
329+
the native build server.
330+
</Hint>
324331
<div className="w-full rounded-sm border border-grid-dimmed p-4">
325332
<BuildSettingsForm buildSettings={buildSettings ?? {}} />
326333
</div>
@@ -362,21 +369,24 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
362369
const navigation = useNavigation();
363370

364371
const [hasBuildSettingsChanges, setHasBuildSettingsChanges] = useState(false);
372+
// The native build server is enabled by default; it's only off when the
373+
// project has explicitly opted out via `disableNativeBuildServer`.
374+
const nativeBuildServerEnabled = buildSettings?.disableNativeBuildServer !== true;
365375
const [buildSettingsValues, setBuildSettingsValues] = useState({
366376
preBuildCommand: buildSettings?.preBuildCommand || "",
367377
installCommand: buildSettings?.installCommand || "",
368378
triggerConfigFilePath: buildSettings?.triggerConfigFilePath || "",
369-
useNativeBuildServer: buildSettings?.useNativeBuildServer || false,
379+
useNativeBuildServer: nativeBuildServerEnabled,
370380
});
371381

372382
useEffect(() => {
373383
const hasChanges =
374384
buildSettingsValues.preBuildCommand !== (buildSettings?.preBuildCommand || "") ||
375385
buildSettingsValues.installCommand !== (buildSettings?.installCommand || "") ||
376386
buildSettingsValues.triggerConfigFilePath !== (buildSettings?.triggerConfigFilePath || "") ||
377-
buildSettingsValues.useNativeBuildServer !== (buildSettings?.useNativeBuildServer || false);
387+
buildSettingsValues.useNativeBuildServer !== nativeBuildServerEnabled;
378388
setHasBuildSettingsChanges(hasChanges);
379-
}, [buildSettingsValues, buildSettings]);
389+
}, [buildSettingsValues, buildSettings, nativeBuildServerEnabled]);
380390

381391
const [buildSettingsForm, fields] = useForm({
382392
id: "update-build-settings",
@@ -462,7 +472,7 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
462472
{...conform.input(fields.useNativeBuildServer, { type: "checkbox" })}
463473
label="Use native build server"
464474
variant="simple/small"
465-
defaultChecked={buildSettings?.useNativeBuildServer || false}
475+
defaultChecked={nativeBuildServerEnabled}
466476
onChange={(isChecked) => {
467477
setBuildSettingsValues((prev) => ({
468478
...prev,
@@ -471,8 +481,8 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
471481
}}
472482
/>
473483
<Hint>
474-
Native build server builds do not rely on external build providers and will become the
475-
default in the future. Version 4.2.0 or newer is required.
484+
Native build server builds don't rely on external build providers and are used by
485+
default. Requires version 4.2.0 or newer.
476486
</Hint>
477487
<FormError id={fields.useNativeBuildServer.errorId}>
478488
{fields.useNativeBuildServer.error}

apps/webapp/app/v3/buildSettings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export const BuildSettingsSchema = z.object({
44
triggerConfigFilePath: z.string().optional(),
55
installCommand: z.string().optional(),
66
preBuildCommand: z.string().optional(),
7-
useNativeBuildServer: z.boolean().optional(),
7+
// Opt-out flag: the native build server is used by default. Only set when a
8+
// project explicitly disables it. Absence means native build server enabled.
9+
disableNativeBuildServer: z.boolean().optional(),
810
});
911

1012
export type BuildSettings = z.infer<typeof BuildSettingsSchema>;

0 commit comments

Comments
 (0)