Skip to content

Add documentation for testing specific database data migrations #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 11, 2025

Conversation

r-tome
Copy link
Contributor

@r-tome r-tome commented Jun 10, 2025

📔 Objective

Adds documentation on how to use MigrationName to test that data migrations run the same across all supported database providers.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

cloudflare-workers-and-pages bot commented Jun 10, 2025

Deploying contributing-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 41b6e40
Status: ✅  Deploy successful!
Preview URL: https://c9c41aa0.contributing-docs.pages.dev
Branch Preview URL: https://db-migration-testing-docs.contributing-docs.pages.dev

View logs

Copy link

github-actions bot commented Jun 10, 2025

Logo
Checkmarx One – Scan Summary & Details7b262b7c-187c-42a1-8358-f10c5cacdff7

Great job, no security vulnerabilities found in this Pull Request

r-tome added 3 commits June 10, 2025 14:59
…uld not be used for schema-only migrations. Additionally, update best practices to include the removal of tests after deployment and verification in production.
@r-tome r-tome requested a review from eliykat June 11, 2025 09:49
@r-tome r-tome marked this pull request as ready for review June 11, 2025 09:49
@r-tome r-tome requested a review from a team as a code owner June 11, 2025 09:49
@r-tome r-tome changed the title Add documentation for testing specific database migrations Add documentation for testing specific database data migrations Jun 11, 2025
Copy link
Member

@eliykat eliykat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following this up, only a couple of minor suggestions.

@@ -72,3 +72,56 @@ The pipeline uses environment variables. An example entry you might add is:
BW_TEST_DATABASES__0__TYPE: SqlServer
BW_TEST_DATABASES__0__CONNECTIONSTRING: myConnectionString
```

## Testing specific database migrations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this heading can be more precise, per your callout below: Testing data migrations

Comment on lines 83 to 85
> **Note**: This is meant for testing data migrations only. It assumes your database schema is
> already fully up-to-date. After setting up your test data, it re-runs the specified migration to
> verify how it transforms the data. It will not work for schema-only migrations.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use admonitions for this (callouts):

Suggested change
> **Note**: This is meant for testing data migrations only. It assumes your database schema is
> already fully up-to-date. After setting up your test data, it re-runs the specified migration to
> verify how it transforms the data. It will not work for schema-only migrations.
::: note
This is meant for testing data migrations only. It assumes your database schema is
already fully up-to-date. After setting up your test data, it re-runs the specified migration to
verify how it transforms the data. It will not work for schema-only migrations.
:::

The formatting can be a bit fussy but there are lots of examples to compare to elsewhere in contributing docs.

Copy link
Contributor Author

@r-tome r-tome Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I just updated it to use ::: note for consistency. That's not supported on github but in some other platforms it is

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more about what docusaurus supports rather than Github. Looks good to me now.

@r-tome r-tome requested a review from eliykat July 10, 2025 14:50
@r-tome r-tome merged commit c31cdb2 into main Jul 11, 2025
10 checks passed
@r-tome r-tome deleted the db-migration-testing-docs branch July 11, 2025 08:01
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