-
Notifications
You must be signed in to change notification settings - Fork 222
[debug] Fix hook snapshot command for nested hook paths #771
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
Conversation
Signed-off-by: Smyslov Maxim <[email protected]>
Signed-off-by: Smyslov Maxim <[email protected]>
Signed-off-by: Smyslov Maxim <[email protected]>
Signed-off-by: Smyslov Maxim <[email protected]>
Signed-off-by: Smyslov Maxim <[email protected]>
Signed-off-by: Smyslov Maxim <[email protected]>
Signed-off-by: Smyslov Maxim <[email protected]>
9a13f3e
to
5e7cf3d
Compare
Signed-off-by: Smyslov Maxim <[email protected]>
5e7cf3d
to
4e60188
Compare
Signed-off-by: Smyslov Maxim <[email protected]>
0e12cba
to
813e20f
Compare
Signed-off-by: Smyslov Maxim <[email protected]>
813e20f
to
5531893
Compare
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.
Pull Request Overview
This PR fixes the snapshot command for hooks in nested directories, updates the CI runner image, and corrects the startup command wrapping to prevent unintended server startup.
- Enable
hook snapshot
to handle nested paths via regex-based routing - Update GitHub Actions runner to Ubuntu 24.04 and resolve deprecation warnings
- Wrap the
start
function body properly to defer server startup until the explicit command
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
pkg/shell-operator/debug_server.go | Replace specific Chi route with regex-based handler for nested paths |
pkg/debug/server.go | Enhance format extraction from URI, add NotFoundError handling |
cmd/shell-operator/start.go | Wrap startup logic in returned function to control server launch |
.github/workflows/docs.yaml | Bump GitHub Actions runner from ubuntu-20.04 to ubuntu-24.04 |
Comments suppressed due to low confidence (2)
pkg/debug/server.go:159
- [nitpick] Defaulting an empty format to
text/plain
changes the previous default behavior (which was JSON). Confirm this new default is intended for all existing endpoints without explicit format parameter.
case "":
pkg/shell-operator/debug_server.go:61
- The catch-all route "/hook/*" may intercept other hook endpoints (e.g.,
/hook/list
). Consider narrowing the pattern to only match snapshot paths (for example/hook/*/snapshots{format:(json|yaml|text)}
) or ensure route ordering prevents conflicts.
dbgSrv.RegisterHandler(http.MethodGet, "/hook/*", func(r *http.Request) (interface{}, error) {
983e86d
to
f2d5596
Compare
Signed-off-by: Smyslov Maxim <[email protected]>
f2d5596
to
cd9d129
Compare
Overview
This PR resolves an issue where the shell-operator hook snapshot command did not work correctly for hooks located in nested directory paths.
What this PR does / why we need it
Closes #727
Changes made:
hook snapshot
command to properly handle nested hook paths/shell-operator start
command due to unwrapped start.go start function body in return.Output of
Before:
After:
Command
/shell-operator/ hook list
works as beforeSpecial notes for your reviewer