add sgg-staging-fuzz script #17

Open
bryan wants to merge 1 commit from add-sgg-staging-fuzz-script into main
Owner

Summary

Moves the Simpler Grants Gov staging API exerciser out of a loose file at /Users/bryan/code/HHS/test_script.py and into version-controlled dotfiles.

Changes

  • scripts/sgg-staging-fuzz.py — the exerciser. Hits GET /common-grants/opportunities, GET /common-grants/opportunities/<id>, and POST /common-grants/opportunities/search on staging with a sampled cross-product of filters, sorts, and pagination. Captures all non-2xx responses to staging_failures.csv in the current working directory.
  • scripts/sgg-staging-fuzz-setup.sh — one-time bootstrap that creates ~/.local/share/sgg-staging-test/.venv and installs requests. The script shebang points at that venv, so Python dependencies live outside any HHS project and survive project reshuffles.
  • scripts/README.md — usage, secret convention, setup instructions.
  • dot-config/zsh/functions.zshsgg-staging-fuzz shell function wrapper; passes through args and uses caller's CWD for output.
  • .gitignore — ignore __pycache__/ and *.pyc.

API key handling

The script reads ~/.secrets/simpler-grants-staging-api-key (raw value, one line, chmod 600) when the API_KEY env var is unset. Env var takes precedence. Matches the existing ~/.secrets/ convention already used for opencode-api-key.

Verified

  • py_compile clean
  • Shebang resolves, script is executable
  • Live smoke test against staging: GET /common-grants/opportunities returned 200 with real data; first batch of pagination combos all succeeded

Note

Also bumps core.repositoryformatversion on the local dotfiles repo to 1 to make extensions.worktreeConfig=true internally consistent (was previously version 0 with the extension enabled, which is an inconsistent state). Not a committed change — just local repo-config hygiene.

## Summary Moves the Simpler Grants Gov staging API exerciser out of a loose file at `/Users/bryan/code/HHS/test_script.py` and into version-controlled dotfiles. ## Changes - `scripts/sgg-staging-fuzz.py` — the exerciser. Hits `GET /common-grants/opportunities`, `GET /common-grants/opportunities/<id>`, and `POST /common-grants/opportunities/search` on staging with a sampled cross-product of filters, sorts, and pagination. Captures all non-2xx responses to `staging_failures.csv` in the current working directory. - `scripts/sgg-staging-fuzz-setup.sh` — one-time bootstrap that creates `~/.local/share/sgg-staging-test/.venv` and installs `requests`. The script shebang points at that venv, so Python dependencies live outside any HHS project and survive project reshuffles. - `scripts/README.md` — usage, secret convention, setup instructions. - `dot-config/zsh/functions.zsh` — `sgg-staging-fuzz` shell function wrapper; passes through args and uses caller's CWD for output. - `.gitignore` — ignore `__pycache__/` and `*.pyc`. ## API key handling The script reads `~/.secrets/simpler-grants-staging-api-key` (raw value, one line, `chmod 600`) when the `API_KEY` env var is unset. Env var takes precedence. Matches the existing `~/.secrets/` convention already used for `opencode-api-key`. ## Verified - `py_compile` clean - Shebang resolves, script is executable - Live smoke test against staging: `GET /common-grants/opportunities` returned 200 with real data; first batch of pagination combos all succeeded ## Note Also bumps `core.repositoryformatversion` on the local dotfiles repo to 1 to make `extensions.worktreeConfig=true` internally consistent (was previously version 0 with the extension enabled, which is an inconsistent state). Not a committed change — just local repo-config hygiene.
Moves the Simpler Grants Gov staging API exerciser out of
/Users/bryan/code/HHS/test_script.py and into version control. Uses a
dedicated venv at ~/.local/share/sgg-staging-test/.venv so it doesn't
depend on any sibling project's Python environment.

API key is auto-loaded from ~/.secrets/simpler-grants-staging-api-key
when the API_KEY env var is unset (env var still wins if set).

- scripts/sgg-staging-fuzz.py: the script (shebang points at dedicated venv)
- scripts/sgg-staging-fuzz-setup.sh: one-time venv bootstrap
- scripts/README.md: usage
- dot-config/zsh/functions.zsh: sgg-staging-fuzz shell function wrapper
- .gitignore: ignore __pycache__ and .pyc
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin add-sgg-staging-fuzz-script:add-sgg-staging-fuzz-script
git switch add-sgg-staging-fuzz-script

Merge

Merge the changes and update on Forgejo.
git switch main
git merge --no-ff add-sgg-staging-fuzz-script
git switch add-sgg-staging-fuzz-script
git rebase main
git switch main
git merge --ff-only add-sgg-staging-fuzz-script
git switch add-sgg-staging-fuzz-script
git rebase main
git switch main
git merge --no-ff add-sgg-staging-fuzz-script
git switch main
git merge --squash add-sgg-staging-fuzz-script
git switch main
git merge --ff-only add-sgg-staging-fuzz-script
git switch main
git merge add-sgg-staging-fuzz-script
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bryan/dotfiles!17
No description provided.