Skip to content

Df fix header#2978

Closed
Aartichoke wants to merge 2 commits into
wundergraph:mainfrom
Aartichoke:df_fix_header
Closed

Df fix header#2978
Aartichoke wants to merge 2 commits into
wundergraph:mainfrom
Aartichoke:df_fix_header

Conversation

@Aartichoke

@Aartichoke Aartichoke commented Jun 18, 2026

Copy link
Copy Markdown

Fromfile header validation fix to not reject valid config.

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation for header rule configurations to more accurately detect and reject invalid set-rules when required parameters are missing, preventing malformed rules from being processed.
    • Enhanced test coverage for header rule validation to ensure configurations are properly validated across various scenarios and edge cases.

@Aartichoke Aartichoke requested a review from a team as a code owner June 18, 2026 01:48
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 491f2224-3c7a-4d25-a7dd-0f224203e5aa

📥 Commits

Reviewing files that changed from the base of the PR and between 2f76402 and 62b65c2.

📒 Files selected for processing (2)
  • router/core/header_rule_engine.go
  • router/core/header_rule_engine_test.go

Walkthrough

In PropagatedHeaders, the HeaderRuleOperationSet validation guard is updated to also require rule.FromFile == nil before returning the "no header name/value combination" error, treating FromFile as a valid value source. A matching test subtest is added to confirm this path works correctly.

PropagatedHeaders FromFile set-rule fix

Layer / File(s) Summary
PropagatedHeaders guard fix and test
router/core/header_rule_engine.go, router/core/header_rule_engine_test.go
The "no value source" condition in the HeaderRuleOperationSet branch of PropagatedHeaders now includes rule.FromFile == nil, so rules with a FromFile source are no longer rejected as invalid. A new TestPropagatedHeaders subtest verifies that a set-rule with FromFile content returns the expected header name and nil compiled regexps.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • wundergraph/cosmo#2908: Directly related — introduces FromFile support for header set-rules in header_rule_engine.go, which is the same code path this PR corrects in the validation guard.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and does not clearly convey the specific change being made in the pull request. Consider a more descriptive title such as 'Fix header rule validation for FromFile in set rules' to better communicate the purpose of the changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.24%. Comparing base (7532f9a) to head (62b65c2).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
router/core/header_rule_engine.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2978      +/-   ##
==========================================
- Coverage   65.34%   59.24%   -6.10%     
==========================================
  Files         335      242      -93     
  Lines       48194    26976   -21218     
  Branches     5371        0    -5371     
==========================================
- Hits        31491    15982   -15509     
+ Misses      16677     9433    -7244     
- Partials       26     1561    +1535     
Files with missing lines Coverage Δ
router/core/header_rule_engine.go 78.33% <0.00%> (ø)

... and 576 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Noroth

Noroth commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Closing this in favor of #2979

@Noroth Noroth closed this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants