Conversation
…utionContext mutation RewriteTest's immutableExecutionContext check only covered putMessage. computeMessageIfAbsent wrote to the raw message map, and DelegatingExecutionContext didn't forward it, so writes through any wrapper view (including the WatchableExecutionContext recipes receive) bypassed the check; writes through getMessages() did as well. - Forward computeMessageIfAbsent in DelegatingExecutionContext and validate it in CursorValidatingExecutionContextView, only when a value is actually computed. - Return a validating map from getMessages() while the check is enabled. - Allow the run-scoped keys used by Singleton and the Python/JavaScript dependency helpers. - Move Maven and Node context views off getMessages().computeIfAbsent. - Cache UpgradeTransitiveDependencyVersion's parsed Gradle snippets on the root cursor, threading the parent cursor so nested visitors share it across files.
Member
Author
|
@sambsnyd I think you'd added these checks earlier, right? There were some gaps, and a bug in the missed delegation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RewriteTest's
immutableExecutionContextcheck only coveredputMessage:computeMessageIfAbsentand writes throughgetMessages()went straight to the raw message map, andDelegatingExecutionContextdidn't forwardcomputeMessageIfAbsent, so recipes, which receive a wrapped context, bypassed the check entirely. This forwards that call, validates it (only when a value is actually computed), and returns a validating map fromgetMessages()while the check is on. Production runs are unaffected, as the check is a test-onlyassert. In-repo writers are adjusted: the Maven and Node context views move tocomputeMessageIfAbsent, the run-scoped Singleton and Python/JavaScript keys are allowed, andUpgradeTransitiveDependencyVersioncaches its parsed Gradle snippets on the root cursor, now threading the parent cursor so nested visitors share it across files. Downstream test suites were run against this change; the only failures it surfaced are fixed by the PRs below.Downstream:
GradleUseJunitJupiter's template on the root cursor