Skip to content

ci: harden integration job — fix PGDATABASE, step order, negative control - #199

Closed
amar-python wants to merge 1 commit into
mainfrom
claude/csv-loading-postgres-migration-qvkl4l
Closed

amar-python wants to merge 1 commit into
mainfrom
claude/csv-loading-postgres-migration-qvkl4l

Conversation

@amar-python

Copy link
Copy Markdown
Owner

Summary

  • Fix job-level PGDATABASE: changed from postgres to te_mgmt_dev so psql commands without an explicit -d flag connect to the correct database
  • Fix step ordering: moved Deploy all environments before Evals — Tiers P, I, S, E so the full test suite sees deployed schemas (previously relied on Tier E's internal _deploy_env())
  • Add API_ALLOW_DESTRUCTIVE at job level so DELETE-endpoint tests are no longer silently skipped
  • Add Tier E negative control (02_empty_schema_is_detected): creates a temporary empty schema, asserts _column_signature returns 0 tables, drops it — prevents false greens from empty/missing schemas

Why these are latent

CI on main is currently green because Tier E deploys internally and the test suite has a per-step PGDATABASE override. But the bugs remain: any new step that relies on the job-level PGDATABASE or assumes deploy ran first will fail silently.

Files changed

File Change
.github/workflows/quality-gate.yml PGDATABASE, API_ALLOW_DESTRUCTIVE, step reorder
evals/runner.py 02_empty_schema_is_detected handler
evals/expected/tier_e/02_empty_schema_is_detected.json Expected: 0 tables
evals/datasets/tier_e/02_empty_schema_is_detected/NOTES.txt Scenario rationale

Test plan

  • CI integration job passes with the reordered steps
  • New Tier E scenario 02_empty_schema_is_detected runs and passes
  • Existing Tier E scenario 01_envs_have_identical_structure still passes
  • DELETE-endpoint tests now run (not skipped)

Generated by Claude Code

… control

Three latent problems survive on main even though CI is green:

1. Job-level PGDATABASE was "postgres" — psql commands without an explicit
   -d flag connected to the wrong database.  Changed to "te_mgmt_dev".

2. The eval step ran before deploy_all.sh, relying on Tier E's internal
   _deploy_env() to paper over the ordering.  Moved deploy before evals
   so the full test suite also sees the deployed schemas.

3. API_ALLOW_DESTRUCTIVE was missing at job level, so DELETE-endpoint
   tests were silently skipped.  Added it.

Additionally, a Tier E negative control (02_empty_schema_is_detected) is
introduced: it creates a temporary empty schema, asserts _column_signature
returns 0 tables, and drops the schema — preventing the false green that
masked the original CI failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VBrxqChRJtxdvSpFhiUWUy

Copy link
Copy Markdown
Owner Author

Closing — CI on main is already green. The changes here (job-level PGDATABASE, step reorder, API_ALLOW_DESTRUCTIVE, negative control) address latent issues that are currently masked by per-step overrides and Tier E's internal deploy. These are preventive hardening, not fixes for actual failures, so they don't warrant a separate PR at this time.


Generated by Claude Code

@amar-python amar-python closed this Nov 7, 2026
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.

2 participants