Repository navigation
Description
Problem
tests/ai/rag/test_rag_qdrant_span.py::test_upsert_span_names_the_server_by_host_and_port fails on a topic branch whose name holds one of the words secret, token or user.
The test checks that the span of qdrant.upsert_points leaks no part of the configured URL. It looks for those words in every value of the span attributes. The tracer adds the attributes vcs.ref.name and vcs.branch to each span. They hold the name of the git branch. So the check reads the branch name as if it were a leak.
Reproduction
- Create a checkout on a branch named
fix/2613-prose-after-a-token-colon. - Run
uv run devops ci test tests/ai/rag/test_rag_qdrant_span.py. - Six cases fail with
assert not ['fix/2613-prose-after-a-token-colon', 'fix/2613-prose-after-a-token-colon'].
On a detached head, the six cases pass. The full gate uv run devops ci fails in the same way on such a branch.
Expected
The test passes on every branch name. It checks the attributes that name the server, and it ignores the attributes of the version control source.
Evidence
src/devops_cli/telemetry/tracer.py function _detect_vcs_metadata reads the branch from the git head file of the checkout, and _read_git_head_ref returns it. A branch name that follows <type>/<issue>-<slug> can hold any word, so the check fails for a branch about a token, a secret or a user.
Alternatives check of 2026-11-07: covers.
Tool: pytest (https://pypi.org/project/pytest), MIT, last activity 2026-10-27, maintained.
Proposed design
Problem statement
The span test fails on a branch whose name holds secret, token or user. The tracer copies the branch name into vcs.ref.name and vcs.branch. The leak scan reads every span attribute value, so it read the branch name as a leak. #4358 replaced the scanned words with the marker ..hidden and the text ://. Git refuses .. in a branch name, so no branch name can match. The module now passes on such a branch, and no code change remains. A person asks to close the item as not planned.
Acceptance criteria
Requirement: The span test passes on a branch name with a checked word
The test module SHALL pass on a checkout whose branch name holds secret, token or user.
Scenario: A branch name holds a checked word
- WHEN The checkout is on the branch
fix/2613-prose-after-a-token-colonand the test module runs. - THEN All nine cases pass and the leak scan reports no value.
Requirement: The leak scan looks for no word that a branch name can hold
The leak scan SHALL look for the marker ..hidden and the text ://, and for no word that a branch name can hold.
Scenario: The branch name holds tiktoken
- WHEN A span attribute holds
vcs.branchwith the valuefix/3828-plan-check-tiktoken-cache. - THEN The leak scan reports no value.
Requirement: A hidden part of the URL still fails the scan
The leak scan MUST report a span attribute value that holds ..hidden or ://.
Scenario: A span attribute holds the userinfo marker
- WHEN A span attribute value holds
https://[email protected]. - THEN The leak scan reports that value.
Requirement: The server attributes stay asserted
The test SHALL keep the assertion that server.address and server.port equal the host and the port of the configured URL.
Scenario: Userinfo and path are stripped
- WHEN The URL is
http://login..hidden:[email protected]:6333/prefix..hidden/path. - THEN
server.addressisexample.comandserver.portis 6333.
Existing Tool Considered
pytest (https://pypi.org/project/pytest), MIT, last activity 2026-10-27, maintained, is the runner of the suite. It covers the need: it runs the seven parametrized URL cases and the two other tests of the module. It lacks a span-attribute filter and an assertion helper that names an offending value. The change builds no code, because #4358 already put the fix in the module. The written cost is zero tokens to build, keep and fix, and no elapsed time.
Key questions
- The alternatives check found that pytest (
https://pypi.org/project/pytest) covers this item. Adopt the tool, or keep the item and give the reason.: Adopt no tool and keep pytest as the runner. The person's reply records that fix(tests): the qdrant telemetry test reads the real branch name #4358 already replaced the word scan with a marker that no branch name can hold. The item needs no code change and closes as not planned. (best practice) [sources: tests/ai/rag/test_qdrant_request_telemetry.py:19, tests/ai/rag/test_qdrant_request_telemetry.py:88]- Chosen: Keep pytest and close the item as not planned. The person's reply records that fix(tests): the qdrant telemetry test reads the real branch name #4358 delivered the fix, so no code change remains and pytest stays the runner.
- Rejected: Adopt pytest and add a scan helper. The scan reads values only and needs no filter, so a helper would add code that no failure needs.
- Rejected: Add a span-attribute filtering library. The scan is one condition on a value, so a library would add a dependency for no gain.
- Which test fails, and what does its leak scan read?:
test_upsert_span_names_the_server_by_host_and_portintests/ai/rag/test_qdrant_request_telemetry.py:78holds seven parametrized URL cases, and the module holds nine cases in all. The scan at line 88 reports a value that holdsHIDDEN(..hidden, line 19) or://. The pathtests/ai/rag/test_rag_qdrant_span.pyof the issue body is not in the tree, and the body's six cases are seven. [sources: tests/ai/rag/test_qdrant_request_telemetry.py:19, tests/ai/rag/test_qdrant_request_telemetry.py:78, tests/ai/rag/test_qdrant_request_telemetry.py:88] - Has the fix already landed in the repository?: Yes, in fix(tests): the qdrant telemetry test reads the real branch name #4358. The module defines
HIDDEN = "..hidden"and its docstring cites fix(tests): the qdrant telemetry test reads the real branch name #4358 andgit check-ref-format. The archived change folder of fix(tests): the qdrant telemetry test reads the real branch name #4358 is in the tree. [sources: tests/ai/rag/test_qdrant_request_telemetry.py:19, tests/ai/rag/test_qdrant_request_telemetry.py:26, openspec/changes/archive/2026-11-11-4358-the-qdrant-telemetry-test-reads-the/proposal.md] - Why can a branch name no longer trip the leak scan?: Git refuses
..in a branch name, and the marker..hiddenholds... The tracer reads the branch from the gitHEADfile and copies it intovcs.ref.nameandvcs.branch. The scan looks for..hiddenand://only, so a branch name cannot match. [sources: tests/ai/rag/test_qdrant_request_telemetry.py:23, src/devops_cli/telemetry/tracer.py:656, src/devops_cli/telemetry/tracer.py:738] - Should the scan skip the
vcs.attribute keys, as the earlier proposal said?: No. fix(tests): the qdrant telemetry test reads the real branch name #4358 removed the words that a branch name can hold, so the scan needs no key filter. A key filter would add code that no failure needs. (best practice) [sources: tests/ai/rag/test_qdrant_request_telemetry.py:19, tests/ai/rag/test_qdrant_request_telemetry.py:88]- Chosen: Keep the value-only scan with the
..hiddenmarker. The marker and://cannot appear in a branch name, so the scan passes on every branch and still catches a hidden part of the URL. - Rejected: Skip every key that starts with
vcs.. fix(tests): the qdrant telemetry test reads the real branch name #4358 removed the words that a branch name can hold, so the filter adds code that no failure needs. - Rejected: Extract a
_leaked_valueshelper and add a negative test. The person's reply asks for no code change, because the module already passes on a branch with a checked word.
- Chosen: Keep the value-only scan with the
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(tests)scope of the title gives the scope.It blocks CI on branches whose names contain certain words but does not affect production.It unblocks CI for developers on affected branch names but only for a subset of branches.The fix filters VCS attributes from the span attribute check in one test.Both concern the qdrant.upsert_points span; #2459 fixes the span to use host:port, the candidate fixes the test that verifies it to ignore VCS attributes.dan-petty commentedon Nov 5, 2026
The same failure showed again on 2026-11-05 for the branch
fix/2662-mask-url-user-name-without-password(pull request #3676), at origin/mainf6d57ecd. Six cases oftest_upsert_span_names_the_server_by_host_and_portfail with the branch name invcs.ref.nameandvcs.branch, because the name holds the worduser. They pass on a detached head. The full localuv run devops cifails on such a branch, so a branch that is about a user name, a token or a secret cannot pass the gate on a local checkout.devops-cli-service commentedon Nov 6, 2026
Status set to Ready at ae881d6 (see proposed design in issue body).
dan-petty commentedon Nov 7, 2026
A branch name with the word "token" also fails this test. Branch fix/3828-plan-check-tiktoken-cache put "tiktoken" in the span attributes and failed the six cases of tests/ai/rag/test_rag_qdrant_span.py in a full
devops cirun. I renamed the branch to avoid the word. The cause is still open here.devops-cli-service commentedon Nov 7, 2026
Alternatives check: covers
Reason: Web search returned no results (the provider did not answer), so I read the facts of the tool the issue itself names: pytest, the runner the project's suite already uses. pytest covers the need, because the fix is an edit of one existing pytest test (parametrized cases, a monkeypatch for
_detect_vcs_metadata) that adds no library, and the issue's proposed design reaches the same conclusion.Tool: pytest (https://pypi.org/project/pytest)
Covers:
test_upsert_span_names_the_server_by_host_and_port.monkeypatchsets the branch name for the regression test onfix/2613-prose-after-a-token-colonwithout touching git.parametrizekeeps the URL variants and the server.address/server.port assertions in one test.Lacks:
vcs.prefix exclusion in the leak scan must be written by hand in the test.Tools considered:
Searches run:
Sources:
Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 7, 2026
Status set back to New at 257cb46. Refine cannot set this item to Ready at 257cb46 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
https://pypi.org/project/pytestcovers this item. Adopt the tool, or keep the item and give the reason. (a person decides)dan-petty commentedon Nov 14, 2026
Replaced by #4358: the leak scan in tests/ai/rag/test_qdrant_request_telemetry.py:88 no longer looks for the words secret, token or user. It looks for the marker '..hidden' and '://'. Git refuses '..' in a branch name, so no branch name can match. Evidence: on branch fix/3638-secret-word-span-test the test passes (9 passed in 0.97s). No code change is needed; close as not planned.
devops-cli-service commentedon Nov 14, 2026
Status set to Ready at 0410772 (see proposed design in issue body).
dan-petty commentedon Nov 17, 2026
Issue #4358 already resolved this problem in
tests/ai/rag/test_qdrant_request_telemetry.py.The test now uses the marker
..hiddenand://for URL parts that a span must not show. Git refuses..in a branch name pergit check-ref-format. Therefore, a branch name that holdssecret,token, orusercannot match the marker. All 9 cases intests/ai/rag/test_qdrant_request_telemetry.pypass.Closing as not planned per AGENTS.md Rule 2.