Skip to content

Conversation

@harsha08-2k6
Copy link

…allow OS to automatically assign available port, removing hardcoded port range (8000-8010) from _prepare_server method. This resolves port conflict issues when the OAuth server fails to bind to predefined ports. Fixes #913

Refactor server preparation to use a dynamic port.

Context

What has been done

Validation

PR check list

  • As much as possible, the changes include tests (unit and/or functional)
  • If the changes affect the end user (new feature, behavior change, bug fix) then the PR has a changelog entry (see doc/dev/getting-started.md). If the changes do not affect the end user, then the skip-changelog label has been added to the PR.

…llow OS to automatically assign available port, removing hardcoded port range (8000-8010) from _prepare_server method. This resolves port conflict issues when the OAuth server fails to bind to predefined ports. Fixes GitGuardian#913

Refactor server preparation to use a dynamic port.
@harsha08-2k6 harsha08-2k6 requested a review from a team as a code owner November 24, 2025 13:14
self._extra_scopes = extra_scopes

self._prepare_server()
self.158()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi, this looks like a typo.

Copy link
Author

Choose a reason for hiding this comment

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

You're right, thanks for catching that! Fixed in 704e9aa.

if extra_scopes is not None:
self._extra_scopes = extra_scopes

self._prepare_server()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since your removed that line, the program is never entering in _prepare_server method that you edited below.

@sevbch
Copy link
Collaborator

sevbch commented Nov 26, 2025

Also, please make sure to add a test for the feature you're adding. I'll let you ask for reviews when all of this is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use OS port selection for the local OAuth server

2 participants