Skip to content

Commit 0d495be

Browse files
authored
chore(build): add opt-in experimental build flag (#5005)
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent ee8457d commit 0d495be

15 files changed

Lines changed: 43 additions & 10 deletions

File tree

‎.agents/skills/release-captain/SKILL.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ tag, or start a second `Pre-release` run for a tag; it has no concurrency guard.
4646
repository must exist and Actions must have a `BUF_TOKEN` secret with write
4747
access. A failed Buf push fails the release run; follow Recovery before
4848
rerunning the failed publication job.
49+
- Pre-release and stable builds leave the `experimental` feature disabled. Release
50+
Dev enables it through `experimental: true`. Normal workspace builds, lint,
51+
and tests enable `experimental` without separate CI lanes for development features.
4952

5053
## Setup
5154

‎.github/workflows/branch-checks.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ jobs:
318318
- name: Lint
319319
shell: nix develop -c bash -euo pipefail {0}
320320
run: |
321-
cargo clippy --locked --workspace --all-targets -- -D warnings
321+
cargo clippy --locked --workspace --all-targets --features experimental -- -D warnings
322322
cargo clippy --locked --manifest-path e2e/rust/Cargo.toml --all-targets -- -D warnings
323323
cargo clippy --locked --manifest-path examples/governance-interceptor/Cargo.toml --all-targets -- -D warnings
324324
cargo clippy --locked --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all-targets -- -D warnings
@@ -413,7 +413,7 @@ jobs:
413413
env:
414414
OPENSHELL_TELEMETRY_ENABLED: "false"
415415
run: |
416-
cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support
416+
cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support,experimental
417417
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml
418418
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/testkit/Cargo.toml
419419
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/tmachine/Cargo.toml

‎.github/workflows/branch-e2e.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ jobs:
127127
with:
128128
checkout-ref: ${{ needs.pr_metadata.outputs.sha }}
129129
cargo-version: ${{ needs.version.outputs.cargo }}
130+
experimental: true
130131
secrets:
131132
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
132133

@@ -138,6 +139,7 @@ jobs:
138139
with:
139140
checkout-ref: ${{ needs.pr_metadata.outputs.sha }}
140141
cargo-version: ${{ needs.version.outputs.cargo }}
142+
experimental: true
141143
secrets:
142144
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
143145

‎.github/workflows/build-binaries-linux.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ on:
1717
required: false
1818
type: string
1919
default: ""
20+
experimental:
21+
description: Enable the gateway and supervisor experimental feature flag
22+
required: false
23+
type: boolean
24+
default: false
2025
secrets:
2126
CACHIX_AUTH_TOKEN:
2227
required: true
@@ -81,6 +86,7 @@ jobs:
8186
env:
8287
PACKAGE: openshell-gateway
8388
BINARY: openshell-gateway
89+
EXTRA_CARGO_FLAGS: ${{ inputs.experimental && '--features experimental' || '' }}
8490
strategy:
8591
matrix:
8692
include:
@@ -97,6 +103,8 @@ jobs:
97103
env:
98104
PACKAGE: ${{ matrix.package }}
99105
BINARY: ${{ matrix.binary }}
106+
# Only supervisor entries define the experimental feature flag.
107+
EXTRA_CARGO_FLAGS: ${{ matrix.package == 'openshell-supervisor' && inputs.experimental && '--features experimental' || '' }}
100108
strategy:
101109
matrix:
102110
include:

‎.github/workflows/build-binaries-macos.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ on:
1717
required: false
1818
type: string
1919
default: ""
20+
experimental:
21+
description: Enable the gateway and supervisor experimental feature flag
22+
required: false
23+
type: boolean
24+
default: false
2025
secrets:
2126
CACHIX_AUTH_TOKEN:
2227
required: true
@@ -61,3 +66,4 @@ jobs:
6166
triple: ${{ matrix.triple }}
6267
cargo-version: ${{ inputs.cargo-version }}
6368
supervisor-image-tag: ${{ inputs.supervisor-image-tag }}
69+
extra-cargo-flags: ${{ (matrix.package == 'openshell-gateway' || matrix.package == 'openshell-supervisor') && inputs.experimental && '--features experimental' || '' }}

‎.github/workflows/release-dev.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
cargo-version: ${{ needs.compute-versions.outputs.cargo_version }}
7373
supervisor-image-tag: dev
7474
checkout-ref: ${{ github.sha }}
75+
experimental: true
7576
secrets:
7677
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
7778

@@ -84,6 +85,7 @@ jobs:
8485
cargo-version: ${{ needs.compute-versions.outputs.cargo_version }}
8586
supervisor-image-tag: dev
8687
checkout-ref: ${{ github.sha }}
88+
experimental: true
8789
secrets:
8890
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
8991

‎.github/workflows/rust-cache.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
shell: nix develop -c bash -euo pipefail {0}
6464
run: |
6565
cargo test --locked -p openshell-crypto --no-default-features --test independent_backend --no-run
66-
cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support --no-run
66+
cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support,experimental --no-run
6767
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --no-run
6868
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/testkit/Cargo.toml --no-run
6969

‎CI.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,9 @@ Maintainers should add ready PRs to the queue rather than pressing a direct merg
698698

699699
| File | Role |
700700
|---|---|
701-
| `.github/workflows/branch-checks.yml` | Required non-E2E checks. Triggers on `pull_request` and on `merge_group` for queued merges. |
701+
| `.github/workflows/branch-checks.yml` | Required non-E2E checks. Triggers on `pull_request` and on `merge_group` for queued merges. Rust lint and tests run once with the development configuration (`--features experimental`). |
702702
| `.github/workflows/branch-e2e.yml` | Standard, Kubernetes HA, Kubernetes credential-driver, and continuity E2E. PRs use the `test:e2e`, `test:e2e-kubernetes`, and `test:e2e:continuity` labels; merge groups do not run E2E. Jobs load the images this run builds from workflow artifacts, so fork PRs need no registry write access. |
703-
| `.github/workflows/build-binaries-{linux,macos}.yml`, `build-vm-driver-{linux,macos}.yml` | Shared per-platform binary matrices used by branch and release workflows. Each platform is its own workflow, so a consumer depends only on the platforms it needs. The VM driver remains separate because its build consumes the runtime binaries. Its build steps stay inline rather than in a local action because release builds check out the release tag, which may predate the action. |
703+
| `.github/workflows/build-binaries-{linux,macos}.yml`, `build-vm-driver-{linux,macos}.yml` | Shared per-platform binary matrices used by branch and release workflows. Each platform is its own workflow, so a consumer depends only on the platforms it needs. The VM driver remains separate because its build consumes the runtime binaries. Its build steps stay inline rather than in a local action because release builds check out the release tag, which may predate the action. `experimental: true` selects `--features experimental` for the gateway and supervisor; Release Dev and branch E2E enable it, while prerelease and stable builds use the default of `false`. |
704704
| `.github/workflows/build-images.yml` | Builds multi-platform images and uploads them as OCI archives plus per-platform Docker archives for E2E. Release callers also push them; Branch E2E Checks does not. |
705705
| `.github/actions/load-e2e-images` | Downloads the per-platform Docker archives and loads them into Docker, Podman, or kind, so E2E jobs never pull OpenShell images from a registry. |
706706
| `.github/workflows/package-release-binaries.yml` | Packages raw build artifacts into release tarballs without rebuilding them. |

‎CONTRIBUTING.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,12 @@ mise trust
346346
mise run gateway
347347
```
348348

349+
The workspace build, check, lint, and test tasks (`build:rust:workspace`,
350+
`rust:check`, `rust:lint`, `test:rust`) and CI Branch Checks enable the
351+
`experimental` feature flag. Standalone launchers such as `mise run gateway`
352+
and direct Cargo builds leave it off unless you pass `--features experimental`;
353+
prerelease and stable builds leave it off as well.
354+
349355
## Building the `openshell` CLI
350356

351357
Inside this repository, `openshell` is a local shortcut script at `scripts/bin/openshell`. The script will

‎crates/openshell-gateway/Cargo.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ openshell-driver-mxc = { path = "../openshell-driver-mxc", optional = true }
4141

4242
[features]
4343
default = ["telemetry", "in-tree-compute-drivers"]
44+
# Opt-in bundle for experimental features; stable builds leave it off.
45+
experimental = ["openshell-server/experimental"]
4446
in-tree-compute-drivers = [
4547
"compute-driver-docker",
4648
"compute-driver-kubernetes",

0 commit comments

Comments
 (0)