Skip to content

fix(ci): resolve main CI failures after colliding merges #7757

Done

Description

@dan-petty

Three CI Quality Gate checks fail on origin/main (99d1f6ea7) after parallel pull request merges:

  1. tests/ai/test_ai_plans_configured_urls.py::test_gateway_and_qdrant_plans_emit_placeholders_when_unset fails with ValidationError: The context is empty. Pass the evidence text with --context (-c). (src/devops_cli/ai/jev_ask.py:164) because #7732 (32fabe258) requires non-empty context while #7730 (376e396a0) calls plan_ai_ask_jev("binary", "status?") with no context.
  2. test-tree: source_tree.check_tests_hold_at_most_the_recorded_private_imports fails (430 > _PRIVATE_IMPORT_CEILING of 428) because #7730 (376e396a0) imports _get_llm_chat_target and _get_llm_embedding_target in tests/ai/test_ai_plans_configured_urls.py:12-15.
  3. tests/roadmap/test_roadmap_adr.py::test_adrs_in_force_keep_headroom_and_matching_constant_comment fails with assert (33, 9675, 1000) == (32, 9230, 1000) because #7722 (2cad07ead) superseded ADR 0001 and ADR 0016 and added ADR 0042 (leaving 32 in-force ADRs at 9,230 tokens), colliding with #7734 (3f9178d00) recording 33 ADRs and 9,675 tokens in src/devops_cli/config/constants.py.

Reproduction

Run on origin/main:

  • DEVOPS_CLI_CONFIG=config.example.yaml .venv/bin/pytest -q tests/ai/test_ai_plans_configured_urls.py tests/roadmap/test_roadmap_adr.py
  • DEVOPS_CLI_CONFIG=config.example.yaml uv run devops ci --only test-tree

Expected Behavior

All three CI checks pass on main and unblocked pull request branches.

Proposed design

Problem statement

Three CI Quality Gate checks fail on origin/main after parallel pull request merges. The ask-jev plan test passes no context to a function that now requires one. The test file imports two private helpers and exceeds the private import ceiling. The ADR budget comment states the old count and token total. The fix makes the three checks pass and unblocks pull request branches.

Acceptance criteria

Requirement: Ask-jev plan test passes a context

The ask-jev plan test SHALL pass a non-empty context to plan_ai_ask_jev.

Scenario: Gateway and Qdrant placeholders with no configured URL

  • WHEN the test test_gateway_and_qdrant_plans_emit_placeholders_when_unset runs
  • THEN it passes and asserts the ask-jev target <ai.gateway_url>/v1/systemone

Requirement: Test file stays under the private import ceiling

tests/ai/test_ai_plans_configured_urls.py MUST import no private name from devops_cli.ai.ai_plans.

Scenario: Private import ceiling of the test tree

  • WHEN uv run devops ci --only test-tree runs
  • THEN source_tree.check_tests_hold_at_most_the_recorded_private_imports passes with a count at or below _PRIVATE_IMPORT_CEILING

Requirement: ADR budget comment matches the in-force ADRs

The CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS comment MUST state the in-force ADR count and token total.

Scenario: Comment parity with docs/adr/

  • WHEN pytest -q tests/roadmap/test_roadmap_adr.py::test_adrs_in_force_keep_headroom_and_matching_constant_comment runs
  • THEN the test passes and the parsed comment equals the in-force ADR count, the token total and a 1000-token margin

Requirement: Reproduction suite passes

The three failing checks SHALL pass together on main.

Scenario: Full reproduction command

  • WHEN DEVOPS_CLI_CONFIG=config.example.yaml .venv/bin/pytest -q tests/ai/test_ai_plans_configured_urls.py tests/roadmap/test_roadmap_adr.py runs
  • THEN pytest reports no failure

Existing Tool Considered

No alternatives check has run. The item adds no dependency and builds no new code. pytest, already in use, runs the two test files. The test-tree check runs the private import ceiling. The change is three edits: pass a context, remove two private imports and their duplicate assertions, and update one comment.

Key questions

  • Which two private imports push the test tree over the ceiling?: tests/ai/test_ai_plans_configured_urls.py:12-13 imports _get_llm_chat_target and _get_llm_embedding_target from devops_cli.ai.ai_plans. [sources: tests/ai/test_ai_plans_configured_urls.py:12, tests/ai/test_ai_plans_configured_urls.py:13]
  • What are the in-force ADR count and token total?: The in-force set holds 32 ADRs and 9230 tokens. [sources: tests/roadmap/test_roadmap_adr.py]
  • How does the test file drop the two private imports without losing the target checks?: Remove the two private imports. In the Ollama test, remove the two direct assertions because the plan assertions repeat them. In the provider test, remove the two direct assertions and assert plan_ai_analyze_path()[0].target == expected_embed. (best practice) [sources: tests/ai/test_ai_plans_configured_urls.py, AGENTS.md]
    • Chosen: Remove the imports and use the plan assertions. It keeps the recorded ceiling and the target coverage.
    • Rejected: Import the module and call the helpers as attributes. It still touches private members and may trip a lint rule.
    • Rejected: Raise _PRIVATE_IMPORT_CEILING. It lowers a threshold, which AGENTS.md rule 5 forbids.
  • Which context does the ask-jev plan test pass?: Pass a short evidence string, for example "gateway health status", as the context argument. The test checks only the placeholder target. (best practice) [sources: src/devops_cli/ai/jev_ask.py:164, src/devops_cli/ai/ai_plans.py, tests/ai/test_ai_plans_configured_urls.py]
    • Chosen: Pass a fixed evidence string. It satisfies the new validation and keeps the test deterministic.
    • Rejected: Pass the question as the context. It couples the evidence to the question text and adds no value.
  • Does the fix change CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENS?: No. The fix updates the comment to 32 in-force ADRs and 9230 tokens. The headroom check passes with the current cap. (best practice) [sources: tests/roadmap/test_roadmap_adr.py, src/devops_cli/config/constants.py]
    • Chosen: Update the comment only. The headroom assertion passes before the comment assertion.
    • Rejected: Raise the cap. It changes a limit with no failing headroom check.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    scope/ci
    status/new
    effort/medium
    value/high
    on Nov 29, 2026
  2. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor
    • Priority: CI is failing on main, which blocks all pull request merges.
    • Related: fix(ci): fail-to-pass refuses the fix of a red main #5590, which asks for a different change. Both deal with CI failures on main, but #5590 fixes the Fail-to-Pass mechanism that blocks fixes, while this candidate fixes the three test failures themselves.
  3. added
    priority/p0-critical
    on Nov 29, 2026
  4. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  5. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 29, 2026
  6. removed
    status/in-progress
    owner/agent
    on Nov 29, 2026
  7. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 16:17 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p0-criticalscope/citype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions