-
Notifications
You must be signed in to change notification settings - Fork 13
Bref serverless support #414
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
f3dc999
b8dfdc6
396bd46
b7bd588
01ef84c
af20dda
c520bd4
4cf396a
d5c523c
7399dc8
2fc8720
4b2df34
d87d11f
0c3250e
35a1bf2
48726f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -78,7 +78,18 @@ func CreateServer(token string) *ServerData { | |||||||||||||||||
| return Servers[token] | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| const ( | ||||||||||||||||||
| Version = "1.5.4" | ||||||||||||||||||
| SocketPath = "/run/aikido-" + Version + "/aikido-agent.sock" | ||||||||||||||||||
| ) | ||||||||||||||||||
| const Version = "1.5.4" | ||||||||||||||||||
|
|
||||||||||||||||||
| var SocketPath string | ||||||||||||||||||
|
|
||||||||||||||||||
| func isRunDirWritable() bool { | ||||||||||||||||||
| return os.MkdirAll("/run/aikido-writetest", 0777) == nil && os.Remove("/run/aikido-writetest") == nil | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isRunDirWritable combines two filesystem operations with && on one line; split the MkdirAll and Remove calls into separate statements with explicit error handling for clarity. Show fix
Suggested change
Details✨ AI Reasoning Reply |
||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| func init() { | ||||||||||||||||||
| runDir := "/run/aikido-" + Version | ||||||||||||||||||
| if !isRunDirWritable() { | ||||||||||||||||||
| runDir = "/tmp/aikido-" + Version | ||||||||||||||||||
| } | ||||||||||||||||||
| SocketPath = runDir + "/aikido-agent.sock" | ||||||||||||||||||
| } | ||||||||||||||||||
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.
isRunDirWritable combines os.MkdirAll and os.Remove in one boolean expression; separate the operations and handle errors explicitly to improve readability and debuggability.
Show fix
Details
✨ AI Reasoning
A new utility function returns the combined result of directory creation and removal in one expression. This compresses two IO operations into one line, making failure modes harder to inspect and increasing reasoning complexity for future maintainers.
Reply
@AikidoSec feedback: [FEEDBACK]to get better review comments in the future.Reply
@AikidoSec ignore: [REASON]to ignore this issue.More info