fmt:
    cargo fmt --all

fmt-check:
    cargo fmt --all --check

tooling-test:
    python3 -m unittest discover -s tests/unit

community-scope-check:
    scripts/check-community-scope.sh

check:
    cargo check --workspace

clippy:
    cargo clippy --workspace --all-targets --all-features -- -D warnings

test:
    cargo test --workspace --all-targets

sqlx-prepare database_url:
    DATABASE_URL={{database_url}} cargo sqlx prepare --workspace -- --all-targets

sqlx-check:
    SQLX_OFFLINE=true cargo check --workspace

verify:
    just tooling-test
    just community-scope-check
    just fmt-check
    just clippy
    just test

ui-build:
    docker build -f apps/ui/Dockerfile .

verify-ui:
    just ui-build

ui-e2e:
    cd apps/ui && npm run e2e

staging-smoke base_url:
    bash scripts/staging-smoke.sh {{base_url}}

authenticated-staging-smoke base_url:
    bash scripts/authenticated-staging-smoke.sh {{base_url}}

authenticated-product-smoke base_url:
    bash scripts/authenticated-product-smoke.sh {{base_url}}

staging-note-block environment deploy_commit checked_by smoke_status='partial':
    bash scripts/staging-note-block.sh {{environment}} {{deploy_commit}} {{checked_by}} {{smoke_status}}
