Files
novelly/scripts/ci/prepush.sh
T
James Wampler e598c18d67 Add users, roles, and per-novel permissions
Introduces accounts (ASP.NET Identity + cookie auth), four global
roles (Admin/Writer/Editor/Reviewer), per-novel ownership and grants
via ProjectMember, and a service-API-key principal for the MCP server
and background import jobs. Enforcement lives in the application
services (not endpoint filters) so the embedded agent and MCP tools,
which call the same services directly, can't bypass it. Web client
gets a login page, session-aware routing, and a People section for
managing per-novel access.

Also includes prior in-flight changes from this branch (CLAUDE.md
compliance pass, dev-deploy docker-compose setup) that were
uncommitted when this feature work started.
2026-08-15 22:29:33 -07:00

31 lines
978 B
Bash
Executable File

#!/usr/bin/env bash
# Husky pre-push hook body. Compiles the solution, runs the test suite and builds the
# web client, so broken code never leaves the workstation.
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" && source ./lib.sh
cd "$CI_ROOT"
ensure_dotnet
ensure_node
log "Checking for comments in C#/TS/TSX/CSS"
./scripts/ci/check-no-comments.sh
log "Building the solution (Debug)"
dotnet build Novelly.slnx -c Debug
log "Running Novelly.Api.Tests with a line-coverage floor"
dotnet test tests/Novelly.Api.Tests/Novelly.Api.Tests.csproj -c Debug \
/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura \
/p:Exclude="[Novelly.ServiceDefaults]*" \
/p:ExcludeByFile="**/Data/Migrations/*.cs" \
/p:Threshold=60 /p:ThresholdType=line /p:ThresholdStat=total
log "Installing web dependencies (npm ci)"
npm --prefix src/Novelly.Web ci
log "Building the web client (vite build)"
npm --prefix src/Novelly.Web run build
log "prepush.sh complete - ok to push"