Skip to content

Conversation

@zth
Copy link
Member

@zth zth commented Jan 7, 2026

This fixes so that the migration tool a) does not touch files it does not apply any migrations to (it used to format them), and b) does not attempt to do migrations on dependencies.

Closes #8152, #8096

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 7, 2026

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@8157

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@8157

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@8157

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@8157

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@8157

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@8157

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@8157

commit: 650d0c6

@zth zth marked this pull request as ready for review January 8, 2026 10:11
@zth zth requested a review from cknitt January 8, 2026 10:11
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 650d0c6da2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment on lines +29 to +32
deprecated_used
|> List.filter (fun (d : Cmt_utils.deprecated_used) ->
let loc_path = canonical d.source_loc.Location.loc_start.pos_fname in
not (FileSet.mem loc_path dependency_paths))

Choose a reason for hiding this comment

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

P2 Badge Identify dependency migrations by definition location

The dependency filter is keyed off d.source_loc, which is the location of the deprecated use (recorded via Builtin_attributes.check_deprecated at the call site). That means when a project file calls a deprecated API from a dependency, source_loc still points to the project file, so this filter won’t drop it and the migration will still rewrite user code. This contradicts the intended “skip dependency migrations” behavior (e.g., a project’s DeprecatedDep.oldThing() call will still be migrated). To suppress dependency-originated migrations you need to filter by where the deprecated item is defined, not the usage location.

Useful? React with 👍 / 👎.

Copy link
Member Author

Choose a reason for hiding this comment

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

How would you suggest fixing this?

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.

Migration tool should only rewrite file if actual changes were made

2 participants