Repository navigation
fix: resolve renamed mutest binary targets - #697
pomazanbohdan wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 807338cca1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (Normalize-RepoPath ([System.IO.Path]::GetRelativePath($RepoRoot, $_.src_path))) -eq $normalized | ||
| } | | ||
| Select-Object -First 1) | ||
| if ($mainTarget.Count -eq 1) { return @("--bin", [string]$mainTarget[0].name) } |
There was a problem hiding this comment.
Invalidate cached rows when target metadata changes
When a manifest renames a binary target without changing its Rust source, this metadata lookup changes the generated --bin argument, but Get-FileRegistryPlan can still resume the previous completed row because compatibility only checks the source hash and the unchanged target_selector_policy = "auto-lib-bin-v1" config hash. Cargo target renames generally do not alter the source file or Cargo.lock, so the audit may silently retain results produced for the old target instead of exercising the newly resolved target; include the relevant target metadata in the compatibility hash or otherwise invalidate these rows when the mapping changes.
Useful? React with 👍 / 👎.
Thinking mode: STC.
Motivation
--binnames forcrates/*/src/main.rsfrom the crate directory name, which is incorrect when the Cargo manifest declares a different binary name.--package docflow-cli --bin docflow-clito fail for crates where the binary is explicitly named (e.g.docflow-cli->docflow).Description
Get-CargoTargetArgumentsto accept aPackageparameter and prefer resolving the binary name from Cargo metadata by matching a target'ssrc_pathto the normalizedmain.rspath.Get-WorkspaceMetadata(replacing the previous package-name-only helper) to return parsedcargo metadataJSON and populateWorkspaceMetadata/WorkspacePackagesfor later lookups.Get-MutestCommandand initialization sites to pass the package intoGet-CargoTargetArgumentsand to populateWorkspaceMetadatabefore selection.scripts/tests/vida-mutest-audit.tests.ps1that assertsdocflow-climaps to--bin docflowandtaskflow-climaps to--bin taskflowwhile retaining the existingvidacase.Testing
cargo metadata --no-deps --format-version 1 --lockedto confirm workspace metadata and target shapes were available and correct (succeeded).cargo check --package docflow-cli --bin docflow --lockedandcargo check --package taskflow-cli --bin taskflow --lockedto verify the resolved--binnames are accepted by Cargo (both succeeded).git diff --check, staged the two modified files, and committed the change as423c3dewith messagefix: resolve renamed mutest binary targets(succeeded).pwshis not installed andghis not authenticated, so theps1test file cannot be executed here and no pull request was opened from this environment (not run).Codex Task