Repository navigation
feat!: remove legacy per-service ports - #98
Merged
Merged
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Blind-Striker
force-pushed
the
feat/remove-legacy-ports
branch
from
November 30, 2026 10:52
243a0ff to
c8d3450
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
T6 of LocalStack.Client 3.1 removes the legacy per-service ports. Every endpoint now uses
EdgePort(spec v2 §3.12 LP and §3.13 RM; ADR 0003, D3). It closes #26, and #25 is closed as obsolete (D4).Gate: IL scan before removal (lead's condition)
Before removing anything, I scanned the published
LocalStack.Client.Extensions3.0.0 assets (netstandard2.0,net10.0,net11.0) with ilspycmd metadata tables and System.Reflection.Metadata, againstrelease/3.1b21a5a1.Constants.UseLegacyPortsis astatic literal, so IL cannot reference it as a field. The tagged Extensions source does not use it.ldstr "UseLegacyPorts"configuration key. LP-3 covers that.ISession.CreateClientByInterface<T>(bool)gap. That fix is in fix: keep Extensions 3.0 binaries working on Core 3.1 #97.What changes
AwsServiceEndpoint(its port and its URL) uses the configuredEdgePort.IConfigOptions.UseLegacyPortsandConfigOptions.UseLegacyPorts;ConfigOptions(string, bool, bool, int)constructor;Constants.UseLegacyPorts;AwsServiceEndpointMetadata.Portand.ByPort(int);IConfig.GetAwsServicePorts()/GetAwsServicePort(AwsService)and theirConfigimplementations (decision 12; this overrides the plan, which kept them).ConfigOptions(string localStackHost = …, bool useSsl = …, int edgePort = …, bool useServiceUrl = false)replaces both the 3.0 four-argument constructor and the never-shipped 3.1 five-argument one (spec §4.2). The parameterless constructor stays.internal ConfigOptions.ApplyConfiguration(string?, bool?, bool? useLegacyPorts, int?)and passes the legacy value as argument 3. The signature, names and defaults are unchanged, and the method ignores argument 3.ConfigOptionsFriendContractTestsis unchanged and green.LocalStack:Config:UseLegacyPorts. A leftover key is ignored whatever its value, including"yes", which 3.0 rejected.GetServiceUrl(proto, host, port = null)keeps its signature. A null port becomesConstants.EdgePort.endPointPatternconstructor parameter is removed. The publicEndPointPatternproperty returns the common pattern.ToString()drops the port.RequireTraceForFailsaferegex now also accepts space-separatedDefineConstants. Proof:-p:DefineConstants='DEBUG TRACE'failed the old guard and passes the new one;-p:DefineConstants=DEBUGstill fails with the guard's message.Package-validation suppressions (each with its spec reference)
dotnet pack -p:GenerateCompatibilitySuppressionFile=trueadded exactly these 40CP0002entries tosrc/LocalStack.Client/CompatibilitySuppressions.xml. The 48 existing entries are retained, the Extensions file is byte-identical, and the baseline stays 3.0.0.IConfigOptions.UseLegacyPortsConfigOptions.UseLegacyPortsConfigOptions(string, bool, bool, int)Constants.UseLegacyPortsAwsServiceEndpointMetadata.PortAwsServiceEndpointMetadata.ByPort(int)IConfig.GetAwsServicePorts()IConfig.GetAwsServicePort(AwsService)Config.GetAwsServicePorts()Config.GetAwsServicePort(AwsService)These match the spec §4.1 measurements: 24 LP-2 entries and 16 decision-12 entries. The generated XML carries no comments, so the references live in this table.
Retained public members
AwsServiceEndpoint.Port, which is now alwaysEdgePort.GetServiceUrlandEndPointPattern(C2 (a), owner).ByName,ByEnum,ISessionReflection.SetClientRegionandAddDefaultAwsOptions(AWSOptions)(RM-2).Tests (red first)
ConfigurationTests.Every_Endpoint_Should_Use_The_Edge_PortServiceCollectionExtensionsTests.AddLocalStack_Should_Ignore_A_Leftover_UseLegacyPorts_Key_Of_Any_Value("true","false","yes")"true"gave 4572,"yes"threw a Boolean conversion error → all passGetServiceUrl_Should_Use_The_Default_Edge_Port_When_The_Port_Is_NullDifferenceComparerTests(framework-scoped deltas, below)Existing-test edits (authorized list):
GetAwsServicePort(s)tests, and the four legacy-on rows in each of the two URL theories.Every_Endpoint_Should_Use_The_Edge_Portcovers them.GetConfigOptionsand fixture tests.SessionCompatibilityTests.CreateClient_Should_Use_Injected_Reflection_For_Metadata_Config_Style_And_CredentialsandGeneratorTests.Generator_Should_Leave_Private_Closed_Generic_Clients_To_The_Fallback, because the injected config no longer passesuseLegacyPorts: true.Differential (T-6), row B20
"yes"scenarios moved to the sub-rowB20/non-boolean, following the existing convention (B4/use-ssl).B20records the per-service proxy port changing to the edge port (4572/4575 → 4566).B20/non-booleanrecords binding failure → success.Boolean.Parseresource omits the value. So a delta may now carry an optional"targetFramework"(exact short TFM). It then applies, both as accepted and as required, only on that lane. Unscoped deltas behave as before.B20/non-booleanhas onecreationdelta fornet10.0and one fornet472.netstandard2.0asset) usesBooleanConverter.ConvertFromInvariantStringwrapped inInvalidOperationException, and the .NET Framework converter wraps theFormatException. The Windows CI lane on this PR is the evidence.Docs
UseLegacyPortsrow is removed and the service-URL example now uses the new constructor. The three copies are byte-identical.docs/adr/README.md. Also updated: ADR 0005,GLOSSARY.md,client-runtime.md,docs/reference/endpoint-behavior.md, andtesting-style.md(framework-scoped deltas).Constants.UseLegacyPortsis a recompile-only break because compiled reads inlinedfalse.edgePort;new ConfigOptions(host, false, default)still compiles but now sets port 0, so remove the argument or nameedgePort:.GetServiceUrl("http", "host")still binds, but it now uses 4566 instead of the per-service port. This applies in eitherUseLocalStackmode.Verification
Linux, after the last code commit:
LocalStack.Client.TestsLocalStack.Client.Extensions.TestsLocalStack.Client.Integration.TestsLocalStack.Client.Generators.TestsLocalStack.Client.Compatibility.TestsOther checks:
LocalStackAuth!=Required): 188/0.LOCALSTACK_NATIVE_AOT_HOSTwas unset../build.sh --target check-source: 0 findings. The four sandbox projects build.Review
All three review passes were Astra (high), because GLM was at its usage limit.
default. Minor: the const andGetServiceUrlclassification, and the sandbox examples. All fixed in3f472c5/fcd691c/15c4b0f.243a0ff.Rebase onto #97
#98 is rebased onto
release/3.1c08f2b4, which includes the binary shim from #97.CHANGELOG.md: kept fix: keep Extensions 3.0 binaries working on Core 3.1 #97's service-URL bullet,### Deprecatedand AWS-mode wording, and added this PR's legacy-port items.SessionEndpointPrecedenceTests.cs: kept fix: keep Extensions 3.0 binaries working on Core 3.1 #97'sCreateSessionhelper and used the new constructor in it.CompatibilitySuppressions.xml: regenerated inc8d3450. It now has 84 entries: the 44 fromrelease/3.1plus exactly the same 40 as above, with none removed.check-sourcesucceeded, and the READMEs are byte-identical.Follow-ups
LocalStack__Config__UseLegacyPorts(LP-6).CHANGELOG.mdandCompatibilitySuppressions.xml. Whichever merges second gets rebased, and its suppression file regenerated.Figures (added lines)