scorecard icon indicating copy to clipboard operation
scorecard copied to clipboard

:sparkles: feat: Refactor scorecard serve cmd

Open gcanlin opened this issue 7 months ago • 3 comments

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

gcanlin avatar Jun 17 '25 15:06 gcanlin

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

spencerschrock avatar Jun 17 '25 15:06 spencerschrock

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

gcanlin avatar Jun 19 '25 16:06 gcanlin

Codecov Report

:x: Patch coverage is 0% with 189 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 67.86%. Comparing base (353ed60) to head (327a826). :warning: Report is 231 commits behind head on main.

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     
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 24 '25 17:06 codecov[bot]

This pull request has been marked stale because it has been open for 10 days with no activity

github-actions[bot] avatar Jul 05 '25 02:07 github-actions[bot]

This pull request has been marked stale because it has been open for 10 days with no activity

github-actions[bot] avatar Jul 17 '25 02:07 github-actions[bot]

This pull request has been marked stale because it has been open for 10 days with no activity

github-actions[bot] avatar Aug 08 '25 02:08 github-actions[bot]

Back from vacation, going through my backlog from before and reopenning PRs that went stale waiting for me.

spencerschrock avatar Sep 03 '25 21:09 spencerschrock