Skip to content

Commit 03e466e

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 9f76c92 commit 03e466e

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
@@ -130,6 +130,8 @@ const UpdateBuildSettingsFormSchema = z.object({
130130
.refine((val) => !val || val.length <= 500, {
131131
message: "Pre-build command must not exceed 500 characters",
132132
}),
133+
// Positive checkbox in the UI ("Use native build server"). It is checked by
134+
// default; we store the inverse as `disableNativeBuildServer`.
133135
useNativeBuildServer: z
134136
.string()
135137
.optional()
@@ -177,7 +179,8 @@ export const action = dashboardAction(
177179
installCommand: installCommand || undefined,
178180
preBuildCommand: preBuildCommand || undefined,
179181
triggerConfigFilePath: triggerConfigFilePath || undefined,
180-
useNativeBuildServer: useNativeBuildServer,
182+
// Native build server is the default, so we only persist the opt-out.
183+
disableNativeBuildServer: useNativeBuildServer ? undefined : true,
181184
});
182185

183186
if (resultOrFail.isErr()) {
@@ -379,6 +382,10 @@ export default function IntegrationsSettingsPage() {
379382

380383
<div>
381384
<Header2 spacing>Build settings</Header2>
385+
<Hint className="mb-2">
386+
These settings apply to GitHub-triggered deployments and deployments built with
387+
the native build server.
388+
</Hint>
382389
<div className="w-full rounded-sm border border-grid-dimmed p-4">
383390
<BuildSettingsForm buildSettings={buildSettings ?? {}} />
384391
</div>
@@ -426,21 +433,24 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
426433
const navigation = useNavigation();
427434

428435
const [hasBuildSettingsChanges, setHasBuildSettingsChanges] = useState(false);
436+
// The native build server is enabled by default; it's only off when the
437+
// project has explicitly opted out via `disableNativeBuildServer`.
438+
const nativeBuildServerEnabled = buildSettings?.disableNativeBuildServer !== true;
429439
const [buildSettingsValues, setBuildSettingsValues] = useState({
430440
preBuildCommand: buildSettings?.preBuildCommand || "",
431441
installCommand: buildSettings?.installCommand || "",
432442
triggerConfigFilePath: buildSettings?.triggerConfigFilePath || "",
433-
useNativeBuildServer: buildSettings?.useNativeBuildServer || false,
443+
useNativeBuildServer: nativeBuildServerEnabled,
434444
});
435445

436446
useEffect(() => {
437447
const hasChanges =
438448
buildSettingsValues.preBuildCommand !== (buildSettings?.preBuildCommand || "") ||
439449
buildSettingsValues.installCommand !== (buildSettings?.installCommand || "") ||
440450
buildSettingsValues.triggerConfigFilePath !== (buildSettings?.triggerConfigFilePath || "") ||
441-
buildSettingsValues.useNativeBuildServer !== (buildSettings?.useNativeBuildServer || false);
451+
buildSettingsValues.useNativeBuildServer !== nativeBuildServerEnabled;
442452
setHasBuildSettingsChanges(hasChanges);
443-
}, [buildSettingsValues, buildSettings]);
453+
}, [buildSettingsValues, buildSettings, nativeBuildServerEnabled]);
444454

445455
const [buildSettingsForm, fields] = useForm({
446456
id: "update-build-settings",
@@ -529,7 +539,7 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
529539
{...getInputProps(fields.useNativeBuildServer, { type: "checkbox" })}
530540
label="Use native build server"
531541
variant="simple/small"
532-
defaultChecked={buildSettings?.useNativeBuildServer || false}
542+
defaultChecked={nativeBuildServerEnabled}
533543
onChange={(isChecked) => {
534544
setBuildSettingsValues((prev) => ({
535545
...prev,
@@ -538,8 +548,8 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
538548
}}
539549
/>
540550
<Hint>
541-
Native build server builds do not rely on external build providers and will become the
542-
default in the future. Version 4.2.0 or newer is required.
551+
Native build server builds don't rely on external build providers and are used by
552+
default. Requires version 4.2.0 or newer.
543553
</Hint>
544554
<FormError id={fields.useNativeBuildServer.errorId}>
545555
{fields.useNativeBuildServer.errors}

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)