Repository navigation
CI: parallel jobs, lint/format gate, security scanning, coverage (#155, #156) - #165
Merged
Merged
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Vishnu2707
approved these changes
Jul 6, 2026
Vishnu2707
left a comment
Collaborator
There was a problem hiding this comment.
async execution is the right call. one thing to keep in mind @ritiksah141 is that the in-memory job store will lose state on Render restart, lets track that as a future improvement to persist job state in the db. approving this for now but please do raise a github issue for the next PR to fix that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restructures CI from a single serial job into parallel, independent gated jobs, adds the shift-left security scanning suite, brings the codebase under a
rufflint/format gate, and adds full test coverage reporting. Addresses #155 (INFRA 2) and #156 (INFRA 3) together, phase-wise, since both reshape the same pipeline.Before merging (requires repo admin)
codeql.ymlworkflow errors out if default setup is still enabled — the two cannot coexist. This is a hard merge-blocker for the CodeQL jobs.devandmain. Until then, checks are advisory. Exact check names and ready-to-runghcommands are in the "Admin follow-ups" section below.What changed
CI restructure (#155)
ci-checksjob into parallel jobs:lint,rule-validation,secret-scan,sast-bandit,sca-pip-audit,sbom,container-scan,backend-tests,frontend,enforce-source-branch, aggregated byci-summary. Wall-time is now the slowest job, not the sum.tests/suite against an ephemeral Postgres service, with--covand a--cov-fail-under=25floor.pip+npmcaching, aconcurrencyblock that cancels superseded runs, andpermissions: contents: read(least privilege).npm ci→eslint→vite build); a broken dashboard build can no longer merge.pyproject.tomlruff config (line-length = 120,E,F,W, py311). Existing violations across the codebase are fixed or explicitly# noqa/# nosecwith justification so the gate lands green — this is the bulk of the file count.Security scanning (#156)
codeql.yml, python + javascript) on every PR and a weekly schedule.--ignore-vulnmechanism), Syft CycloneDX SBOM artifact.sbom-release.ymlworkflow (triggeredon: release: published) generates a CycloneDX SBOM from the tagged code and uploads it to the GitHub Release assets — satisfying [INFRA 3] Supply-chain security: CodeQL, pip-audit, Dependabot for pip/Actions, SBOM, refresh vulnerable pins #156's "attached to releases" line (the repo already publishes releases, e.g. v0.1.0).dependabot.ymlforpip+github-actions+npm.requests,cryptography,flask,pyjwt,gunicorn) plus three more that pip-audit surfaced (flask-cors,azure-identity,python-dotenv). Full suite still passes; gunicorn boots and serves/health.# vX.Y.Zcomments (trivy-action specifically because its tags were compromised in 2026).Branch-flow enforcement
enforce-source-branchjob blocks any PR intomainwhose source is notdev, enforcingfeature/* → dev → main. No-op (skipped) ondevPRs.Docs
docs/ci-pipeline.mdrewritten for the new parallel pipeline: per-job local-run commands, the branch-protection model, and tooling-decision rationale.Notes for reviewers
dev— there were three overlapping pytest steps. This PR collapses them into one full-suite run with coverage.open-pull-requests-limit: 0): it still raises alerts but does not auto-open bump PRs, per maintainer direction. This intentionally diverges from [INFRA 3] Supply-chain security: CodeQL, pip-audit, Dependabot for pip/Actions, SBOM, refresh vulnerable pins #156's "Dependabot opens PRs" acceptance line — flagging for visibility.transformersCVEs (transitive viasentence-transformers, no non-breaking fix yet) — tracked for a coordinated ML-stack bump, not silently dropped.Admin follow-ups (cannot be done from a PR)
codeql.ymlcannot coexist with default setup.devandmainmaking the new jobs required status checks — these run now but only block once marked required. Required check names:Lint (ruff),Rule & Compliance Validation,Secret Scan (Gitleaks),SAST (Bandit),SCA (pip-audit),SBOM (Syft),Backend Tests (pytest + coverage),Frontend (lint + build),CI Summary,Analyze (python),Analyze (javascript)— plusEnforce dev to main sourceonmainonly. (Container Scan (Trivy)intentionally excluded until [INFRA 1] Containerise the stack: Dockerfiles for API and worker, docker-compose local dev, split requirements #154.)Set
dev= 1 approval + "up to date before merging";main= stricter review +enforce_admins. Ready-to-runghcommands and the full model are indocs/ci-pipeline.md.development/staging/production(production: required reviewers + prevent self-review).gitleaks-action, which is why this PR uses the Gitleaks CLI instead).Deferred (out of scope here)
alembic.ini/migrations/exist yet).Local verification (all green)
ruff check/format,bandit -ll,pip-audit,gitleaks,actionlint, and the fullpytestsuite (109 passed, 2 skipped, 31% coverage) all pass locally; frontendeslint(0 errors) +vite buildpass.Files to review (the rest is mechanical formatting)
Of the ~147 changed files, only these need a human read — the remainder is one-time
ruff format/eslintnormalization (unused-import removal, whitespace, quote style) with no behavior change:.github/workflows/ci.yml.github/workflows/codeql.yml.github/dependabot.yml.github/workflows/sbom-release.ymlpyproject.tomlrequirements.txtdocs/ci-pipeline.mdSpot-check (small, non-mechanical edits):
api/models/finding.py,api/routes/findings.py,scanner/engine.py,scanner/nvd_client.py,scanner/rules/az_db_004.py,api/app.py— a few# nosecjustifications and one SQL/import cleanup each.tests/conftest.py— import ordering only.frontend/.jsx/.js— unused-import removal to pass eslint (mechanical).