Skip to content

Improve Get/MultiGet migration guide#23086

Closed
wisechengyi wants to merge 1 commit intopantsbuild:automation/release/2.32.0.dev0from
wisechengyi:automation/release/2.32.0.dev0
Closed

Improve Get/MultiGet migration guide#23086
wisechengyi wants to merge 1 commit intopantsbuild:automation/release/2.32.0.dev0from
wisechengyi:automation/release/2.32.0.dev0

Conversation

@wisechengyi
Copy link
Contributor

No description provided.

@wisechengyi wisechengyi added documentation category:documentation release-notes:not-required [CI] PR doesn't require mention in release notes labels Feb 8, 2026
@wisechengyi wisechengyi requested a review from benjyw February 8, 2026 21:03
@wisechengyi
Copy link
Contributor Author

Hi @benjyw I marked this one 'release-notes:not-required', not sure if correct. Please kindly advise.

| `Get(ProcessResult, Process(...))` | `execute_process_or_raise(**implicitly(Process(...)))` | `pants.engine.intrinsics` | `ProcessResult` |
| `Get(FallibleProcessResult, Process(...))` | `execute_process(Process(...), **implicitly())` | `pants.engine.intrinsics` | `FallibleProcessResult` |

⚠️ **Important**: In the old API, `Get(Snapshot, AddPrefix(...))` would return a `Snapshot`. In the new API, `add_prefix` and `remove_prefix` return `Digest`. If you need a `Snapshot`, you must explicitly convert:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not strictly true. You can use **implicitly(AddPrefix(...)) in a call to digest_to_snapshot. It's up for debate whether that is preferable to two explicit calls.

**Current status:**
- ✅ Pants core has migrated to call-by-name
- ⚠️ External plugins may still use `Get`/`MultiGet`
- 🎯 **Action required:** Plugin authors must migrate before Pants 2.31
Copy link
Contributor

Choose a reason for hiding this comment

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

It's actually 2.32


#### Pattern A: Intrinsics (No `**implicitly()` needed)

Most intrinsics are called directly without `**implicitly()`:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is inaccurate. Intrinsics aren't special this way, it's just that most of them only take one argument, so there is no need for **implicitly() if you call them directly. But you can still call an intrinsic with **implicitly() if you want the argument to be computed implicitly from another intrinsic, say.

@benjyw
Copy link
Contributor

benjyw commented Feb 8, 2026

Hi @wisechengyi . Was an LLM involved in the creation of this change? Was this based on your experience with upgrading your plugins? Either way, I think some of it is pretty inaccurate and misleading.

I think it would be better if this took the form of a blog post we can link to from that page, instead of wholesale huge edits to the page.

@cburroughs cburroughs deleted the branch pantsbuild:automation/release/2.32.0.dev0 February 9, 2026 15:36
@cburroughs cburroughs closed this Feb 9, 2026
@cburroughs
Copy link
Contributor

image

Hi @wisechengyi the branch this was targeting appears to have been deleted by some release automation. Please don't take this as commentary on the PR and free free to re open or re-create (GitHub won't let me at least just re-open)

@benjyw
Copy link
Contributor

benjyw commented Feb 9, 2026

Ah yes, this should be targeting main. @wisechengyi is this AI gone wild?

@wisechengyi
Copy link
Contributor Author

wisechengyi commented Feb 9, 2026

Hi @wisechengyi . Was an LLM involved in the creation of this change? Was this based on your experience with upgrading your plugins? Either way, I think some of it is pretty inaccurate and misleading.

I think it would be better if this took the form of a blog post we can link to from that page, instead of wholesale huge edits to the page.

Yes, asked claude to improve the doc after it ran into some bumps along the way, so some inaccuracies may be expected. Sorry should've called it out first.

@wisechengyi
Copy link
Contributor Author

Ah yes, this should be targeting main. @wisechengyi is this AI gone wild?

PR creation was performed by me, as I did not find docs/docs/writing-plugins/the-rules-api/migrating-gets.mdx on main.

@benjyw
Copy link
Contributor

benjyw commented Feb 10, 2026

Ah yes, it was deleted at HEAD because it's no longer needed in 2.32.

I think this would be best as a blog post, if you have the energy to fix it up manually. But the current text is pretty inaccurate. Maybe it helped Claude along, but it would be misleading to a human reader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:documentation documentation release-notes:not-required [CI] PR doesn't require mention in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants