-
Notifications
You must be signed in to change notification settings - Fork 232
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
run_before_script
: Fix newlines
#960
Conversation
Reviewer's Guide by SourceryThis pull request refactors the Sequence diagram for chunk-based script output processingsequenceDiagram
participant C as Caller
participant R as run_before_script
participant P as subprocess.Popen
participant O as stdout
participant E as stderr
C->>R: run_before_script(script_file, cwd)
R->>P: Create process
activate P
loop Until process ends
R->>P: poll()
R->>O: read(1024)
alt has output
O-->>R: chunk
R->>R: buffer chunk
R->>R: write to stdout if TTY
end
R->>E: read(1024)
alt has error output
E-->>R: chunk
R->>R: buffer chunk
R->>R: write to stderr if TTY
end
end
R->>P: wait()
P-->>R: return code
alt return code != 0
R->>R: raise BeforeLoadScriptError
end
R-->>C: return code
deactivate P
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @tony - I've reviewed your changes - here's some feedback:
Overall Comments:
- The old implementation should be removed rather than kept as run_before_script2. Having both versions will create confusion and maintenance overhead.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
8adde79
to
99f0354
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #960 +/- ##
=======================================
Coverage 73.11% 73.11%
=======================================
Files 26 26
Lines 1856 1856
Branches 352 352
=======================================
Hits 1357 1357
Misses 395 395
Partials 104 104 ☔ View full report in Codecov by Sentry. |
run_before_script
: Use chunk-based outputrun_before_script
: Fix newlines
Follow up to #959
Summary by Sourcery
Enhancements:
run_before_script
execution.