diff --git a/src/dfe_engine/api/deps.py b/src/dfe_engine/api/deps.py index fed703a8..61afbfaa 100644 --- a/src/dfe_engine/api/deps.py +++ b/src/dfe_engine/api/deps.py @@ -624,8 +624,8 @@ async def get_current_user(request: Request) -> AuthContext: 3. JWT Bearer token -- standalone/Docker users 4. Auth disabled -- dev/test root context - When ``auth.enabled=False`` (dev/test default), returns a root AuthContext - that bypasses authorization if no credentials are provided. + When ``auth.enabled=False`` (default on, and off only in a dev posture), returns + a root AuthContext that bypasses authorization if no credentials are provided. """ # No auth.login.success here: this runs on every request and creates no # session, so the login audit belongs to the credential exchange diff --git a/src/dfe_engine/backing/providers.py b/src/dfe_engine/backing/providers.py index b46aeeb0..112fba2b 100644 --- a/src/dfe_engine/backing/providers.py +++ b/src/dfe_engine/backing/providers.py @@ -7,10 +7,9 @@ # Copyright: (c) 2026 HYPERI PTY LIMITED """The provider catalogue, and what a deployment's provider key makes of a service. -The catalogue is DATA whose source of truth is dfe-infra's ``providers.yaml``, so a -new provider, or a change to what one leaves the deploy repo to set, is an edit -there rather than an engine release. It resolves the way the app manifest does: -an explicit path, then ``DFE_ENGINE_PROVIDER_CATALOGUE_FILE``, then the snapshot bundled +The catalogue is DATA, the ``providers.yaml`` beside this module, so a deployer can +change it without an engine release. It resolves the way the app manifest does: +an explicit path, then ``DFE_ENGINE_PROVIDER_CATALOGUE_FILE``, then the copy bundled in the image. A service is ``dfe``-run unless the deployer states a provider. A key the catalogue diff --git a/src/dfe_engine/gitcrud/commit_policy.py b/src/dfe_engine/gitcrud/commit_policy.py index f2298bc5..50b17ec0 100644 --- a/src/dfe_engine/gitcrud/commit_policy.py +++ b/src/dfe_engine/gitcrud/commit_policy.py @@ -385,10 +385,9 @@ def resolve_mode( environment: str, rbac_class: str, protected: bool = False, - require_pr: bool = False, auto_merge: bool = False, ) -> str: - """'pr' for production posture / protected / governance / explicit, else 'direct'. + """'pr' for production posture / protected / governance, else 'direct'. PRs for production-controlling changes, direct-commit for low-risk - enforced at the git level (the standard). Production posture is anything DFE_ENGINE_ENV does not @@ -398,6 +397,6 @@ def resolve_mode( """ if auto_merge: return "direct" - if require_pr or protected or rbac_class == "governance" or not is_dev_posture(environment): + if protected or rbac_class == "governance" or not is_dev_posture(environment): return "pr" return "direct" diff --git a/tests/e2e/test_live_pipeline.py b/tests/e2e/test_live_pipeline.py index bd8e73a9..5402ff7d 100644 --- a/tests/e2e/test_live_pipeline.py +++ b/tests/e2e/test_live_pipeline.py @@ -192,22 +192,22 @@ def test_ui_deploys_schema_change_via_git(e2e: E2EConfig) -> None: # No publish call - see the note in the infra test above. - # VERIFY the generated DDL landed in the deploy repo (ddl/.sql), and - # that it carries our additional column. - def _ddl_committed(): + # VERIFY the source, with our additional column, landed in the deploy repo's + # config/sources/ (the sources resource class, source/registry.py). + def _source_committed(): with tempfile.TemporaryDirectory() as d: repo = _clone_deploy_repo(e2e, Path(d) / "repo") - ddl_dir = repo / "ddl" - if not ddl_dir.exists(): + sources_dir = repo / "config" / "sources" + if not sources_dir.exists(): return False - for sql in ddl_dir.glob("*.sql"): - text = sql.read_text() + for path in sources_dir.glob("*.yaml"): + text = path.read_text() if source_name in text and "e2e_marker" in text: return True return False assert poll_until( - _ddl_committed, timeout=90, interval=5, desc=f"DDL for {source_name} in deploy repo" + _source_committed, timeout=90, interval=5, desc=f"{source_name} in deploy repo" ) # cleanup: remove the test source. diff --git a/tests/gitcrud/test_commit_policy.py b/tests/gitcrud/test_commit_policy.py index b64e0b4e..aff0fa2a 100644 --- a/tests/gitcrud/test_commit_policy.py +++ b/tests/gitcrud/test_commit_policy.py @@ -429,18 +429,16 @@ def test_resolve_mode(): assert resolve_mode(environment="prod", rbac_class="helmvars") == "pr" assert resolve_mode(environment="dev", rbac_class="governance") == "pr" assert resolve_mode(environment="dev", rbac_class="helmvars", protected=True) == "pr" - assert resolve_mode(environment="dev", rbac_class="helmvars", require_pr=True) == "pr" class TestAutoMergeMode: def test_auto_merge_forces_direct_everywhere(self): - # prod + protected + governance + require_pr: ALL direct under auto-merge + # prod + protected + governance: ALL direct under auto-merge assert ( resolve_mode( environment="prod", rbac_class="governance", protected=True, - require_pr=True, auto_merge=True, ) == "direct"