Skip to content

Development and CI

SergeyGer edited this page Nov 23, 2026 · 7 revisions

Development and CI

Local setup

git clone https://github.com/SergeyGer/TopoMarket.git
cd TopoMarket
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
python -m pip install --upgrade pip
pip install -e ".[dev]"

Quality commands (the same as CI):

python -m compileall -q src tests app.py
ruff check .
ruff format --check .
pytest -q

# opt-in private acceptance (requires the private seed archive; never committed)
TOPOMARKET_SEED_DIR=/path/to/seed/raw pytest -q tests/private_acceptance

Test suites

  • tests/ - unit and integration tests using synthetic fixtures or temporary directories only.
  • tests/private_acceptance/ - opt-in A2 acceptance checks; skipped when TOPOMARKET_SEED_DIR is unset.
  • Tests must be deterministic, fast and network-free.

CI workflows

Workflow Trigger Checks
ci push to main, pull requests Python 3.11 and 3.12: compile, ruff lint, ruff format, pytest
security push to main, PRs, weekly pip-audit (installed deps), bandit (src), detect-secrets over tracked files
codeql push to main, PRs, weekly CodeQL static analysis (Python, build-mode none)
main-guard push to main Independent audit that main changes arrived through a merged PR (not a direct/forced push)

Protected branch workflow

main is protected server-side:

  • pull requests only; direct pushes rejected,
  • required checks: tests (py3.11), tests (py3.12), dependency audit, analyze (python),
  • strict required status checks (branch must be up to date with main before merging),
  • linear history required; squash merge only; merged branches deleted automatically,
  • no force pushes, no branch deletion, admin enforcement enabled, conversation resolution required.

Day-to-day flow:

  1. Create a branch: git checkout -b feat/<short-slug>.
  2. Implement with tests; run the quality commands locally.
  3. Open a PR using the template; link the tracking issue (Closes #<n>).
  4. Wait for all required checks (green).
  5. Squash-merge; the branch is deleted. A release is tagged when a step completes.

If a rebase is needed, update the branch locally (git rebase origin/main) and push the branch - never force-push main.

Commit and content conventions

  • Commit messages: type(scope): summary (feat, fix, docs, test, chore, security, ci).
  • No private data or credentials in any commit, fixture, log or screenshot.
  • No release dates or schedules in README, wiki, issues, PRs or releases; identify releases by step number and semantic version.
  • Update documentation and tests with behaviour changes; keep the public demo offline and deterministic.
  • Dependencies are declared in pyproject.toml; Dependabot opens grouped update PRs.

Repository automation

  • Issue templates (implementation step, bug), PR template, CODEOWNERS.
  • Dependabot version updates for pip and GitHub Actions (monthly, grouped).
  • .github/workflows/release.yml: locked dependency install, compile/lint/format, JUnit test report, offline release checks, sdist/wheel build, twine check, wheel-content/private-input guard and retained release artifacts on PRs, main and version tags.
  • Vulnerability alerts, automated security fixes, secret scanning and push protection enabled.
  • Releases: v0.1.0 Step 1 through v0.8.0 Step 8 (all implementation steps delivered).

Clone this wiki locally