forked from nixops4/nix-bindings-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix after updating nix #21
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*_in_chaintest no longer exercises chained recoverable errors.Line 2980 says this case wraps recoverable errors in a chain, but Lines 2981-2983 now return the recoverable error directly. This makes the test behavior effectively duplicate the previous recoverable test.
Consider either restoring an actual wrapped source error here, or renaming/updating the test intent and comments.
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except we have to do
Ok(...?)because of this:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RossComputerGuy, understood — theOk(es.new_value_int(42)?)change is clearly a required fix for the type mismatch (Result<Value, EvalStateError>vsResult<Value, Box<dyn Error>>). That part is correct.My concern about the
_in_chaintest is actually separate and still stands: the inline comment on Line ~2980 says "Wrap RecoverableError in.context(), pushing it down the chain", but neither the old code nor the new code actually wraps the error in a chain — both return aRecoverableErrordirectly. This makes the_in_chaintest functionally equivalent toeval_state_primop_recoverable_error, and the stale comment is misleading.Would you be open to either:
If chaining is the actual intended behavior to test, option 2 ensures the
source()traversal in the recoverable-error detection path is exercised. If the test is just about retry-on-recoverable, option 1 (comment fix + possible rename) would suffice.🧠 Learnings used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no
.context()function because that was from upstream using anyhow, this fork does not use anyhow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RossComputerGuy, thanks for the context — that clears it up. The stale comment is a leftover from upstream's anyhow-based chaining approach, which no longer applies here.Since the
_in_chaintest can't actually exercise error-source chaining without anyhow (or a hand-rolled wrapper), the simplest clean-up would be to update the test name and remove the misleading comment, since it's effectively just another retry-on-recoverable test at this point. For example:That said, if you'd prefer to leave the test as-is and just drop the misleading comment, that works too. Happy to defer to your preference.
✏️ Learnings added
🧠 Learnings used