Skip to content

[9.3](backport #6835) fix: correct typos in default rate limit YAML keys#6846

Merged
michel-laterman merged 1 commit into9.3from
mergify/bp/9.3/pr-6835
Apr 16, 2026
Merged

[9.3](backport #6835) fix: correct typos in default rate limit YAML keys#6846
michel-laterman merged 1 commit into9.3from
mergify/bp/9.3/pr-6835

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Apr 16, 2026

What is the problem this PR solves?

All 6 embedded default YAML files under internal/pkg/config/defaults/ used pgp_retieval_limit (missing 'r') instead of pgp_retrieval_limit. Because the Go struct tag is config:"pgp_retrieval_limit", the YAML values never deserialized — PGP retrieval rate limits silently fell back to hardcoded defaults regardless of agent-count tier.

Additionally, lte10000_limits.yml used policy_interval instead of policy_limit, causing the same silent fallback for the policy rate limit at the 5001-10000 agent tier.

How does this PR solve the problem?

  • Fixes pgp_retieval_limitpgp_retrieval_limit in all 6 default YAML files
  • Fixes policy_intervalpolicy_limit in lte10000_limits.yml
  • Renames lte2500_limite.ymllte2500_limits.yml for consistency
  • Adds TestDefaultLimitsYAMLKeys regression test that verifies all embedded YAML files populate every limit field with non-zero values, catching future key/struct-tag mismatches

How to test this PR locally

go test ./internal/pkg/config/ -run "TestDefaultLimitsYAMLKeys" -v

Design Checklist

  • I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.
  • I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.
  • I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.

Checklist

* fix: correct typos in default rate limit YAML keys

The embedded default YAML files used `pgp_retieval_limit` (missing 'r')
instead of `pgp_retrieval_limit`, causing the values to never deserialize
into the Go struct. PGP retrieval limits silently fell back to hardcoded
defaults for all agent-count tiers.

Also fixes `policy_interval` -> `policy_limit` in lte10000_limits.yml
and renames `lte2500_limite.yml` -> `lte2500_limits.yml`.

Adds a regression test that verifies all embedded YAML files populate
every limit field, catching future key/struct-tag mismatches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: use reflection to validate YAML keys match struct tags

Replace manually enumerated field assertions with a reflection-based
approach that reads raw YAML keys and verifies each has a matching
`config` struct tag on serverLimitDefaults. This catches typos
automatically without needing to update the test when fields are added.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Cleanup test code

* Update internal/pkg/config/env_defaults_test.go

Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
(cherry picked from commit 47b6210)
@mergify mergify bot added the backport label Apr 16, 2026
@mergify mergify bot requested a review from a team as a code owner April 16, 2026 22:51
@github-actions github-actions bot added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Apr 16, 2026
@michel-laterman michel-laterman enabled auto-merge (squash) April 16, 2026 23:00
@michel-laterman michel-laterman merged commit 6bbd5bd into 9.3 Apr 16, 2026
8 checks passed
@michel-laterman michel-laterman deleted the mergify/bp/9.3/pr-6835 branch April 16, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant