Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add edit.dependents #5466

Merged
merged 8 commits into from
Dec 2, 2024
Merged

feat: add edit.dependents #5466

merged 8 commits into from
Dec 2, 2024

Conversation

mitchellwrosen
Copy link
Member

@mitchellwrosen mitchellwrosen commented Nov 26, 2024

Overview

This PR adds a small variant of edit that also grabs all of the thing's transitive dependents. This is intended as sort of a temporary solution to the known issue of ending up in the following situation:

  • foo depends on bar depends on Baz
  • foo and Baz are in the scratch file
  • Baz is changed in the file but not saved to the codebase yet
  • type errors coming from foo are missing names, because it's calling bar which is still calling old-now-nameless Baz

The fix in this small example is to edit bar, but more generally an edit.dependents Baz here will do what you want – get the full transitive closure of dependents in the file (so that any changes to Baz are fully propagated within the file).

Interesting/controversial decisions

Not very controversial, but I also made it so temporary output messages that are displayed only within a console region are now also visible in transcripts. Ever merge in a transcript is now a lot more verbose but I think that's totally fine because transcripts are meant to capture ucm output.

Test coverage

I've added a new transcript. I tried just adding onto the end of edit-command.md, but was getting really strange results. You can already see in that transcript one instance of spookiness that was worked around just by repeating a stanza. Our transcript runner has some terrible bug.

@mitchellwrosen mitchellwrosen marked this pull request as ready for review November 26, 2024 18:01
@aryairani
Copy link
Contributor

A little bit of a change in how we set up transcripts now; I sent @sellout a request to clarify on #5406, or you can follow up out-of-band

Copy link
Contributor

@aryairani aryairani left a comment

Choose a reason for hiding this comment

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

Thanks, this will be good.
We should set up a time soon to sort out the longer-term fix.

@sellout
Copy link
Contributor

sellout commented Nov 26, 2024

A little bit of a change in how we set up transcripts now; I sent @sellout a request to clarify on #5406, or you can follow up out-of-band

For this PR, I think you should

  1. move edit-dependents-command.md into transcripts/idempotent/;
  2. revert the other changes in transcripts/; and
  3. run stack exec transcripts to update the results in the new transcript layout.

Alternatively, you could

  1. delete transcripts/edit-dependents-command.md;
  2. move (note: “.output” gets removed in the moves)
    • transcripts/edit-dependents-command.output.md → transcripts/idempotent/edit-dependents-command.md,
    • transcripts/fix-5326.output.md → transcripts/idempotent/fix-5326.md, and
    • transcripts/help.output.md → transcripts/idempotent/help.md;
  3. stage everything; and
  4. run stack exec transcripts and ensure that the diff has only cosmetic changes.

The result should be the same either way. the latter maybe gives a bit more confidence that the new transcript results match the ones you got before merging in trunk.

@aryairani
Copy link
Contributor

bump @mitchellwrosen re merge conflicts

@mitchellwrosen
Copy link
Member Author

@aryairani Oops, done now!

@aryairani aryairani merged commit ce0e9af into trunk Dec 2, 2024
32 checks passed
@aryairani aryairani deleted the 24-10-16-edit-dependents branch December 2, 2024 20:21
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.

3 participants