Skip to content

Decouple transport from hostname; store it in hgrc [chorus] section - #408

Open
hahn-kev-bot wants to merge 1 commit into
masterfrom
t3/decouple-transport-from-hostname
Open

hahn-kev-bot wants to merge 1 commit into
masterfrom
t3/decouple-transport-from-hostname

Conversation

@hahn-kev-bot

@hahn-kev-bot hahn-kev-bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

changes how transport is selected to use a parameter saved in hgrc, instead of determining based on the host name. This will let #406 define a 3rd option so we can release experiments without having a fallback.


AI summary

Summary

  • New HgTransportKind enum (HgWeb / Resumable) replaces the implicit "does the URL contain 'resumable'?" heuristic for picking between hgweb and HgResume transports.
  • Transport is now stored in .hg/hgrc under a new [chorus] section (transport = hgweb / transport = resumable), independent of the repository URL.
  • ServerSettingsModel: BandwidthItem now wraps HgTransportKind; Transport property exposes the choice for both Lexbox and custom URLs. SaveSettings writes the transport to hgrc in addition to setting the address.
  • Lexbox host simplified: the resumable variant used to require a separate resumable.* hostname; that coupling is removed. Both transports are served from hg-public/hg-private. Legacy resumable.languageforge.org URLs are rewritten to the canonical host on load.
  • Bandwidth dropdown now appears for custom URLs as well as Lexbox (previously it was hidden for custom URLs).
  • InternetCloneSettingsModel.SetRepositoryAddress passes the selected transport to both the address and the hgrc [chorus] section.
  • Integration test helper no longer puts "resumable" in the repo code; the transport is explicit via HgTransportKind.Resumable.
  • New unit tests cover: transport round-trips on save/reload, saved transport overriding URL guess, custom URL transport, AliasName not including bandwidth, and HttpRepositoryPath transport override.

Testing

  • 96/96 LibChorusTests pass on net8.0 and net462 (ServerSettingsModel, InternetCloneSettingsModel, RepositoryAddress, HgRepository test classes).
  • 22/22 Chorus.Tests server-settings and clone tests pass on net462.
  • Docker-based integration tests (HgResumeSendReceiveTests) not run locally.

This change is Reviewable

- Add HgTransportKind enum (HgWeb / Resumable) replacing BandwidthEnum
- Save transport as `transport = hgweb|resumable` in [chorus] section of .hg/hgrc
- Lexbox now serves both transports from hg-public/hg-private; legacy resumable.languageforge.org URLs are migrated to the standard host on load
- BandwidthItem.Value → .Transport; AliasName no longer includes bandwidth
- GetRepositoryPathsInHgrc propagates saved transport to returned addresses
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Test Results

       9 files  ±  0     371 suites  +24   53m 23s ⏱️ - 7m 23s
1 062 tests +20  1 006 ✔️ +20    56 💤 ±0  0 ❌ ±0 
3 349 runs  +60  3 226 ✔️ +60  123 💤 ±0  0 ❌ ±0 

Results for commit c7383f5. ± Comparison against base commit 0765ad6.

This pull request removes 2 and adds 22 tests. Note that renamed tests count towards both.
InitFromUri_PrivateResumableLangForge_DomainAndBandwidthCorrectAndNotCustom
InitFromUri_ResumableLangForge_DomainAndBandwidthCorrectAndNotCustom
AliasName_Lexbox_DoesNotIncludeBandwidth(HgWeb)
AliasName_Lexbox_DoesNotIncludeBandwidth(Resumable)
GetPotentialRepoUri_Resumable_DoesNotInsertCredentials
GetTransport_NothingSaved_ReturnsNull
InitFromProjectPath_SavedTransportOverridesUrl
InitFromUri_CustomResumableUrl_DefaultsToResumable
InitFromUri_LegacyResumableLangForge_MovedToLexboxHostAndResumableAndNotCustom
InitFromUri_PrivateLegacyResumableLangForge_MovedToLexboxHostAndResumableAndNotCustom
SaveSettings_CustomUrl_TransportRoundTripsIndependentOfUrl(HgWeb)
SaveSettings_CustomUrl_TransportRoundTripsIndependentOfUrl(Resumable)
…

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.

2 participants