Skip to content

Commit b7780f0

Browse files
authored
Merge pull request #3719 from buildkite/test-experiment-documentation
Test experiment documentation
2 parents e1137d4 + d7bfcfc commit b7780f0

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

EXPERIMENTS.md

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ After repository checkout, resolve `BUILDKITE_COMMIT` to a commit hash. This mak
3737

3838
**Status**: broadly useful, we'd like this to be the standard behaviour in 4.0. 👍👍
3939

40-
### `polyglot-hooks`
41-
42-
Allows the agent to run hooks written in languages other than bash. This enables the agent to run hooks written in any language, as long as the language has a runtime available on the agent. Polyglot hooks can be in interpreted languages, so long as they have a valid shebang, and the interpreter specified in the shebang is installed on the agent.
43-
44-
This experiment also allows the agent to run compiled binaries (such as those produced by Go, Rust, Zig, C et al.) as hooks, so long as they are executable.
45-
46-
Hooks are run in a subshell, so they can't modify the environment of the agent process. However, they can use the [job-api](#job-api) to modify the environment of the job.
47-
48-
Binary hooks are available on all platforms, but interpreted hooks are unfortunately unavailable on Windows, as Windows does not support shebangs.
49-
50-
**Status:** Experimental while we try to cover the various corner cases. We'll probably promote this to non-experiment soon™️.
51-
5240
### `agent-api`
5341

5442
This exposes a local API for interacting with the agent process.
@@ -58,19 +46,6 @@ The API is exposed via a Unix Domain Socket. The path to the socket is not avail
5846

5947
**Status:** Experimental while we iron out the API and test it out in the wild. We'll probably promote this to non-experiment soon™.
6048

61-
### `use-zzglob`
62-
63-
Uses a different library for resolving glob expressions used for `artifact upload`.
64-
The new glob library should resolve a few issues experienced with the old library:
65-
66-
- Because `**` is used to mean "zero or more path segments", `/**/` should match `/`.
67-
- Directories that cannot match the glob pattern shouldn't be walked while resolving the pattern. Failure to do this makes `artifact upload` difficult to use when run in a directory containing a mix of subdirectories with different permissions.
68-
- Failures to walk potential file paths should be reported individually.
69-
70-
The new library should handle all syntax supported by the old library, but because of the chance of incompatibilities and bugs, we're providing it via experiment only for now.
71-
72-
**Status:** Since using the old library causes problems, we hope to promote this to be the default soon™️.
73-
7449
### `pty-raw`
7550

7651
Set PTY to raw mode, to avoid mapping LF (\n) to CR,LF (\r\n) in job command output.
@@ -96,7 +71,7 @@ a cancelled job should appear as a failure, regardless of the OS the agent is ru
9671

9772
### `interpolation-prefers-runtime-env`
9873

99-
When interpolating the pipeline level environment block, a pipeline level environment variable could take precedence over environment variables depending on the ordering. This may contravene Buildkite's [documentation](https://buildkite.com/docs/pipelines/environment-variables#environment-variable-precedence) that suggests the Job runtime environment takes precedence over that defined by combining environment variables defined in a pipeline.
74+
When interpolating the pipeline level environment block, a pipeline level environment variable could take precedence over environment variables depending on the ordering. This may contravene Buildkite's [documentation](https://buildkite.com/docs/pipelines/environment-variables#environment-variable-precedence) that suggests the Job runtime environment takes precedence over that defined by combining environment variables defined in a pipeline.
10075

10176
We previously made this the default behaviour of the agent (as of v3.63.0) but have since reverted it.
10277

@@ -122,3 +97,15 @@ has a different effect depending on this experiment:
12297
- With `allow-artifact-path-traversal` enabled, `foo.txt` is downloaded to `../../foo.txt`.
12398

12499
**Status:** This experiment is an escape hatch for a security fix. While the new behaviour is more secure, it may break downloading of legitimately-uploaded artifacts.
100+
101+
### `descending-spawn-priority`
102+
103+
When using `--spawn` with `--spawn-with-priority`, the agent assigns ascending priorities to each spawned agent (1, 2, 3, ...). This experiment changes the priorities to be descending (-1, -2, -3, ...) instead. This helps jobs be assigned across all hosts in cases where the value of `--spawn` varies between hosts.
104+
105+
**Status:** Experimental as an escape hatch to default behaviour. Will soon be promoted to a regular flag.
106+
107+
### `propagate-agent-config-vars`
108+
109+
Prepends agent configuration variables (such as `BUILDKITE_GIT_*`, `BUILDKITE_SHELL`, `BUILDKITE_CANCEL_GRACE_PERIOD`, etc.) to the environment file used by the job runner. This is useful in environments like Docker where the agent configuration is not otherwise available to the job process.
110+
111+
**Status:** Experimental while we test the impact on job environments
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package experiments
2+
3+
import (
4+
"fmt"
5+
"os"
6+
"strings"
7+
"testing"
8+
)
9+
10+
func TestAvailableExperimentsDocumented(t *testing.T) {
11+
data, err := os.ReadFile("../../EXPERIMENTS.md")
12+
if err != nil {
13+
t.Fatalf("reading EXPERIMENTS.md: %v", err)
14+
}
15+
contents := string(data)
16+
17+
for name := range Available {
18+
heading := fmt.Sprintf("### `%s`", name)
19+
if !strings.Contains(contents, heading) {
20+
t.Errorf("available experiment %q is missing a %q section in EXPERIMENTS.md", name, heading)
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)