Skip to content

Prefer Lerna with configurable Hydra fallback - #359

Open
timkpaine wants to merge 2 commits into
mainfrom
tkp/lerna
Open

timkpaine wants to merge 2 commits into
mainfrom
tkp/lerna

Conversation

@timkpaine

Copy link
Copy Markdown
Member

No description provided.

hydra 1.3 does not run on Python 3.14. lerna covers the API the gateway uses,
so prefer it, and keep hydra as what it falls back to.

Add `csp_gateway/_config_framework.py`, which makes the choice once and exports
the module and `HydraConfig` for everything else to import. Setting
`CSP_GATEWAY_CONFIG_FRAMEWORK` to `hydra` or `lerna` pins one; a value that is
neither is rejected rather than quietly falling back, so a typo in it is not a
mystery to debug.

The CLI's `main` decorator and the two readers of the output directory now go
through it. Those readers ask `HydraConfig.initialized()` first, and nothing but
a `main` decorator sets it -- composing a config through ccflow leaves it unset
on both frameworks -- so the one that answers is always the one that ran.

hydra stays a dependency. It is the fallback, and ccflow composes the config
through it regardless of what the gateway itself imports.

Signed-off-by: Tim Paine <[email protected]>
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

1 183 tests  +5   1 173 ✅ +5   10m 7s ⏱️ -49s
    1 suites ±0      10 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 1a7822a. ± Comparison against base commit 0932a2f.

This pull request removes 1 and adds 6 tests. Note that renamed tests count towards both.
csp_gateway.tests.server.modules.web.test_outputs.TestOutputsApi ‑ test_file_types_without_libmagic[app.log.gz-\x1f\x8b\x08\x00\xf1\xcf\xd7j\x02\xff\xcb\xc9OW\xc8\xc9\xccK\xe5\x02\x00G\x11\xd2\xbc\t\x00\x00\x00-application/gzip-download-]
csp_gateway.tests.config.test_config_framework ‑ test_an_unknown_framework_is_rejected
csp_gateway.tests.config.test_config_framework ‑ test_hydra_can_be_pinned
csp_gateway.tests.config.test_config_framework ‑ test_lerna_can_be_pinned
csp_gateway.tests.config.test_config_framework ‑ test_lerna_is_preferred_when_unset
csp_gateway.tests.config.test_config_framework ‑ test_the_api_the_gateway_uses_is_present
csp_gateway.tests.server.modules.web.test_outputs.TestOutputsApi ‑ test_file_types_without_libmagic[app.log.gz-\x1f\x8b\x08\x00b\xd0\xd7j\x02\xff\xcb\xc9OW\xc8\xc9\xccK\xe5\x02\x00G\x11\xd2\xbc\t\x00\x00\x00-application/gzip-download-]

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.69231% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.59%. Comparing base (0932a2f) to head (1a7822a).

Files with missing lines Patch % Lines
csp_gateway/_config_framework.py 55.55% 8 Missing ⚠️
csp_gateway/server/cli.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #359      +/-   ##
==========================================
- Coverage   88.61%   88.59%   -0.03%     
==========================================
  Files         167      169       +2     
  Lines       21465    21513      +48     
  Branches     1948     1952       +4     
==========================================
+ Hits        19022    19060      +38     
- Misses       2443     2453      +10     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@timkpaine timkpaine changed the title Run the configuration on lerna rather than hydra Migrate from hydra to lerna Sep 21, 2026
@timkpaine timkpaine changed the title Migrate from hydra to lerna Prefer Lerna with configurable Hydra fallback Oct 8, 2026
@timkpaine
timkpaine marked this pull request as ready for review October 20, 2026 20:17
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.

1 participant