-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix issue where run
command fails when runner workload has ENV but original workload does not
#227
Conversation
WalkthroughThe changes introduce a fix for the Changes
Sequence Diagram(s)sequenceDiagram
participant Runner
participant Command
participant Base
Runner->>Command: Execute run command
Command->>Base: Call step_finish(success, abort_on_error)
Base-->>Runner: Return success or error
Note over Base: Handle error based on abort_on_error
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- CHANGELOG.md (1 hunks)
- lib/command/base.rb (2 hunks)
- lib/command/run.rb (1 hunks)
- spec/command/run_spec.rb (1 hunks)
Additional context used
LanguageTool
CHANGELOG.md
[uncategorized] ~19-~19: Use a comma before ‘but’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...mmand fails when runner workload has ENV but original workload does not. [PR 227](ht...(COMMA_COMPOUND_SENTENCE_2)
Additional comments not posted (4)
spec/command/run_spec.rb (1)
256-276
: Good addition of test coverage for environment variable scenarios.The new context block effectively tests the scenario where the runner workload has environment variables while the original workload does not. This enhances the robustness of the test suite.
lib/command/base.rb (2)
468-473
: Streamlined error handling instep_finish
.The addition of the
abort_on_error
parameter provides better control over error handling, allowing the process to exit conditionally. This change improves code cohesion by integrating error handling into the completion step.
493-496
: Direct error message handling instep
.Writing the error message directly to temporary stderr instead of using a separate method simplifies the error handling process and reduces unnecessary method calls.
lib/command/run.rb (1)
210-210
: Robust handling of environment variables inupdate_runner_workload
.Ensuring
container_spec["env"]
is always an array prevents potentialnil
assignments and enhances the robustness of the code by avoiding unexpected behavior.
New spec is passing.
Summary by CodeRabbit
Bug Fixes
run
command failing when environment variables differ between workloads, enhancing command robustness.Tests