Skip to content

Conversation

@jranson
Copy link
Member

@jranson jranson commented Jun 5, 2025

This is a major overhaul of how Paths work, along with standardization of all *Options using a ConfigOptions interface.

  • a Backend Options's Path Options member is now a slice instead a map, to ensure repeatable order parsing. Paths no longer need to be named.
  • Custom path options now work using an updated Overlay function fixes Custom paths not effective #671
  • All Options now have standard Validate, Initialize and Clone functions from the ConfigOptions interface, and properly separate concerns (e.g., Validate functions no longer mutate the object being validated)
    • OverlayYAMLData is removed in favor of UnmarshalYAML helper functions and a loaderOptions helper struct that accomplish the same thing
    • our yamlx package is retired/removed
  • all documentation updated

Signed-off-by: James Ranson <[email protected]>
@jranson jranson requested a review from crandles June 5, 2025 16:56
@coveralls
Copy link

coveralls commented Jun 5, 2025

Pull Request Test Coverage Report for Build 19981141368

Details

  • 743 of 1845 (40.27%) changed or added relevant lines in 76 files are covered.
  • 48 unchanged lines in 18 files lost coverage.
  • Overall coverage decreased (-3.6%) to 72.742%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/trickster/main.go 0 1 0.0%
pkg/appinfo/appinfo.go 0 1 0.0%
pkg/daemon/setup/listeners.go 0 1 0.0%
pkg/proxy/engines/httpproxy.go 4 5 80.0%
pkg/backends/alb/mech/nlm/newest_last_modified.go 0 2 0.0%
pkg/backends/alb/mech/rr/round_robin.go 0 2 0.0%
pkg/cache/registry/registry.go 1 3 33.33%
pkg/proxy/handlers/clickhouse/clickhouse.go 0 2 0.0%
pkg/proxy/handlers/influxdb/influxdb.go 0 2 0.0%
pkg/proxy/handlers/prometheus/prometheus.go 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/backends/alb/mech/ur/user_router.go 1 0.0%
pkg/config/loader.go 1 80.95%
pkg/daemon/setup/setup.go 1 0.0%
pkg/observability/metrics/metrics.go 1 0.0%
pkg/observability/tracing/options/options.go 1 46.6%
pkg/testutil/timeseries/model/model.go 1 0.0%
pkg/observability/tracing/exporters/otlp/otlp.go 2 76.19%
pkg/observability/tracing/exporters/stdout/stdout.go 2 92.73%
pkg/observability/tracing/exporters/zipkin/zipkin.go 2 94.44%
pkg/proxy/engines/proxy_request.go 2 93.42%
Totals Coverage Status
Change from base Build 19951914389: -3.6%
Covered Lines: 15163
Relevant Lines: 20845

💛 - Coveralls

Signed-off-by: James Ranson <[email protected]>
@jranson jranson changed the title update struct tags bugfix: path-based header injection Jun 5, 2025
This was referenced Jul 7, 2025
@jranson jranson marked this pull request as ready for review December 5, 2025 17:38
if !y.IsDefined("backends", name, providers.ALB) {
return nil, nil
func (o *Options) Initialize(_ string) error {
if strings.HasPrefix(o.MechanismName, "tsm") && o.MechanismName != "tsm" {
Copy link
Contributor

Choose a reason for hiding this comment

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

worth adding a constant for this? and perhaps "fgr"?

Comment on lines 60 to 67
found := false
for _, pathConfig := range rsc.BackendOptions.Paths {
if pathConfig.Path == "/" {
found = true
break
}
}
if !found {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this seems to be repeated in many tests, you could implement this as

Suggested change
found := false
for _, pathConfig := range rsc.BackendOptions.Paths {
if pathConfig.Path == "/" {
found = true
break
}
}
if !found {
if slices.ContainsFunc([]*po.Options(rsc.BackendOptions.Paths), func(pathConfig *po.Options) bool {
return pathConfig.Path == "/"
}) {

Copy link
Member Author

Choose a reason for hiding this comment

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

Swapped this pattern across all of pkg to use slices.Contains or slices.ContainsFunc instead.

Signed-off-by: James Ranson <[email protected]>
Signed-off-by: James Ranson <[email protected]>
Signed-off-by: James Ranson <[email protected]>
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.

Custom paths not effective

3 participants