Skip to content

remove LocalPath and rename Origin to HostHeaderValue#2208

Merged
Erwinvandervalk merged 7 commits into
mainfrom
ev/bff/renames
Sep 16, 2025
Merged

remove LocalPath and rename Origin to HostHeaderValue#2208
Erwinvandervalk merged 7 commits into
mainfrom
ev/bff/renames

Conversation

@Erwinvandervalk

@Erwinvandervalk Erwinvandervalk commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

What issue does this PR address?

There's confusion around certain terms:

  • LocalPath is confusing because it can either mean a path relative to the BFF but can also be interpreted as a path locally to the filesystem.
  • Origin is confusing because people think it maps to the origin header but actually it maps to the origin data structure. Renamed it to HeaderValue, even though we also have the scheme inside it.
  • MappedToOrigin is confusing, because it implies that it maps to an origin header, but actually it maps to the Domain header.
  • Made the language MappedTo into more imperative language: MapTo
  • Some people add duplicate mappings. This should result in a warning in the logs.

fixes: https://github.com/DuendeSoftware/products-private/issues/2272
fixes: https://github.com/DuendeSoftware/products-private/issues/2357

Important: Any code or remarks in your Pull Request are under the following terms:

If You provide us with any comments, bug reports, feedback, enhancements, or modifications proposed or suggested by You for the Software, such Feedback is provided on a non-confidential basis (notwithstanding any notice to the contrary You may include in any accompanying communication), and Licensor shall have the right to use such Feedback at its discretion, including, but not limited to the incorporation of such suggested changes into the Software. You hereby grant Licensor a perpetual, irrevocable, transferable, sublicensable, nonexclusive license under all rights necessary to incorporate and use your Feedback for any purpose, including to make and sell any products and services.

(see our license, section 7)

@Erwinvandervalk Erwinvandervalk added this to the bff-4.0 milestone Sep 10, 2025
@Erwinvandervalk Erwinvandervalk self-assigned this Sep 10, 2025
@Erwinvandervalk Erwinvandervalk changed the title Rename certain terminology remove LocalPath and rename Origin to HostHeaderValue Sep 10, 2025

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

This PR renames several confusing terminology throughout the BFF codebase to improve clarity and reduce confusion around domain-specific concepts:

  • LocalPathPathMatch: Clarifies that this represents a path pattern for matching rather than a filesystem path
  • OriginHostHeaderValue: Distinguishes from HTTP origin headers and CORS concepts while better describing the actual data structure (scheme + host + port)
  • MappedToOrigin/MappedToPathMapTo/MapToHost/MapToPath: Changes from passive "mapped to" language to imperative "map to" verbs
  • SelectionCriteriaMatchingCriteria: More clearly describes the purpose of determining frontend selection
  • FrontendSelectionCriteriaFrontendMatchingCriteria: Aligns with the above naming convention

Reviewed Changes

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

Show a summary per file
File Description
Test infrastructure files Update test data builders and configuration to use new terminology
Public API verification files Update expected public API surface to reflect terminology changes
Template files Update configuration examples to use PathString instead of LocalPath
Core BFF source files Rename types, properties, and methods throughout the codebase
Documentation Update upgrade guide to reflect API changes
Performance/benchmark files Update test hosts and fixtures with new terminology

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread bff/src/Bff/DynamicFrontends/FrontendMatchingCriteria.cs Outdated
Comment thread bff/src/Bff/DynamicFrontends/HostHeaderValue.cs Outdated
Comment thread bff/src/Bff.Yarp/RemoteApi.cs Outdated

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

Copilot reviewed 56 out of 57 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread bff/test/Bff.Tests/BffFrontendSigninTests.cs Outdated
Erwinvandervalk and others added 2 commits September 15, 2025 10:38
- Also allow '/' as default frontend
- Raise warnings on duplicate frontend selection criteria

# Conflicts:
#	bff/hosts/Hosts.Bff.MultiFrontend/Program.cs
#	bff/src/Bff/DynamicFrontends/BffFrontend.cs
#	bff/test/Bff.Tests/Configuration/BffBuilderTests.cs
#	bff/test/Bff.Tests/PublicApiVerificationTests.VerifyPublicApi_Bff.verified.txt
#	bff/test/Bff.Tests/TestInfra/TestDataBuilder.cs
@pgermishuys pgermishuys requested review from Copilot and removed request for bhazen and josephdecock September 15, 2025 09:12

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

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread bff/src/Bff/DynamicFrontends/FrontendMatchingCriteria.cs
Comment thread bff/src/Bff/DynamicFrontends/BffFrontendExtensions.cs Outdated
Comment thread bff/hosts/Hosts.Bff.MultiFrontend/BffConfig.json Outdated
Comment thread bff/src/Bff/Endpoints/Internal/BffAntiForgeryMiddleware.cs Fixed
@Erwinvandervalk Erwinvandervalk merged commit 27a16d1 into main Sep 16, 2025
14 checks passed
@Erwinvandervalk Erwinvandervalk deleted the ev/bff/renames branch September 16, 2025 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants