Skip to content

Commit f141a4e

Browse files
authored
[Script Exit on Error] enable feature flag, and add stability advice to CICD docs (#1477)
## Summary Fixes #1457 This feature enables `set -e` in the generated shell files for the "scripts" and "init hooks" of Devbox. This feature has been running internally for a long time to power our CICD tests for the projects in `examples/`, and has been very useful in ensuring correctness. This may expose bugs in user code. While this results in `devbox version update` possibly leading to code that used to seemingly work previously now needing some fixes, we feel this is acceptable because: 1. We no longer auto-update Devbox. Users are intentionally updating when they are ready. 2. For CICD, they can pin the devbox-version for additional Stability. This PR updates the CICD docs to call this out. ## How was it tested? testscripts should pass
1 parent 62f25d0 commit f141a4e

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

docs/app/docs/continuous_integration/github_action.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ jobs:
4545
## Configuring the Action
4646
4747
See the [GitHub Marketplace page](https://github.com/marketplace/actions/devbox-installer) for the latest configuration settings and an example.
48+
49+
For stability over new features and bug fixes, consider pinning `devbox-version`. Remember to update this pinned version when you update your local Devbox via `devbox version update`.

internal/boxcli/featureflag/feature.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ type feature struct {
1919

2020
var features = map[string]*feature{}
2121

22+
// Prevent lint complaining about unused function
23+
//
24+
//nolint:unparam
2225
func disable(name string) *feature {
2326
if features[name] == nil {
2427
features[name] = &feature{name: name}
@@ -27,6 +30,9 @@ func disable(name string) *feature {
2730
return features[name]
2831
}
2932

33+
// Prevent lint complaining about unused function
34+
//
35+
//nolint:unparam
3036
func enable(name string) *feature {
3137
if features[name] == nil {
3238
features[name] = &feature{name: name}

internal/boxcli/featureflag/script_exit_on_error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ package featureflag
55

66
// ScriptExitOnError controls whether scripts defined in devbox.json
77
// and executed via `devbox run` should exit if any command within them errors.
8-
var ScriptExitOnError = disable("SCRIPT_EXIT_ON_ERROR")
8+
var ScriptExitOnError = enable("SCRIPT_EXIT_ON_ERROR")

0 commit comments

Comments
 (0)