chore: stabilize build pass and unify service/runtime artifacts#272
chore: stabilize build pass and unify service/runtime artifacts#272KooshaPari wants to merge 1 commit intorouter-for-me:mainfrom
Conversation
Summary of ChangesHello @KooshaPari, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request rebrands and significantly enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request introduces a library-first architecture with pkg/llmproxy, which significantly improves reusability. It also adds several management and planning tools. I have identified a potential deadlock in the I/O capturing logic of the management CLI and a regex bug in the release linting script that should be addressed to ensure the stability of the build and runtime artifacts.
| func captureStdIO(runFn func() error) (string, string, error) { | ||
| origStdout := os.Stdout | ||
| origStderr := os.Stderr | ||
|
|
||
| stdoutRead, stdoutWrite, err := os.Pipe() | ||
| if err != nil { | ||
| return "", "", err | ||
| } | ||
| stderrRead, stderrWrite, err := os.Pipe() | ||
| if err != nil { | ||
| _ = stdoutRead.Close() | ||
| _ = stdoutWrite.Close() | ||
| return "", "", err | ||
| } | ||
|
|
||
| os.Stdout = stdoutWrite | ||
| os.Stderr = stderrWrite | ||
|
|
||
| runErr := runFn() | ||
|
|
||
| _ = stdoutWrite.Close() | ||
| _ = stderrWrite.Close() | ||
| os.Stdout = origStdout | ||
| os.Stderr = origStderr | ||
|
|
||
| var outBuf bytes.Buffer | ||
| _, _ = io.Copy(&outBuf, stdoutRead) | ||
| _ = stdoutRead.Close() | ||
| var errBuf bytes.Buffer | ||
| _, _ = io.Copy(&errBuf, stderrRead) | ||
| _ = stderrRead.Close() | ||
|
|
||
| return outBuf.String(), errBuf.String(), runErr | ||
| } |
There was a problem hiding this comment.
The captureStdIO function has a potential deadlock risk. If runFn writes more data than the OS pipe buffer (typically 64KB), it will block indefinitely because the reading from the pipe only starts after runFn returns. To fix this, reading from the pipes should happen in separate goroutines. Additionally, os.Stdout and os.Stderr should be restored using a defer block to ensure they are reset even if runFn panics.
3a8baa3 to
4466625
Compare
temp