-
Notifications
You must be signed in to change notification settings - Fork 4
✨ (VoteSecure P1/3) Devcontainer and CI tooling #3129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
c9d97ed
3e47cc6
2f4fa03
13ea85d
d2a641c
166aa13
6d23825
df3112d
00bc8bd
cd2fb7e
59cc227
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # SPDX-FileCopyrightText: 2026 Sequent Tech Inc <legal@sequentech.io> | ||
| # | ||
| # SPDX-License-Identifier: AGPL-3.0-only | ||
|
|
||
| name: wbraid | ||
|
|
||
| # packages/wbraid is its own Cargo workspace (see packages/wbraid/PROVENANCE.md), | ||
| # so it gets its own workflow, scoped to changes under that subtree. | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'packages/wbraid/**' | ||
| - '.github/workflows/wbraid.yml' | ||
| - '.github/actions/setup-rust-tests/**' | ||
| push: | ||
| branches: [ 'main', 'release/[0-9]+.[0-9]+' ] | ||
| paths: | ||
| - 'packages/wbraid/**' | ||
| - '.github/workflows/wbraid.yml' | ||
| - '.github/actions/setup-rust-tests/**' | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: packages/wbraid | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Format and lint | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Rust | ||
| uses: ./.github/actions/setup-rust-tests | ||
| with: | ||
| cargo-build-name: wbraid-lint | ||
| cargo-build-path: packages/wbraid/target | ||
| cargo-lock-path: packages/wbraid/Cargo.lock | ||
| components: rustfmt, clippy | ||
|
|
||
| - name: Check formatting | ||
| run: cargo fmt -- --check | ||
|
|
||
| # vsc is a vendored fork with its own strict lint levels; its test modules | ||
| # and the shuffle_scaling example fail those upstream levels (identically | ||
| # on nightly, see PROVENANCE.md), and under -D warnings its warn-level | ||
| # lints (indexing_slicing) would fail too. --no-deps keeps -D warnings | ||
| # from leaking into vsc through the workspace wrapper; the second | ||
| # invocation lints vsc's lib at exactly the levels upstream chose. | ||
| - name: Clippy (workspace except vsc, all targets) | ||
| run: cargo clippy --workspace --exclude vsc --all-targets --no-deps -- -D warnings | ||
|
|
||
| - name: Clippy (vsc lib, upstream lint levels) | ||
| run: cargo clippy -p vsc --no-deps | ||
|
|
||
| test: | ||
| name: Run tests | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Rust | ||
| uses: ./.github/actions/setup-rust-tests | ||
| with: | ||
| cargo-build-name: wbraid-test | ||
| cargo-build-path: packages/wbraid/target | ||
| cargo-lock-path: packages/wbraid/Cargo.lock | ||
|
|
||
| # The live-b4 protocol tests (test_protocol_http*) and the Verificatum | ||
| # interop tests are #[ignore]d: they need a running b4 + LocalStack or a | ||
| # JVM with the Verificatum jars. Wiring the live-b4 ones up here is | ||
| # planned for PR 4. | ||
| - name: Run tests | ||
| run: cargo test --release | ||
| env: | ||
| RUST_BACKTRACE: 'full' | ||
|
|
||
| build-wasm-core: | ||
| name: Build wasm-core | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Rust | ||
| uses: ./.github/actions/setup-rust-tests | ||
| with: | ||
| cargo-build-name: wbraid-wasm | ||
| cargo-build-path: packages/wbraid/target | ||
| cargo-lock-path: packages/wbraid/Cargo.lock | ||
| targets: wasm32-unknown-unknown | ||
|
|
||
| # Run from the workspace root so crates/braid/.cargo/config.toml (atomics | ||
| # + build-std, which need RUSTC_BOOTSTRAP on stable) does not apply; the | ||
| # wasm-core feature needs neither, and the build stops before bindings, | ||
| # so no wasm-bindgen-cli is required. The full atomics `wasm` feature | ||
| # build stays a dev-loop concern (build-wasm.sh / build-wasm.ps1). | ||
| - name: Build braid wasm-core | ||
| run: >- | ||
| cargo build -p braid --lib --release | ||
| --target wasm32-unknown-unknown | ||
| --no-default-features --features wasm-core | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,19 +50,30 @@ regardless of the test. They differ in the *client* board setup: | |
| `SqlitePersistence`. | ||
|
|
||
| ```sh | ||
| # Terminal 1: .\localstack.ps1 (S3 via LocalStack) | ||
| # Terminal 2: .\b4.ps1 (b4 server on :3000) | ||
| # Terminal 1: .\localstack.ps1 (S3 via LocalStack) [bash: ./localstack.sh] | ||
| # Terminal 2: .\b4.ps1 (b4 server on :3000) [bash: ./b4.sh] | ||
| # Terminal 3: | ||
| cargo test -p braid --release -- --ignored | ||
| ``` | ||
|
|
||
| Each `.ps1` has a bash twin of the same name for the devcontainer; the flags | ||
| map one-to-one (`.\b4.ps1 -Reset -NoRun` ⇄ `./b4.sh --reset --no-run`). | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - A stable Rust toolchain (for the default build). | ||
| - For the live-b4 tests: **Docker** + the **AWS CLI** — `localstack.ps1` starts | ||
| LocalStack, creates the `wbraid-messages` bucket, and applies `s3-cors.json` — | ||
| and the **`b4`** server (`b4.ps1` sets the S3 endpoint/credentials and points | ||
| `DATABASE_URL` at a repo-root `b4.db`). | ||
| `DATABASE_URL` at a repo-root `b4.db`). In the devcontainer, `localstack.sh` | ||
| starts the `localstack` compose service instead (opt-in `wbraid` profile in | ||
| `.devcontainer/docker-compose-base.yml`) and the endpoint is | ||
| `http://localstack:4566` on the project network — `b4.sh` picks the right | ||
| endpoint automatically, and falls back to the `amazon/aws-cli` docker image | ||
| when the AWS CLI is not installed. The image is pinned to | ||
| `localstack/localstack:4`: from the 2026 releases on, `latest` exits at | ||
| startup without an auth token, so a fresh pull of `latest` (which | ||
| `localstack.ps1` does) no longer works. | ||
|
Comment on lines
+78
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
rg -n -C 3 'localstack/localstack|docker (pull|run)' \
packages/wbraid/localstack.ps1 \
packages/wbraid/localstack.sh \
.devcontainer/docker-compose-base.ymlRepository: sequentech/step Length of output: 3970 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- packages/wbraid/localstack.ps1 ---'
cat -n packages/wbraid/localstack.ps1
printf '%s\n' '--- packages/wbraid/TESTING.md ---'
sed -n '60,82p' packages/wbraid/TESTING.md
printf '%s\n' '--- packages/wbraid/PROVENANCE.md ---'
sed -n '100,115p' packages/wbraid/PROVENANCE.mdRepository: sequentech/step Length of output: 3924 🌐 Web query:
💡 Result: On March 23, 2026, LocalStack transitioned its release strategy to calendar versioning (YYYY.MM.patch format) and consolidated its images into a single, unified container [1][2][3]. This change, introduced with the release of version 2026.03.0, made authentication mandatory [1][4][5]. Key details regarding authentication and image access: 1. Mandatory Authentication: Starting with the March 23, 2026 release (version 2026.03.0), the localstack/localstack image requires a valid LocalStack auth token to start [1][6][5]. This requirement applies to both local and CI environments [4][5]. 2. Temporary Bypass: A temporary bypass was available until April 6, 2026, by setting the environment variable LOCALSTACK_ACKNOWLEDGE_ACCOUNT_REQUIREMENT=1 [4]. 3. Legacy Unauthenticated Access: If you require a version that does not mandate an authentication token, you must pin your image to a version prior to the calendar versioning transition, such as the latest v4 release (v4.14.0) [2][7][6]. Version 4 releases are generally recognized as the last versions that function without an auth token [7]. 4. Versioning Scheme: Following the March 23 transition, versions follow the calendar scheme (e.g., 2026.03.0, 2026.04.0), replacing the previous semantic versioning (e.g., 4.x.x) [3]. To run the current LocalStack images, you must generate an auth token from your LocalStack Web Application and provide it via the LOCALSTACK_AUTH_TOKEN environment variable [8][9][5]. Citations:
Make When Docker runs the untagged 📍 Affects 2 files
🤖 Prompt for AI Agents |
||
|
|
||
| ## Wasm | ||
|
|
||
|
|
@@ -84,7 +95,7 @@ provide COOP/COEP) — backed by the native protocol tests above. | |
|
|
||
| ```sh | ||
| # From the repo root (wbraid/), NOT crates/braid. | ||
| .\test-wasm.ps1 | ||
| .\test-wasm.ps1 # bash: ./test-wasm.sh | ||
| ``` | ||
|
|
||
| Runs a `wasm-bindgen-test` (`tests/wasm_indexeddb.rs`) exercising the | ||
|
|
@@ -113,6 +124,9 @@ validation that the protocol runs correctly under wasm. | |
| .\serve.ps1 # clears RUSTFLAGS, builds the wasm client (build-wasm.ps1, | ||
| # nightly + atomics + wasm-bindgen-rayon), then serves on | ||
| # :8080 with COOP/COEP (server.py) | ||
|
|
||
| # bash: ./localstack.sh / ./b4.sh / ./serve.sh. In the devcontainer :8080 is | ||
| # taken by Hasura, so use e.g. `PORT=8081 ./serve.sh` (server.py honours PORT). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Use the selected port in the browser instruction. If the user runs 🤖 Prompt for AI Agents |
||
| ``` | ||
|
|
||
| Then open <http://127.0.0.1:8080/emulator.html> and: | ||
|
|
@@ -142,7 +156,8 @@ above). | |
| - A **nightly** toolchain — for the production wasm build (`build-wasm.ps1` sets a | ||
| nightly override under `crates/braid`, whose `.cargo/config.toml` forces the | ||
| atomics target-features), plus **Python** for `server.py` (the COOP/COEP dev | ||
| server). | ||
| server). `build-wasm.sh` instead stays on stable and uses `RUSTC_BOOTSTRAP=1` | ||
| (the toolchain must ship `rust-src`; the devcontainer's does). | ||
| - For the emulator: **Docker/LocalStack** + **`b4`**, as in the Native live-b4 | ||
| prerequisites. | ||
| - **`RUSTFLAGS` caveat** — clear any inherited `RUSTFLAGS` before the headless test | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: sequentech/step
Length of output: 395
🏁 Script executed:
Repository: sequentech/step
Length of output: 21659
🤖 get_repo_knowledge executed:
get_repo_knowledge sequentech/step /tmp/coderabbit-repo-knowledge/sequentech-step-58f97436Length of output: 2479
🌐 Web query:
GitHub actions/checkout v4 persist-credentials default documentation💡 Result:
In the GitHub actions/checkout v4 action, the default value for the persist-credentials input is true [1][2][3]. When persist-credentials is set to true (the default), the authentication token used to check out the repository is persisted in the local git configuration [1][4]. This allows your workflow scripts to run authenticated git commands within that job [1][4]. The token is automatically removed during the post-job cleanup process [1][4]. If you wish to prevent this behavior for security or other reasons, you can opt out by explicitly setting persist-credentials to false in your workflow step [1][4]: - uses: actions/checkout@v4 with: persist-credentials: false
Citations:
Set least-privilege workflow permissions and disable credential persistence.
Add workflow-level
permissions: { contents: read }. The threeactions/checkout@v4steps use the defaultpersist-credentials: true, which stores the token in local Git configuration for subsequent commands. Setpersist-credentials: falseon each checkout step.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 5-108: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
Source: Linters/SAST tools