Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fa5b9de67 | ||
|
|
4241782f92 | ||
|
|
824259dc7c | ||
|
|
e056e1487e | ||
|
|
ca3fff0f44 |
No files matched your search
+14
-13
@@ -2,7 +2,8 @@ name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, labeled, unlabeled]
|
||||
branches: [main]
|
||||
types: [opened, synchronize, reopened]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
validation_level:
|
||||
@@ -17,9 +18,6 @@ on:
|
||||
options: [none, production]
|
||||
default: none
|
||||
required: true
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
CARGO_BUILD_JOBS: "2"
|
||||
@@ -46,7 +44,7 @@ jobs:
|
||||
GITEA_EVENT_NAME: ${{ gitea.event_name }}
|
||||
GITEA_EVENT_BEFORE: ${{ gitea.event.before }}
|
||||
GITEA_PR_BASE_SHA: ${{ gitea.event.pull_request.base.sha }}
|
||||
FORCE_FULL: ${{ inputs.validation_level == 'feature' || contains(gitea.event.pull_request.labels.*.name, 'feature-ready') }}
|
||||
FORCE_FULL: ${{ gitea.event_name == 'pull_request' || inputs.validation_level == 'feature' }}
|
||||
run: python3 scripts/ci-release-tooling-scope.py
|
||||
|
||||
- name: Install Rust toolchain
|
||||
@@ -187,8 +185,7 @@ jobs:
|
||||
needs: rust
|
||||
name: Rust Feature Validation
|
||||
if: >-
|
||||
inputs.validation_level == 'feature' ||
|
||||
contains(gitea.event.pull_request.labels.*.name, 'feature-ready')
|
||||
gitea.event_name == 'pull_request' || inputs.validation_level == 'feature'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -251,8 +248,7 @@ jobs:
|
||||
frontend-e2e:
|
||||
needs: [rust, ui]
|
||||
if: >-
|
||||
inputs.validation_level == 'feature' ||
|
||||
contains(gitea.event.pull_request.labels.*.name, 'feature-ready')
|
||||
gitea.event_name == 'pull_request' || inputs.validation_level == 'feature'
|
||||
name: Frontend E2E
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
@@ -323,7 +319,13 @@ jobs:
|
||||
run: npx playwright install --with-deps chromium
|
||||
|
||||
- name: Prebuild e2e services
|
||||
run: cargo build -p admin-api -p mcp-server --jobs "$CARGO_BUILD_JOBS"
|
||||
env:
|
||||
SQLX_OFFLINE: "true"
|
||||
# Match playwright-stack.sh so Cargo reuses these artifacts during startup.
|
||||
run: |
|
||||
cargo build -p admin-api --bin crank-migrate --jobs "$CARGO_BUILD_JOBS"
|
||||
cargo build -p admin-api --bin admin-api --example e2e_storage_counts --jobs "$CARGO_BUILD_JOBS"
|
||||
cargo build -p mcp-server --jobs "$CARGO_BUILD_JOBS"
|
||||
|
||||
- name: Run Playwright e2e
|
||||
working-directory: apps/ui
|
||||
@@ -361,8 +363,7 @@ jobs:
|
||||
deployment:
|
||||
needs: [rust, ui]
|
||||
if: >-
|
||||
inputs.validation_level == 'feature' ||
|
||||
contains(gitea.event.pull_request.labels.*.name, 'feature-ready')
|
||||
gitea.event_name == 'pull_request' || inputs.validation_level == 'feature'
|
||||
name: Community Image Smoke
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -496,7 +497,7 @@ jobs:
|
||||
steps:
|
||||
- name: Require story gates and mode-appropriate feature gates
|
||||
env:
|
||||
FEATURE_VALIDATION: ${{ inputs.validation_level == 'feature' || contains(gitea.event.pull_request.labels.*.name, 'feature-ready') }}
|
||||
FEATURE_VALIDATION: ${{ gitea.event_name == 'pull_request' || inputs.validation_level == 'feature' }}
|
||||
RUST_RESULT: ${{ needs.rust.result }}
|
||||
UI_RESULT: ${{ needs.ui.result }}
|
||||
RUST_FEATURE_RESULT: ${{ needs.rust-feature.result }}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
name: Story CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: ['epic/**']
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
linters:
|
||||
name: Linters
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Rust toolchain
|
||||
run: |
|
||||
set -eu
|
||||
toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n1)"
|
||||
if [ -z "$toolchain" ]; then
|
||||
echo "Unable to read Rust toolchain channel from rust-toolchain.toml" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! rustup run "$toolchain" rustc --version >/dev/null 2>&1 || \
|
||||
! rustup run "$toolchain" cargo --version >/dev/null 2>&1 || \
|
||||
! rustup run "$toolchain" rustfmt --version >/dev/null 2>&1 || \
|
||||
! rustup run "$toolchain" cargo-clippy --version >/dev/null 2>&1; then
|
||||
rustup toolchain install "$toolchain" --profile minimal --component clippy --component rustfmt
|
||||
fi
|
||||
host="$(rustup run "$toolchain" rustc -vV | sed -n 's/^host: //p')"
|
||||
toolchain_dir="${RUSTUP_HOME:-$HOME/.rustup}/toolchains/${toolchain}-${host}"
|
||||
toolchain_bin="$toolchain_dir/bin"
|
||||
if [ ! -x "$toolchain_bin/rustc" ] || [ ! -x "$toolchain_bin/cargo" ]; then
|
||||
echo "Rust $toolchain was not installed at $toolchain_dir." >&2
|
||||
exit 1
|
||||
fi
|
||||
printf '%s\n' "$toolchain_bin" >> "$GITHUB_PATH"
|
||||
"$toolchain_bin/rustc" --version
|
||||
"$toolchain_bin/cargo" --version
|
||||
"$toolchain_bin/rustfmt" --version
|
||||
"$toolchain_bin/cargo-clippy" --version
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt --all --check
|
||||
|
||||
- name: Check Rust code health
|
||||
run: scripts/check-rust-code-health.sh
|
||||
|
||||
- name: Check Rust boundaries
|
||||
run: scripts/check-rust-boundaries.sh
|
||||
@@ -12,7 +12,9 @@ use crank_observability::{
|
||||
MetricService, MetricsConfig, ObservabilityConfig, ObservabilityLifecycle, OtlpTraceConfig,
|
||||
RedactionLimits, SentryConfig, ServiceIdentity, bound_metric_service,
|
||||
};
|
||||
use crank_registry::{MASTER_KEY_CIPHER_CONTRACT, MasterKeyIdentityCandidate, PostgresRegistry};
|
||||
use crank_registry::{
|
||||
MASTER_KEY_CIPHER_CONTRACT, MasterKeyIdentityCandidate, MigrationAuthority, PostgresRegistry,
|
||||
};
|
||||
use crank_runtime::SecretCrypto;
|
||||
use time::{OffsetDateTime, format_description::well_known::Rfc3339};
|
||||
use tower::ServiceExt;
|
||||
@@ -120,12 +122,16 @@ async fn real_admin_startup_runs_immediate_import_maintenance() {
|
||||
String::from_utf8_lossy(&applied.stderr)
|
||||
);
|
||||
let pool = sqlx::PgPool::connect(&database_url).await.unwrap();
|
||||
let canonical_version = MigrationAuthority::sequence()
|
||||
.last()
|
||||
.expect("canonical migration sequence is nonempty")
|
||||
.version;
|
||||
assert_eq!(
|
||||
sqlx::query_scalar::<_, Option<i64>>("select max(version) from __crank_migrations")
|
||||
.fetch_one(&pool)
|
||||
.await
|
||||
.unwrap(),
|
||||
Some(23),
|
||||
Some(canonical_version),
|
||||
"migration binary must install the current canonical ledger",
|
||||
);
|
||||
sqlx::query(
|
||||
|
||||
@@ -3,7 +3,8 @@ use std::process::{Command, Output};
|
||||
use crank_community_auth::{hash_password, verify_password};
|
||||
use crank_core::{Secret, SecretId, SecretKind, SecretStatus, UserSessionId, WorkspaceId};
|
||||
use crank_registry::{
|
||||
CreateSecretRequest, MASTER_KEY_CIPHER_CONTRACT, MasterKeyIdentityCandidate, PostgresRegistry,
|
||||
CreateSecretRequest, MASTER_KEY_CIPHER_CONTRACT, MasterKeyIdentityCandidate,
|
||||
MigrationAuthority, PostgresRegistry,
|
||||
};
|
||||
use crank_runtime::SecretCrypto;
|
||||
use serde_json::json;
|
||||
@@ -40,7 +41,10 @@ fn plan_is_deterministic_and_committed_contract_is_current() {
|
||||
);
|
||||
assert_eq!(first.stdout, second.stdout);
|
||||
let plan: serde_json::Value = serde_json::from_slice(&first.stdout).unwrap();
|
||||
assert_eq!(plan["sequence"].as_array().unwrap().len(), 23);
|
||||
assert_eq!(
|
||||
plan["sequence"].as_array().unwrap().len(),
|
||||
MigrationAuthority::sequence().len()
|
||||
);
|
||||
let target = command(&["plan", "--target-version"], None);
|
||||
assert!(
|
||||
target.status.success(),
|
||||
@@ -104,7 +108,11 @@ async fn database_only_config_can_apply_and_preflight_a_fresh_schema() {
|
||||
);
|
||||
let result: serde_json::Value = serde_json::from_slice(&preflight.stdout).unwrap();
|
||||
assert_eq!(result["status"], "current");
|
||||
assert_eq!(result["version"], 23);
|
||||
let canonical_version = MigrationAuthority::sequence()
|
||||
.last()
|
||||
.expect("canonical migration sequence is nonempty")
|
||||
.version;
|
||||
assert_eq!(result["version"].as_i64(), Some(canonical_version));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ COPY crank-community.png ./crank-community.png
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.30.6-alpine3.24-slim
|
||||
FROM nginx:1.30.7-alpine3.24-slim
|
||||
|
||||
RUN apk add --no-cache --upgrade \
|
||||
'pcre2>=10.49-r0' \
|
||||
|
||||
@@ -19,6 +19,11 @@ async function login(page) {
|
||||
await page.evaluate(async () => {
|
||||
await window.CrankAuth.fetchSession(false);
|
||||
});
|
||||
await page.waitForFunction(() => Boolean(
|
||||
window.CrankAuth &&
|
||||
typeof window.CrankAuth.getCsrfToken === 'function' &&
|
||||
window.CrankAuth.getCsrfToken()
|
||||
));
|
||||
}
|
||||
|
||||
async function browserJson(page, method, urlPath, body, okStatuses = [200]) {
|
||||
|
||||
@@ -156,11 +156,10 @@ class DeployPolicyTests(unittest.TestCase):
|
||||
self.assertIn("default: none", block)
|
||||
self.assertIn("required: true", block)
|
||||
|
||||
def test_push_main_source_ci_stays_enabled(self):
|
||||
self.assertRegex(
|
||||
workflow_text(),
|
||||
r"(?m)^ push:\n branches:\n - main$",
|
||||
)
|
||||
def test_full_ci_targets_main_pull_requests(self):
|
||||
workflow = workflow_text()
|
||||
self.assertRegex(workflow, r"(?m)^ pull_request:\n branches: \[main\]$")
|
||||
self.assertNotRegex(workflow, r"(?m)^ push:")
|
||||
|
||||
def test_deploy_requires_successful_required_checks(self):
|
||||
deploy = job_block("deploy")
|
||||
|
||||
@@ -112,7 +112,7 @@ class WorkflowScopeTests(unittest.TestCase):
|
||||
def test_only_four_heavy_rust_steps_are_skippable(self):
|
||||
workflow = WORKFLOW.read_text(encoding="utf-8")
|
||||
self.assertIn("run: python3 scripts/ci-release-tooling-scope.py", workflow)
|
||||
self.assertIn("FORCE_FULL: ${{ inputs.validation_level == 'feature' || contains(gitea.event.pull_request.labels.*.name, 'feature-ready') }}", workflow)
|
||||
self.assertIn("FORCE_FULL: ${{ gitea.event_name == 'pull_request' || inputs.validation_level == 'feature' }}", workflow)
|
||||
conditional = "if: steps.release_tooling.outputs.ci_only != 'true'"
|
||||
for name in (
|
||||
"Check typed runtime configuration contract",
|
||||
|
||||
Reference in new issue
Block a user