Skip to content

Use cfg_aliases to reduce boilerplate#2644

Open
Felixoid wants to merge 5 commits into
mozilla:mainfrom
Felixoid:cfg-aliases
Open

Use cfg_aliases to reduce boilerplate#2644
Felixoid wants to merge 5 commits into
mozilla:mainfrom
Felixoid:cfg-aliases

Conversation

@Felixoid

Copy link
Copy Markdown
Contributor

cfg_aliases allows to define a long any(feature = "",....) only once and then reuse it.

@codecov-commenter

codecov-commenter commented Mar 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.38739% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.94%. Comparing base (4fcb161) to head (7692678).

Files with missing lines Patch % Lines
src/config.rs 81.25% 12 Missing ⚠️
src/cache/multilevel.rs 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2644      +/-   ##
==========================================
- Coverage   74.18%   73.94%   -0.24%     
==========================================
  Files          71       72       +1     
  Lines       40505    41457     +952     
==========================================
+ Hits        30049    30657     +608     
- Misses      10456    10800     +344     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Felixoid

Copy link
Copy Markdown
Contributor Author

#2581 has 4 more places that would benefit from this patch.

@Felixoid Felixoid force-pushed the cfg-aliases branch 3 times, most recently from 41782cd to 8275713 Compare April 23, 2026 10:36
@Felixoid

Copy link
Copy Markdown
Contributor Author

The codecov issue is related to codecov/codecov-action#1940

@Felixoid Felixoid force-pushed the cfg-aliases branch 5 times, most recently from 640ece9 to 671ccc0 Compare April 23, 2026 14:35
@codspeed-hq

codspeed-hq Bot commented Apr 23, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 6 skipped benchmarks1


Comparing Felixoid:cfg-aliases (7692678) with main (4fcb161)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Comment thread src/config.rs
"oss" => self.oss.clone().map(CacheType::OSS).ok_or_else(|| {
anyhow!("OSS cache not configured but specified in levels")
})?,
"disk" => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This block didn't have cos case.

Having a single point of global features gate and cache type addresses it

@Felixoid

Felixoid commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Hey dear @sylvestre

Do you think it's worth merging? I feel it would improve the codebase by consolidating all feature-related stuff in a dedicated place.

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.

2 participants