-
Notifications
You must be signed in to change notification settings - Fork 578
✨ feat: Refactor scorecard serve cmd #4665
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
Don't have time to look in-depth, but wanted to make one comment:
What features specifically? Go 1.22 made good strides at least for the routing |
Sorry. I'm unfamiliar with new features of Go. It seems that |
Signed-off-by: fixedpoint <961750412@qq.com>
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.
At a high level this looks like what we want, an http wrapper around the CLI. You said MCP will be built on top of this API, so is it matching what you need for that?
There are a few things that need changed, which I've left individual comments on. The linter also has some thoughts with this file.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4665 +/- ##
==========================================
+ Coverage 66.80% 67.86% +1.05%
==========================================
Files 230 249 +19
Lines 16602 19069 +2467
==========================================
+ Hits 11091 12941 +1850
- Misses 4808 5268 +460
- Partials 703 860 +157 🚀 New features to boost your workflow:
|
This pull request has been marked stale because it has been open for 10 days with no activity |
This pull request has been marked stale because it has been open for 10 days with no activity |
…ions, and remove some local parameters
This pull request has been marked stale because it has been open for 10 days with no activity |
Back from vacation, going through my backlog from before and reopenning PRs that went stale waiting for me. |
Signed-off-by: Spencer Schrock <sschrock@google.com>
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.
Thanks for your patience waiting on my review, and for fixing up the serve
command!
What kind of change does this PR introduce?
feature
What is the current behavior?
The current serve uses Go’s built-in http package, which lacks modern features. And It fails to correctly aggregate the total score, and parameters and details cannot be retrieved properly.
What is the new behavior (if this is a feature change)?**
This PR refactors the serve component by migrating the original CLI-based parameter input to a RESTful API interface. Additionally, I replaced the native net/http logic with the chi router, which is lightweight yet expressive and well-suited for modular HTTP services in Go.
Which issue(s) this PR fixes
Related to #4627