Repository navigation
feat: upstream constructive-db pgpm-modules (db-utils, infra-utils, jobs/errors, function-resolution) - #132
Conversation
…s; jobs/database-jobs errors dep; function-resolution frame_candidates)
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review complete. 🟠 4 high · 🟡 1 medium 💬 Inline comments (5)
The PR introduces two new pgpm packages and updates the job scheduler.
Reviewed commit: f10acc5 |
There was a problem hiding this comment.
This PR adds a new db-utils extension (recursive jsonb merge/set helpers, smart column comments, trigger-based timestamps), a new infra-utils extension (typed parameter-interface compiler and a fail-closed Kubernetes resource admission gate), and fixes run_scheduled_job suppressed-transport behavior across the jobs and database-jobs packages.
Key findings
- 🟠 Declare the missing
stampsdependency oftimestamps— timestamps.sql:20 - 🟠 Fix
jsonb_set_deeparray slice subscript bug — jsonb_set_deep.sql:36 - 🟠 Reject empty annotation prefix in allow-list rules — resource_admission.sql:287
- 🟠 Fail closed on malformed
min/maxbounds — resource_params.sql:366 - 🟡 Detect conflicting shared-parameter metadata in bundles — resource_params.sql:685
Summary
Syncs
packages/*withconstructive-dbmainpgpm-modules/*(source of truth). Most module diffs were boilerplate only (default_version, test importconstructive-testvspgsql-test, LICENSE/Makefile). Upstream conventions are kept for those; only substantive content is ported.New packages
@pgpm/db-utils:db_utils.jsonb_deep_merge,jsonb_set_deep,get_column_smart_comment, timestamps@pgpm/infra-utils:infra_utils.param_quantity,resource_params,resource_installation_guards,resource_admission; requiresdb-utilsanderrors0.46.1withworkspace:*deps and apgsql-testtest harness, added to the CI matrix andMODULES.md.pnpm-workspace.yaml,pgpm.json, and lerna already pick them up viapackages/*.jobs / database-jobs:
run_scheduled_jobhandles transport-suppressed enqueues. It tracksprev_scheduled_id, and when the insert returns no row it falls back tolast_scheduled_id, otherwise raisingerrors.raise_error('SCHEDULED_JOB_NOT_ENQUEUED', …). The new direct dependency is declared at every level:It also adds the
run-scheduled-job-suppressed-transporttests.function-resolution:
resolvenow reads fromfunction_resolution.frame_candidates(database_id, scope, entity_id)instead of expandingapp_scope.framesinline.frame_candidatesis now registered inpgpm.plan, andresolvedepends on it. Adds hosted/shared-surface coverage tocapabilities.test.ts.Docs: README text ported for app-scope, errors, jobs, jwt-claims, metaschema-modules, and function-resolution.
Lockfile/policy:
metaschema-modulesdrops the unusedconstructive-testdevDep. The lockfile was updated with pnpm 10 and is prettier-formatted to match.pnpm-workspace.yamlwas regenerated withpnpm-policy generate, which removes theconstructive-testexemption.Bundles in
sql/were regenerated withpgpm package, not hand-edited. Versions are not bumped here; that happens withlerna versionat release time, per PUBLISH.md.Local verification against PG18 (
postgres-plus:18):pnpm testpasses in all 30 packages.errors,ltree-helpers, anduuidhave no tests.pgpm test-packages --full-cyclepasses (16/16 leaf modules).pnpm run policy:checkpasses.git diff --checkis clean.Link to Devin session: https://app.devin.ai/sessions/2aa2dd55edd7480db840cab8a8428607
Open in Devin Desktop: https://app.devin.ai/desktop/session/2aa2dd55edd7480db840cab8a8428607?variant=devin
Requested by: @pyramation