fix(auto): *Options.from now resolves repeated options to the last occurrence - #627
Open
lbialy wants to merge 3 commits into
Open
fix(auto): *Options.from now resolves repeated options to the last occurrence#627lbialy wants to merge 3 commits into
lbialy wants to merge 3 commits into
Conversation
…currence, as documented
There was a problem hiding this comment.
Pull request overview
Updates automation option merging so repeated options use the last occurrence.
Changes:
- Refactors option reducers to left-fold with last-value precedence.
- Preserves accumulation for environment maps.
- Reorders workspace shell options and adds regression tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
ShellTest.scala |
Tests repeated environment keys. |
OptionsTest.scala |
Tests last-occurrence behavior across option types. |
Workspace.scala |
Reorders shell options by precedence. |
Stack.scala |
Updates stack option reducers. |
shell.scala |
Updates shell option merging. |
LocalWorkspace.scala |
Updates workspace option merging. |
auto.scala |
Updates login/logout option merging. |
Suppressed comments (5)
auto/src/main/scala/besom/auto/internal/auto.scala:245
- This conversion removes the prior invalid-option guard, so
LogoutOptions.from(List(null))now leaksMatchErrorrather thanAutoError. Add an explicit null case to preserve the existing failure behavior.
opt match
auto/src/main/scala/besom/auto/internal/Stack.scala:1018
- The previous fallback converted an invalid/null up option to
AutoError; this exhaustive match instead throwsMatchErrorforUpOptions.from(List(null)). Retain the former error contract with an explicit null case.
opt match
auto/src/main/scala/besom/auto/internal/Stack.scala:1175
- The previous fallback converted an invalid/null refresh option to
AutoError; this exhaustive match instead throwsMatchErrorforRefreshOptions.from(List(null)). Retain the former error contract with an explicit null case.
opt match
auto/src/main/scala/besom/auto/internal/Stack.scala:1324
- The previous fallback converted an invalid/null destroy option to
AutoError; this exhaustive match instead throwsMatchErrorforDestroyOptions.from(List(null)). Retain the former error contract with an explicit null case.
opt match
auto/src/main/scala/besom/auto/internal/Stack.scala:1377
- This removes the explicit null handling that previously raised
AutoError("Unexpected null history option");HistoryOptions.from(List(null))now throwsMatchError. Preserve the deliberate error type and message with a null case.
opt match
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…opping the inline program
…s so the required argument wins
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.
*Options.from now resolves repeated options to the last occurrence