Repository navigation
Conversation
|
Thanks for opening your first pull request in the Codna CLI! Please make sure the checks are green and that the change follows CONTRIBUTING.md. A maintainer will review it shortly. |
| result = Sandbox(network="deny", timeout_seconds=budget, env=env, network_backend=backend).run( | ||
| argv, cwd=run_dir, accepted_exit_codes=(0, 1) |
There was a problem hiding this comment.
🔴 HIGH · correctness — CODNA_JUNIT env var points to wrong path for suites 1..N in multi-suite runs
The diff removes run_env = {**env, "CODNA_JUNIT": run_junit} and replaces it with env=env. The outer env["CODNA_JUNIT"] is set once to the base junit path (e.g. report.xml). For multi-suite auto-detected pytest runs (len(suites) > 1), each suite writes its JUnit report to a suite-specific path (report-0.xml, report-1.xml, …), passed via --junitxml={suite_junit}. However CODNA_JUNIT in the environment still points at the base report.xml for every suite. Any test code or pytest plugin that uses $CODNA_JUNIT (as documented and as the test helper at line 374 demonstrates) will write to the wrong path for suites 1..N, either overwriting suite 0's report or writing to a file that codna never reads. The original per-suite run_env was the correct fix for this.
- result = Sandbox(network="deny", timeout_seconds=budget, env=env, network_backend=backend).run(
+ run_env = {**env, "CODNA_JUNIT": run_junit}
+ result = Sandbox(network="deny", timeout_seconds=budget, env=run_env, network_backend=backend).run(
Reply @codna fix and Codna opens a verified, test-green, risk-gated fix PR.
| runs.append(( | ||
| suite, | ||
| [sys.executable, "-m", "pytest", "-q", f"--junitxml={suite_junit}"], | ||
| suite_junit, | ||
| per_suite, | ||
| )) |
There was a problem hiding this comment.
🟡 MEDIUM · correctness — Removed --ignore flags allow pytest to double-collect nested suite roots
The diff removes the argv lines that passed --ignore={candidate} for each nested suite root that is a direct child of the current suite. Previously, when running a container suite, pytest was told to skip sub-directories that are run independently as their own suite. Without these --ignore flags, pytest running from a parent suite directory will recurse into and collect tests from those nested roots a second time (once from the parent, once from the child suite's own run). This causes duplicate test IDs in the JUnit output and can produce misleading pass/fail results.
Reply @codna fix and Codna opens a verified, test-green, risk-gated fix PR.
| for lid, previous_kid, keyval in zip(ids, previous_keyids, keyvals): | ||
| key = keyval.item() if hasattr(keyval, "item") else keyval | ||
| if index.key_i2v.get(previous_kid) != key: | ||
| index.lexical_dirty.add(lid) |
There was a problem hiding this comment.
🟡 MEDIUM · correctness — update() reads previous_keyids unconditionally in else-branch even when texts is
When texts is None, previous_keyids is computed (line 843) and then used in the else-branch zip at line 870. This is correct. However, when keys is provided (not None) AND texts is None, previous_keyids still refers to key-IDs fetched BEFORE the native upsert. After ty_index_insert, the native layer may have updated its internal state for those IDs. If the caller is changing partition keys (keys is not None), iterating previous_keyids in the dirty-tracking loop is intentional, but the comment (line 831-833) says texts=None means text is UNCHANGED — yet any row whose key changed is marked dirty. Rows whose key did NOT change but whose column data changed are not marked dirty. The lexical dirty set is therefore incomplete: a row whose text-relevant column changed but partition key didn't gets no dirty mark, so stale BM25 data persists.
Reply @codna fix and Codna opens a verified, test-green, risk-gated fix PR.
Automated mirror of cli/ (flattened), the root allowlist (server.json, glama.json, LICENSE, .gitleaks.toml) and the public-root/ community tree from thyn-ai/codna at 4057deb9e983f4c0fc9f4254b867a737b4288eaf. Merges itself via auto-merge once the mirror's required checks (codna review, Analyze (python)) pass and the codna-ai review approves; if a later sync lands first, this PR is closed as superseded -- every sync PR is a full snapshot of the exported surface.