feat(pgpm): add CLOSED license, comment out security-related dbname updates, rename sqitchDir to pgpmDir #504
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
This PR makes three changes to the export-migrations.ts file in pgpm/core:
License field: Added
license: 'CLOSED'to the answers object passed toinitModulefor both exported packages (database dump and services)Security-related SQL commented out: Commented out the
UPDATE meta_public.apis/sites SET dbname = current_database()statements with a TODO note explaining these may be a security leak that needs further researchVariable rename: Renamed
sqitchDirtopgpmDirfor consistency with pgpm naming conventionsReview & Testing Checklist for Human
Verify the commented-out SQL doesn't break import functionality: The UPDATE statements were rebinding
dbnameto the target database after import. Commenting them out means thedbnamefield inmeta_public.apisandmeta_public.siteswill retain whatever value was exported. Confirm this is the intended behavior.Confirm "CLOSED" is the correct license string: This is not a standard SPDX identifier. Verify the template system accepts this value and it produces the expected
licensefield in generated package.json files.Test an actual export flow if possible: Run
pgpm exportagainst a database with the required schemas to verify the exported packages are generated correctly with the new license value.Notes
This is PR 1 of a planned series. PR 2 will rename the Sqitch-related types and functions (SqitchRow → PgpmRow, writeSqitchPlan → writePgpmPlan, etc.).
Link to Devin run: https://app.devin.ai/sessions/7e7813472a0643aa88ccb509b288050a
Requested by: Dan Lynch (@pyramation)