2021-11-05 12:33:55 +03:00
|
|
|
name: Migration Review
|
|
|
|
on:
|
|
|
|
pull_request_target:
|
|
|
|
types: [opened]
|
|
|
|
paths:
|
2022-07-20 17:50:33 +03:00
|
|
|
- 'ghost/core/core/server/data/schema/**'
|
|
|
|
- 'ghost/core/core/server/data/migrations/versions/**'
|
2021-11-05 12:33:55 +03:00
|
|
|
jobs:
|
|
|
|
createComment:
|
|
|
|
runs-on: ubuntu-latest
|
2022-06-02 00:54:26 +03:00
|
|
|
if: github.repository_owner == 'TryGhost'
|
2023-01-26 17:45:34 +03:00
|
|
|
name: Add migration review requirements
|
2021-11-05 12:33:55 +03:00
|
|
|
steps:
|
2023-01-26 17:45:34 +03:00
|
|
|
- uses: actions/github-script@v6
|
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
github.rest.issues.addLabels({
|
|
|
|
issue_number: context.issue.number,
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
|
|
|
labels: ["migration"]
|
|
|
|
})
|
|
|
|
|
2023-10-11 09:07:57 +03:00
|
|
|
- uses: peter-evans/create-or-update-comment@ac8e6509d7545ebc2e5e7c35eaa12195c2f77adc
|
2021-11-05 12:33:55 +03:00
|
|
|
with:
|
|
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
|
|
body: |
|
|
|
|
It looks like this PR contains a migration 👀
|
|
|
|
Here's the checklist for reviewing migrations:
|
|
|
|
|
|
|
|
### General requirements
|
|
|
|
|
|
|
|
- [ ] Satisfies idempotency requirement (both `up()` and `down()`)
|
|
|
|
- [ ] Does not reference models
|
2023-06-26 14:04:21 +03:00
|
|
|
- [ ] Filename is in the correct format (and correctly ordered)
|
2021-11-05 12:33:55 +03:00
|
|
|
- [ ] Targets the next minor version
|
|
|
|
- [ ] All code paths have appropriate log messages
|
|
|
|
- [ ] Uses the correct utils
|
|
|
|
- [ ] Contains a minimal changeset
|
|
|
|
- [ ] Does not mix DDL/DML operations
|
2024-08-01 23:38:59 +03:00
|
|
|
- [ ] Tested in MySQL and SQLite
|
2021-11-05 12:33:55 +03:00
|
|
|
|
|
|
|
### Schema changes
|
|
|
|
|
|
|
|
- [ ] Both schema change and related migration have been implemented
|
|
|
|
- [ ] For index changes: has been performance tested for large tables
|
|
|
|
- [ ] For new tables/columns: fields use the appropriate predefined field lengths
|
|
|
|
- [ ] For new tables/columns: field names follow the appropriate conventions
|
|
|
|
- [ ] Does not drop a non-alpha table outside of a major version
|
|
|
|
|
|
|
|
### Data changes
|
|
|
|
|
|
|
|
- [ ] Mass updates/inserts are batched appropriately
|
|
|
|
- [ ] Does not loop over large tables/datasets
|
|
|
|
- [ ] Defends against missing or invalid data
|
|
|
|
- [ ] For settings updates: follows the appropriate guidelines
|