Skip to content

fix: scorecard and codeql on push to protected branch#17

Open
chaksaray wants to merge 7 commits into
mainfrom
develop
Open

fix: scorecard and codeql on push to protected branch#17
chaksaray wants to merge 7 commits into
mainfrom
develop

Conversation

@chaksaray

Copy link
Copy Markdown
Contributor

No description provided.

Bakes in the resilience pattern (stale-cache-on-refresh-failure,
no crash-loop on startup), rate limiting, and security headers from
the start rather than as follow-up patches, per the reconciled
context brief.
One coordinated documentation pass since these four reference each
other: framing and scope (CONTEXT.md), vocabulary (LANGUAGE.md),
structure and design decisions (ARCHITECTURE.md), and session rules
(CLAUDE.md).
…urity tooling (#4)

* Add community and governance files, flesh out README

SECURITY.md, CONTRIBUTING.md, GOVERNANCE.md, CODE_OF_CONDUCT.md
(Contributor Covenant v2.1, unmodified) didn't exist yet, built fresh
rather than patched. README's deployment section names Render, matching
ARCHITECTURE.md's ADR, rather than the stale Cloud Run reference in an
earlier draft of this brief.

* Add CHANGELOG.md

Framed as a single [1.0.0] initial release rather than an Unreleased
section building on a prior version, since this synthesizes the
service's actual first shipped state rather than patching an existing
changelog.

* Add docker-compose.yml for local development

* Add six custom skills under .claude/skills/

research, grill-with-doc, to-spec, to-tickets, implement, code-review,
following a research -> interrogate -> spec -> tickets -> implement ->
review shape built for this repo's own context.

* Add .pre-commit-config.yaml

trailing-whitespace/end-of-file-fixer/check-yaml/check-json/large-files,
ruff + ruff-format, and two local hooks: no em dashes anywhere, and no
stray mentions of one specific vendor's product name. Ran --all-files
and fixed everything it flagged (ruff-format wrapped two lines in
main.py) before committing.

* Add CodeQL, Dependabot, and OpenSSF Scorecard CI

Three Dependabot ecosystems (pip, docker, github-actions), not just
Python, since the Dockerfile's base image and this repo's own Actions
dependencies need patching too. Scorecard publishes results publicly,
which is what README.md's badge (added in an earlier commit) links to.
* Add test skill: red-green-refactor TDD for this repo

Test through the HTTP interface, not internals; never touch the real
network; reset the module-level cache and rate limiter between tests;
one behavior per test. Matches this repo's existing research ->
grill-with-doc -> to-spec -> to-tickets -> implement shape, slotted in
during implement.

* Add pytest suite covering all four routes and the resilience pattern

14 tests, following the new test skill: happy paths and 404s for every
route, mitigation neutrality (only the mitigation object, 404 when a
record has none), search matching across all four documented fields,
rate limiting present on a route, and the three resilience behaviors
from CLAUDE.md (stale-serve on refresh failure, hard-fail only when
the cache was never populated, no crash-loop on a failed initial
fetch). All tests monkeypatch _refresh_cache, no real network access.
Both previously only ran on push to main. Since develop is where work
actually lands first, scanning stopped there meant a window between
merge to develop and the next develop-to-main sync where new code had
no CodeQL or Scorecard coverage at all.
The build never copied constants.py after main.py started importing
from it, so the container crashed on startup with ModuleNotFoundError
inside Docker even though python3 -m py_compile passed locally (that
check never runs inside the actual container). Verified by building
the image and running it: previously exited immediately with
ModuleNotFoundError: No module named 'constants'; now starts, binds
the port, and serves real data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant