Skip to content

fix(server): update server url when the port change - #210

Merged
mdevolde merged 1 commit into
jxmorris12:masterfrom
mdevolde:fix/server_url_update
Jul 1, 2026
Merged

fix(server): update server url when the port change#210
mdevolde merged 1 commit into
jxmorris12:masterfrom
mdevolde:fix/server_url_update

Conversation

@mdevolde

@mdevolde mdevolde commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

fix(server): update server url when the port change

Why the pull request was made

Because actually, when the server port change, we don't change the server url, and the healthcheck test to ensure that the server is alive will fail.

Summary of changes

  • Update LanguageTool._url when we need to change the starting port.

Screenshots (if appropriate):

Not applicable.

Applied local tests.

Resources

Not applicable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (changes to documentation only)
  • Refactor / code style update (non-breaking change that improves code structure or readability)
  • Tests / CI improvement (adding or updating tests or CI configuration only)
  • Chore / maintenance (non-breaking change that does not affect functionality, such as updating dependencies or fixing typos)
  • Other (please describe):

Checklist

  • Followed the project's contributing guidelines.
  • Updated any relevant tests.
  • Updated any relevant documentation.
  • Added comments to your code where necessary.
  • Formatted your code, run the linters, checked types and tests.
  • Added your changes to the CHANGELOG file, if applicable.

@mdevolde mdevolde self-assigned this Jul 1, 2026
@mdevolde
mdevolde force-pushed the fix/server_url_update branch from cf15a27 to 34d8701 Compare July 1, 2026 12:31
@mdevolde
mdevolde marked this pull request as ready for review July 1, 2026 12:31
@mdevolde
mdevolde requested a review from Copilot July 1, 2026 12:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a local-server retry bug in language_tool_python where, after switching to a different port due to a startup failure, the client continued sending requests to the original (now incorrect) server URL.

Changes:

  • Update LanguageTool._url whenever _start_server_on_free_port() switches to a new port after a ServerError.
  • Document the fix in CHANGELOG.md under Unreleased → Fixed.

Reviewed changes

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

File Description
src/language_tool_python/server.py Keeps _url in sync with _port when retrying local server startup on a new port.
CHANGELOG.md Adds an Unreleased “Fixed” entry describing the corrected port/URL mismatch behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.65%. Comparing base (f3d5fc1) to head (34d8701).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/language_tool_python/server.py 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #210      +/-   ##
==========================================
- Coverage   80.70%   80.65%   -0.05%     
==========================================
  Files          13       13              
  Lines        1767     1768       +1     
==========================================
  Hits         1426     1426              
- Misses        341      342       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mdevolde
mdevolde merged commit 5441b53 into jxmorris12:master Jul 1, 2026
13 checks passed
@mdevolde
mdevolde deleted the fix/server_url_update branch July 1, 2026 12:36
mdevolde added a commit to mdevolde/language_tool_python that referenced this pull request Jul 1, 2026
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.

3 participants