Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Closes #
## Checklist

- [ ] Branch is named `feat/`, `fix/`, `docs/`, `chore/` or `test/` and commits are signed off (`git commit -s`)
- [ ] `scripts/ci-local.sh` passes (`TOOLCHAIN=1.94 scripts/ci-local.sh`)
- [ ] `scripts/ci-local.sh` passes (`TOOLCHAIN=1.95 scripts/ci-local.sh`)
- [ ] `scripts/security-local.sh` passes if workflows, dependencies or the OpenShell pin changed
- [ ] Tests added or updated (`tests/cli.rs`, fixtures, golden files)
- [ ] Docs regenerated if directives or flags changed (`scripts/gen-docs.sh`)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust
run: rustup toolchain install 1.94 --profile minimal --component rustfmt,clippy && rustup default 1.94
run: rustup toolchain install 1.95 --profile minimal --component rustfmt,clippy && rustup default 1.95
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/openshell-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
echo "pin=$("$TOOLS/openshell-tags.sh" pinned)" >> "$GITHUB_OUTPUT"

- name: Install Rust
run: rustup toolchain install 1.94 --profile minimal --component rustfmt,clippy && rustup default 1.94
run: rustup toolchain install 1.95 --profile minimal --component rustfmt,clippy && rustup default 1.95

- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ jobs:
env:
TARGET: ${{ matrix.target }}
run: |
rustup toolchain install 1.94 --profile minimal --target "$TARGET"
rustup default 1.94
rustup toolchain install 1.95 --profile minimal --target "$TARGET"
rustup default 1.95
- name: Build
env:
TARGET: ${{ matrix.target }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
with:
persist-credentials: false
- name: Install Rust
run: rustup toolchain install 1.94 --profile minimal && rustup default 1.94
run: rustup toolchain install 1.95 --profile minimal && rustup default 1.95
- name: Install cargo-deny (pinned, sha256)
run: scripts/ci-tools.sh install cargo-deny --dir "$RUNNER_TEMP/bin"
- name: cargo deny check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust
run: rustup toolchain install 1.94 --profile minimal && rustup default 1.94
run: rustup toolchain install 1.95 --profile minimal && rustup default 1.95
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ subprocesses; add directives with reasons; run `scan`, `generate`, `lint`, `drif
`diff-logs`).

## When changing this tool
- Build/test: `cargo build && cargo test` (Rust 1.94+). The schema crate is a git dependency pinned to the
- Build/test: `cargo build && cargo test` (Rust 1.95+). The schema crate is a git dependency pinned to the
OpenShell `v0.1.9` tag (see `Cargo.toml`, `Cargo.lock` pins the commit). Update the tag deliberately and re-run
the golden tests. `openshell-next` builds against the newest upstream tag, prereleases included, and is moved by
`.github/workflows/openshell-next.yml`; fixes that need the newer OpenShell go there, fixes valid on the current pin
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version section and adds the squash-merged PR titles since the previous tag. Ver

## [Unreleased]

- chore(ci): `openshell-next` builds with Rust 1.95: OpenShell v0.1.11-pre.2 declares `rust-version = "1.95"`, so `Cargo.toml` `rust-version`, the CI, Security, Upstream compatibility and Release workflows, the Dockerfile, the `version: source` action fallback and the docs move from 1.94 to 1.95 on this branch (main stays on 1.94 with OpenShell v0.1.10) (#116)
- chore(deps): build against OpenShell v0.1.9 (`openshell-policy-schema`, `openshell-policy`, commit ce58cf8); docs, generated policy headers and the `diff-logs`/`--image` notes now name v0.1.9 (#107)
- feat(lint): warn when a wildcard host in an `egress` directive or a `--policy` endpoint without `allowed_ips` can match a private IP literal (`10.*.*.*`, `**.*.*`): since OpenShell v0.1.9 a wildcard endpoint no longer allows private IP literals on its own (#107)
- test: the gateway validator rejects middleware selectors with a port (OpenShell v0.1.9); `diff-logs` skips gateway API Activity denials in both the old (`type_uid` 600399) and the new Create/Update/Delete shape (#107)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ goes through a branch and a pull request.
1. Branch from an up-to-date `main`, named by type: `feat/<name>`, `fix/<name>`, `docs/<name>`, `chore/<name>`
(`test/<name>` for test-only work).
2. Commit with a DCO sign-off: `git commit -s -m "feat: what and why"` (conventional prefixes, small commits).
3. Run `scripts/ci-local.sh` before pushing (`TOOLCHAIN=1.94 scripts/ci-local.sh` pins the toolchain CI uses), and
3. Run `scripts/ci-local.sh` before pushing (`TOOLCHAIN=1.95 scripts/ci-local.sh` pins the toolchain CI uses), and
`scripts/security-local.sh` when you touch workflows, dependencies or the OpenShell pin.
4. `git push -u origin <branch>` and open a pull request into `main`.
5. CI must pass (the required checks: `check` and `audit` from CI, and `actionlint`, `gitleaks`, `cargo-deny` and
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "openshell-annotate"
version = "0.1.0-rc.3"
edition = "2021"
rust-version = "1.94"
rust-version = "1.95"
description = "Policy-as-code for OpenShell: scan @openshell source directives and generate/validate policy.yaml"
license = "Apache-2.0"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# `openshell-policy-schema` is a git dependency on https://github.com/ai-openshell/openshell (tag v0.1.9, commit pinned
# in Cargo.lock), fetched by cargo during the build, so no local OpenShell checkout is needed.
FROM rust:1.94-bookworm AS build
FROM rust:1.95-bookworm AS build
WORKDIR /build
# Tree-sitter grammars are C sources compiled by cargo's build scripts (gcc is in the rust image).
COPY Cargo.toml Cargo.lock ./
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ docker run --rm ghcr.io/ilanh/openshell-annotate:0.1.0-rc.3 --version
Pin `--version` to a release tag until a stable SemVer release exists (`version: latest` in CI behaves the same way).

**Not on [crates.io](https://crates.io/).** The crate sets `publish = false` and depends on NVIDIA OpenShell crates via
git tags, so `cargo install openshell-annotate` from crates.io will not work. Install a tagged checkout instead (Rust 1.94+,
git tags, so `cargo install openshell-annotate` from crates.io will not work. Install a tagged checkout instead (Rust 1.95+,
a C compiler for tree-sitter):

```
Expand Down
4 changes: 2 additions & 2 deletions actions/lib/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ case "${1:-}" in
[ -f "$repo_dir/Cargo.toml" ] || { echo "::error::version=source needs the action sources (no Cargo.toml in $repo_dir)"; exit 1; }
cd "$repo_dir"
if ! command -v cargo >/dev/null 2>&1; then
rustup toolchain install 1.94 --profile minimal
rustup default 1.94
rustup toolchain install 1.95 --profile minimal
rustup default 1.95
fi
cargo build --release --locked --target-dir "$repo_dir/target"
install -m 0755 "$repo_dir/target/release/openshell-annotate" "${INSTALL_DIR:?}/openshell-annotate"
Expand Down
2 changes: 1 addition & 1 deletion actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
version:
description: >
Release tag to install (e.g. v0.1.0-rc.3), `latest` (newest stable release only), or `source` to build
the openshell-annotate sources at the action's own ref with cargo (Rust 1.94+).
the openshell-annotate sources at the action's own ref with cargo (Rust 1.95+).
required: false
default: v0.1.0-rc.3
install-dir:
Expand Down
23 changes: 12 additions & 11 deletions docs/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ build that downloads crates takes longer.
| Needed for | What |
|---|---|
| everything | Git, a C compiler (`build-essential` / Xcode command line tools: the tree-sitter grammars are C), network access to crates.io and github.com (the OpenShell schema crate is a git dependency pinned to the `v0.1.9` tag) |
| build and test | Rust **1.94** or newer through [rustup](https://rustup.rs). CI pins 1.94 |
| build and test | Rust **1.95** or newer through [rustup](https://rustup.rs). CI pins 1.95 |
| Docker image (optional) | Docker with BuildKit |
| sandbox flow (optional) | the `openshell` CLI and `openshell-prover` at 0.1.9, a running OpenShell gateway, and Docker (see section 7) |

```
rustup toolchain install 1.94 --profile minimal --component rustfmt,clippy
rustup toolchain install 1.95 --profile minimal --component rustfmt,clippy
. "$HOME/.cargo/env" # puts cargo on PATH in this shell (non-login shells such as ssh commands do not load it)
```

## 2. Get the code and build

```
git clone https://github.com/<owner>/openshell-annotate && cd openshell-annotate
cargo +1.94 build --release --locked # about 20 s warm; binary: target/release/openshell-annotate
cargo +1.95 build --release --locked # about 20 s warm; binary: target/release/openshell-annotate
target/release/openshell-annotate --version # openshell-annotate 0.1.0
cargo +1.94 install --path . --locked # optional: installs into ~/.cargo/bin (use --root DIR to install elsewhere)
cargo +1.95 install --path . --locked # optional: installs into ~/.cargo/bin (use --root DIR to install elsewhere)
```

`--locked` makes cargo use the committed `Cargo.lock`, which is what CI does.
Expand Down Expand Up @@ -52,7 +52,7 @@ CI (`.github/workflows/ci.yml`) runs `cargo fmt --check`, `cargo clippy --all-ta
`cargo test --locked`, `scripts/gen-docs.sh --check` and `scripts/gen-actions-docs.sh --check`, plus `cargo audit`. All but the audit are one command:

```
TOOLCHAIN=1.94 scripts/ci-local.sh # pinned like CI; omit TOOLCHAIN to use your default toolchain
TOOLCHAIN=1.95 scripts/ci-local.sh # pinned like CI; omit TOOLCHAIN to use your default toolchain
```

Expected last line: `ci-local: all checks passed`. Optional audit: `cargo install cargo-audit --locked && cargo audit`.
Expand Down Expand Up @@ -84,8 +84,8 @@ OpenShell moved from `NVIDIA/OpenShell` to `ai-openshell/openshell` in November
URL redirects, but `Cargo.toml`, `deny.toml` (`allow-git`) and the scripts use the new one, so `cargo deny` rejects a
lock file that still resolves from `NVIDIA/OpenShell` and `scripts/verify-openshell-pin.sh` finds no pin in it.

Clippy gains new lints with every Rust release. If it fails on a newer toolchain but passes on 1.94, fix the lint in a
separate commit (CI will keep using 1.94 until the pin is bumped on purpose in `ci.yml`, `Dockerfile` and `Cargo.toml`).
Clippy gains new lints with every Rust release. If it fails on a newer toolchain but passes on 1.95, fix the lint in a
separate commit (CI will keep using 1.95 until the pin is bumped on purpose in `ci.yml`, `Dockerfile` and `Cargo.toml`).

`docs/CLI.md` and `docs/DIRECTIVES.md` are generated from the code. After changing a flag, directive or attribute run
`scripts/gen-docs.sh` and commit the result; `scripts/gen-docs.sh --check` (and `cargo test`) fail when they are stale.
Expand Down Expand Up @@ -123,7 +123,8 @@ sorts after its own prereleases (`latest`, `latest-stable`, `list`, `pinned`, `n

`openshell-next` is the one long-lived branch besides `main`. It is `main` plus the OpenShell pin moved to the newest
upstream tag, prereleases included (for example `v0.1.10-pre.3` while `main` is on `v0.1.9`), plus any fix that only
makes sense on that version. It exists so the next OpenShell is integrated, and its breakage fixed, before it ships as
makes sense on that version, such as the Rust 1.95 toolchain that OpenShell v0.1.11-pre.2 requires (main stays on 1.94
until a stable OpenShell release needs more). It exists so the next OpenShell is integrated, and its breakage fixed, before it ships as
stable. A draft pull request `openshell-next` → `main` and an issue labelled `openshell-next` track it; the issue gets a
comment for every new upstream tag.

Expand Down Expand Up @@ -166,7 +167,7 @@ scripts/openshell-next.sh sync # merge origin/main (what the workfl
scripts/openshell-next.sh update # move the pin if upstream has a newer tag (edits files only)
scripts/openshell-next.sh bump v0.1.8-pre.3 # or pin an exact tag
OPENSHELL_ANNOTATE_ROOT=../other-checkout scripts/openshell-next.sh update # work on another checkout
TOOLCHAIN=1.94 scripts/ci-local.sh
TOOLCHAIN=1.95 scripts/ci-local.sh
```

Fixes for breakage on the new OpenShell go in a `fix/<name>` branch off `openshell-next` with a PR into
Expand Down Expand Up @@ -277,7 +278,7 @@ The one long-lived branch is `openshell-next`, which the `openshell-next` workfl
```
git switch main && git pull --ff-only
git switch -c feat/short-name # or fix/..., docs/..., chore/...
# edit, add a test, then run: TOOLCHAIN=1.94 scripts/ci-local.sh
# edit, add a test, then run: TOOLCHAIN=1.95 scripts/ci-local.sh
git commit -s -m "feat: what and why" # -s adds the DCO Signed-off-by line (required)
git push -u origin feat/short-name # CI runs on every push to a pull request
gh pr create --fill # open the PR into main
Expand All @@ -301,7 +302,7 @@ public repo or a paid plan). `.github/rulesets/protect-openshell-next.json` bloc
|---|---|
| `cargo: command not found` over ssh or in cron | rustup's `~/.cargo/bin` is only on PATH in login shells: run `. "$HOME/.cargo/env"` first |
| `error: failed to select a version` / git fetch of `OpenShell` fails | the schema crate comes from github.com; check network or proxy; `--locked` needs the tag commit recorded in `Cargo.lock` |
| clippy errors that CI does not show | newer toolchain; run with `TOOLCHAIN=1.94` or fix the new lint |
| clippy errors that CI does not show | newer toolchain; run with `TOOLCHAIN=1.95` or fix the new lint |
| `docs are stale` | run `scripts/gen-docs.sh` and commit `docs/` |
| `docs/GITHUB_ACTIONS.md is out of date with actions/*/action.yml` | run `scripts/gen-actions-docs.sh` and commit it; add a `BEGIN/END actions-docs <name>` section for a new action |
| sandbox probes get `403` from `api.github.com` | unauthenticated GitHub API rate limit (60 requests per hour per IP), not a policy decision; wait for the reset or use another host |
Expand Down
6 changes: 3 additions & 3 deletions docs/GITHUB_ACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ troubleshooting.
`openshell-annotate generate -o openshell/policy.yaml --providers-out openshell/providers.json`.
See the [README](../README.md) and [DIRECTIVES.md](DIRECTIVES.md).
- A GitHub-hosted `ubuntu-*` or `macos-*` runner (linux or darwin, x86_64 or arm64). Self-hosted runners need `bash`,
`curl` and `jq`, and `cargo` 1.94+ (or `rustup`) for `version: source`.
`curl` and `jq`, and `cargo` 1.95+ (or `rustup`) for `version: source`.
- Workflow permissions `contents: read`. The actions need no secrets.
- Optional: the GitHub CLI on the runner for `verify-attestation: "true"` (preinstalled on GitHub-hosted runners).

Expand Down Expand Up @@ -121,7 +121,7 @@ builds from source.

| Input | Required | Default | Description |
| --- | --- | --- | --- |
| `version` | no | `v0.1.0-rc.3` | Release tag to install (e.g. v0.1.0-rc.3), `latest` (newest stable release only), or `source` to build the openshell-annotate sources at the action's own ref with cargo (Rust 1.94+). |
| `version` | no | `v0.1.0-rc.3` | Release tag to install (e.g. v0.1.0-rc.3), `latest` (newest stable release only), or `source` to build the openshell-annotate sources at the action's own ref with cargo (Rust 1.95+). |
| `install-dir` | no | _(empty)_ | Directory for the openshell-annotate binary (added to PATH); empty means `$RUNNER_TOOL_CACHE/openshell-annotate`. |
| `verify-attestation` | no | `false` | Run `gh attestation verify` after download (needs GitHub CLI + contents:read). |
| `cache` | no | `true` | Cache the installed binary between runs (keyed on OS, arch and the resolved release tag, so `latest` picks up new releases; not used for `source`). |
Expand Down Expand Up @@ -332,7 +332,7 @@ uploads it as `playground-policy` and builds the sandbox image.
| `Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '…/actions/setup'` when using `check` | `check@v0.1.0-rc.3` and older nest `uses: ./actions/...`, which resolves against your repository ([#65](https://github.com/ilanh/openshell-annotate/issues/65)). Use `setup` + `drift` + `lint` at that tag, or a ref that includes [#66](https://github.com/ilanh/openshell-annotate/pull/66). |
| `could not resolve the latest release (is there a stable release yet? use --version)` | `version: latest` only finds stable releases and there are none yet. Pin a tag such as `v0.1.0-rc.3`. |
| `latest` keeps installing an old release | Fixed in [#77](https://github.com/ilanh/openshell-annotate/issues/77): `setup` and `check` resolve `latest` to a release tag before the cache step and key the cache on it. With an action ref older than that fix the key contains the literal `latest`; set `cache: "false"` on `setup`, or pin a tag. |
| Source build fails with a Rust version or edition error | `version: source` uses the runner's `cargo` when present and needs Rust 1.94+; otherwise it installs 1.94 with `rustup`. Update the toolchain on self-hosted runners. |
| Source build fails with a Rust version or edition error | `version: source` uses the runner's `cargo` when present and needs Rust 1.95+; otherwise it installs 1.95 with `rustup`. Update the toolchain on self-hosted runners. |
| `install.sh failed (attempt N/5)` or download errors | Release downloads retry with backoff (and `curl` retries each request). If all attempts fail, GitHub was unavailable; re-run the failed jobs. |
| `lint-report.sh requires jq` or an empty drift summary | Install `jq` on self-hosted runners. |
| `Policy drift detected` | Regenerate locally (`openshell-annotate generate -o openshell/policy.yaml`, plus `--providers-out` if you use providers), review and commit. |
Expand Down
2 changes: 1 addition & 1 deletion docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ scripts/smoke.sh target/release/openshell-annotate
scripts/package.sh v0.2.0 x86_64-unknown-linux-gnu target/release/openshell-annotate dist
```

The release targets are built on GitHub's runners with Rust 1.94: on Ubuntu with `musl-tools` and
The release targets are built on GitHub's runners with Rust 1.95: on Ubuntu with `musl-tools` and
`CC_<target>=musl-gcc` for the static Linux binaries (the tree-sitter grammars are C), and with the stock toolchain on macOS.
The workflow passes `--remap-path-prefix` so no build paths end up in the binary.
2 changes: 1 addition & 1 deletion scripts/ci-local.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Run the same checks as .github/workflows/ci.yml (the `check` job) locally.
# scripts/ci-local.sh # fmt, clippy, test, docs checks
# TOOLCHAIN=1.94 scripts/ci-local.sh # pin the toolchain CI uses (needs `rustup toolchain install 1.94`)
# TOOLCHAIN=1.95 scripts/ci-local.sh # pin the toolchain CI uses (needs `rustup toolchain install 1.95`)
set -euo pipefail
cd "$(dirname "$0")/.."
TC="${TOOLCHAIN:+ +$TOOLCHAIN}"
Expand Down
Loading