Skip to content

Tag Go test files in scan facts - #5

Merged
rdzehtsiar merged 2 commits into
masterfrom
codex/linear-mention-rdg-36-implement-processing-of-test-files
Jun 10, 2026
Merged

Tag Go test files in scan facts#5
rdzehtsiar merged 2 commits into
masterfrom
codex/linear-mention-rdg-36-implement-processing-of-test-files

Conversation

@rdzehtsiar

Copy link
Copy Markdown
Owner

Motivation

  • Treat Go test files (*_test.go) as a distinct class of files because their churn, size, and branching often carry different risk semantics than production code.
  • Ensure stale cached file-analysis artifacts are invalidated when the analyzer semantics change by bumping the file-analysis signature.

Description

  • Detect _test.go filenames with a new is_test_path helper and add an is_test boolean to FileAnalysisResult produced by FileAnalyzer and the file-analysis options signature (file-local-v4-test-files).
  • Persist the is_test flag through the storage pipeline by adding is_test columns to the database schema and runtime ALTER TABLE additions for file_analysis, file_facts, and file_risk_scores, and by writing/reading is_test in the flush_batch, materialize_file_facts, and materialize_file_risk_scores SQL paths.
  • Update file-risk materialization so Go scoring queries include the is_test value and store it on file_risk_scores rows to allow downstream consumers to interpret test files separately.
  • Add documentation to README.md describing that _test.go files are tagged in the local index and add tests: a unit test analyzer_tags_go_test_files and an integration CLI test scan_tags_go_test_files_in_index_facts_and_risk_rows to verify the flag is stored in the SQLite index.

Testing

  • Ran unit and integration tests with cargo test, which completed successfully: all tests passed (96 unit tests and 8 CLI tests reported in the run).
  • Ran formatting and static checks with cargo fmt --check and cargo clippy --all-targets --all-features -- -D warnings, both completed without failures.
  • No other automated tests were skipped.

Codex Task

@codecov-commenter

codecov-commenter commented Jun 10, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 78.12500% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipeline/store_reducer.rs 67.44% 3 Missing and 11 partials ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Qodana for Rust

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@rdzehtsiar
rdzehtsiar marked this pull request as ready for review June 10, 2026 16:05
@rdzehtsiar
rdzehtsiar merged commit 2c8c961 into master Jun 10, 2026
5 of 7 checks passed
@rdzehtsiar
rdzehtsiar deleted the codex/linear-mention-rdg-36-implement-processing-of-test-files branch June 10, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants