Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

reset engine rest.WithExternalListener external listener #4778

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
Loading
from

Conversation

lrobot
Copy link

@lrobot lrobot commented Apr 12, 2025


feat: reset engine can call rest.WithExternalListener to use external listener for start engine

Copy link

codecov bot commented Apr 16, 2025

Codecov Report

Attention: Patch coverage is 18.75000% with 13 lines in your changes missing coverage. Please review.

Project coverage is 94.51%. Comparing base (8690859) to head (12b03f8).
Report is 296 commits behind head on master.

Files with missing lines Patch % Lines
rest/engine.go 0.00% 4 Missing and 1 partial ⚠️
rest/internal/starter.go 42.85% 4 Missing ⚠️
rest/server.go 0.00% 4 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
rest/internal/starter.go 67.56% <42.85%> (-6.63%) ⬇️
rest/server.go 94.94% <0.00%> (-1.59%) ⬇️
rest/engine.go 97.99% <0.00%> (-2.01%) ⬇️

... and 16 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kevwan kevwan force-pushed the bWithExternalListener branch from 12b03f8 to 9e9f5f4 Compare April 18, 2025 04:37
@kevwan kevwan added enhancement New feature or request area/api Categorizes issue or PR as related to API syntax or usages. labels May 2, 2025
@kevwan kevwan requested a review from Copilot June 7, 2025 12:49
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for supplying an external net.Listener to the REST engine’s start logic via a new RunOption.

  • Introduce WithExternalListener option in rest/server.go
  • Add StartHttpWithListner helper in rest/internal/starter.go
  • Wire extListner through engine and route start to the external listener when set

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
rest/server.go New WithExternalListener RunOption and net import
rest/internal/starter.go Added StartHttpWithListner helper variant
rest/engine.go Stored extListner in engine and branch start logic
Comments suppressed due to low confidence (5)

rest/server.go:319

  • The comment above WithExternalListener refers to WithUnsignedCallback and is misleading; update it to describe setting an external listener.
// WithUnsignedCallback returns a RunOption that with given unsigned callback set.

rest/server.go:320

  • The parameter name listner is misspelled; rename it to listener for consistency.
func WithExternalListener(listner net.Listener) RunOption {

rest/internal/starter.go:20

  • Function name StartHttpWithListner is misspelled; consider renaming to StartHttpWithListener.
func StartHttpWithListner(l net.Listener, handler http.Handler, opts ...StartOption) error {

rest/engine.go:41

  • Struct field extListner is misspelled; rename to extListener to match Go spelling conventions.
extListner           net.Listener

rest/engine.go:337

  • New branch for external listener mode should have corresponding unit/integration tests to cover the extListner != nil path.
if ng.extListner != nil {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Categorizes issue or PR as related to API syntax or usages. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.