Repository navigation
Refuse to migrate files that changed since their last build - #8916
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8916 +/- ##
=======================================
Coverage 81.13% 81.14%
=======================================
Files 456 456
Lines 63754 63760 +6
=======================================
+ Hits 51728 51738 +10
+ Misses 12026 12022 -4
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8916 |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why:
`rescript-tools migrate` takes the locations of deprecated uses from the
file's .cmt/.cmti. When the source changed after that build, for example
because the file was already migrated and the project was not rebuilt,
the locations point at the wrong code: migrating twice turned
`dict<dict<string>>` into `dict<dict<dict>>` (#8242).
The tool now compares the source digest recorded in the build artifact with
the file on disk before migrating, and fails when they differ; `migrate-all`
counts such files as failed.
Diagnostic added (stale build artifacts):
After (diagnostic):
error: failed to run migration for /path/to/File.res because build
artifacts are out of date. rebuild the project and run the migration again
Review: Does this affect files without migrations? The check runs before the
AST comparison, so an unchanged file with a stale build also fails instead
of reporting "File did not need migration".
Fixes: #8242
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Kr4cjoUi2f5VpMvE6wT9bo
Signed-off-by: Christoph Knittel <[email protected]>
35b1f78 to
a795397
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
rescript-tools migrateapplies the deprecation locations stored in the file's.cmt/.cmti. Running it again before rebuilding used those stale locations on already migrated code, which produceddict<dict<dict>>fromdict<dict<string>>.The tool now compares the source digest recorded in the build artifact with the file on disk and refuses stale files with an error asking to rebuild (
migrate-allcounts them as failed).Fixes #8242.
New test:
tests/tools_tests/test.shedits a.resand a.resiafter the build and checks thatmigratefails with the out-of-date error.🤖 Generated with Claude Code
https://claude.ai/code/session_01Kr4cjoUi2f5VpMvE6wT9bo