Skip to content

✨ 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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Fix3dP0int
Copy link

@Fix3dP0int Fix3dP0int commented Jun 17, 2025

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.

  • Tests for the changes have been added (for bug fixes/features)

Which issue(s) this PR fixes

Related to #4627

@Fix3dP0int Fix3dP0int changed the title ✨ feat: Refactor scorecard serve cmd (#4627) ✨ feat: Refactor scorecard serve cmd Jun 17, 2025
@spencerschrock
Copy link
Member

Don't have time to look in-depth, but wanted to make one comment:

The current serve uses Go’s built-in http package, which lacks modern features

What features specifically? Go 1.22 made good strides at least for the routing
https://go.dev/blog/routing-enhancements

@Fix3dP0int
Copy link
Author

Sorry. I'm unfamiliar with new features of Go. It seems that chi isn't necessary. I will revert it. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants