Skip to content

Conversation

jumski
Copy link
Contributor

@jumski jumski commented Sep 18, 2025

TL;DR

Improved schema verification and temporary migration regeneration scripts with better error handling, isolation, and user feedback.

What changed?

  • Enhanced atlas-verify-schemas-synced script to:

    • Use a temporary directory for migrations to avoid modifying the actual migrations directory
    • Add proper cleanup with trap handlers for temporary files and Docker containers
    • Display the first 50 lines of migration diff when schemas are out of sync
    • Improve error reporting with more context
  • Updated regenerate-temp-migration script to:

    • Check if schemas are already in sync before attempting regeneration
    • Skip unnecessary work if schemas are already synchronized
    • Provide clearer user feedback about the state of schemas
    • Update the step numbering in the action plan to reflect the new initial check

How to test?

  1. Run pnpm nx verify-schemas-synced core to test the schema verification
  2. Make a change to a schema file without updating migrations
  3. Run ./scripts/regenerate-temp-migration to see the improved workflow
  4. Verify that temporary files are properly cleaned up after script execution
  5. Check that the error output provides helpful context when schemas are out of sync

Why make this change?

These improvements make the schema verification and migration regeneration process more robust and developer-friendly by:

  1. Preventing accidental modification of actual migration files during verification
  2. Ensuring proper cleanup of resources even when scripts fail
  3. Providing more helpful feedback when schemas are out of sync
  4. Avoiding unnecessary work when schemas are already in sync
  5. Making the error messages more informative for faster debugging

Copy link

changeset-bot bot commented Sep 18, 2025

⚠️ No Changeset found

Latest commit: a467f00

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Sep 18, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor Author

jumski commented Sep 18, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge:queue - adds this PR to the back of the merge queue
  • hotfix:queue - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jumski jumski marked this pull request as ready for review September 18, 2025 07:33
Copy link

nx-cloud bot commented Sep 18, 2025

View your CI Pipeline Execution ↗ for commit a467f00

Command Status Duration Result
nx run-many -t build --projects client,dsl --co... ✅ Succeeded 4s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 3s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 5m 33s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-06 15:41:01 UTC

@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from b031e2a to 5d3fda7 Compare September 18, 2025 07:42
@jumski jumski force-pushed the 09-18-add-map-support-to-dsl branch 2 times, most recently from 0ed394f to 37e2df8 Compare September 18, 2025 07:49
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from 5d3fda7 to 0154266 Compare September 18, 2025 07:49
@jumski jumski force-pushed the 09-18-add-map-support-to-dsl branch from 37e2df8 to 5e7ecd7 Compare September 18, 2025 08:08
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from 0154266 to c3afc05 Compare September 18, 2025 08:08
@jumski jumski force-pushed the 09-18-add-map-support-to-dsl branch from 5e7ecd7 to 2b27c54 Compare September 18, 2025 08:17
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from c3afc05 to e8a6a85 Compare September 18, 2025 08:17
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from e8a6a85 to 2843841 Compare September 18, 2025 08:31
@jumski jumski force-pushed the 09-18-add-map-support-to-dsl branch 2 times, most recently from 252a37d to 83609aa Compare September 18, 2025 08:46
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from 2843841 to 0adad2e Compare September 18, 2025 08:46
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from 0adad2e to abbd0bc Compare September 18, 2025 08:57
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch 2 times, most recently from 36190c3 to 2a32203 Compare September 18, 2025 09:57
@jumski jumski force-pushed the 09-18-add-map-support-to-dsl branch 2 times, most recently from 8e2d37b to 18fd9d1 Compare September 18, 2025 10:03
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch 2 times, most recently from 902a9df to acdca8d Compare September 18, 2025 10:08
@jumski jumski force-pushed the 09-18-add-map-support-to-dsl branch from 18fd9d1 to 53cc331 Compare September 18, 2025 10:08
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from acdca8d to fefb86b Compare October 5, 2025 18:59
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from fefb86b to d04fa3f Compare October 5, 2025 19:20
@jumski jumski force-pushed the 09-18-add-map-support-to-dsl branch from 43c4799 to 26104e7 Compare October 5, 2025 19:20
@jumski jumski force-pushed the 09-18-add-map-support-to-dsl branch from 26104e7 to d52a0e0 Compare October 6, 2025 15:25
@jumski jumski force-pushed the 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration branch from d04fa3f to a467f00 Compare October 6, 2025 15:25
Copy link
Contributor

github-actions bot commented Oct 6, 2025

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-219.pgflow.pages.dev

📝 Details:

  • Branch: 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration
  • Commit: 71c973e1cea374ebd5985ace1865c6db504aa4e3
  • View Logs

_Last updated: _

Copy link
Contributor

github-actions bot commented Oct 6, 2025

🔍 Preview Deployment: Playground

Deployment successful!

🔗 Preview URL: https://pr-219--pgflow-demo.netlify.app

📝 Details:

  • Branch: 09-18-chore_improve_verify-schemas-synced_and_regenerate-temp-migration
  • Commit: 71c973e1cea374ebd5985ace1865c6db504aa4e3
  • View Logs

_Last updated: _

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.

1 participant