Skip to content

reviewer: skip patches meant for xfstests - #369

Draft
OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/103-xfstests-classification
Draft

reviewer: skip patches meant for xfstests#369
OllieinCanada wants to merge 1 commit into
sashiko-dev:mainfrom
OllieinCanada:fix/103-xfstests-classification

Conversation

@OllieinCanada

Copy link
Copy Markdown
Contributor

Fixes #103

Summary

Skip patches that are clearly intended for xfstests before Sashiko attempts
Linux baseline selection, patch application, or AI review.

Root cause

New xfstests cases commonly add files below tests/<suite>/<case>. Because new
files can apply cleanly to the Linux checkout, Sashiko can mistake the patch
for a kernel change and spend model tokens reviewing it in the wrong
repository.

Changes

  • recognize diffs whose changed files are exclusively in the top-level
    tests/<suite>/<path> layout used by xfstests
  • mark those patches as skipped before baseline resolution or review work
  • complete an all-xfstests patchset without creating an AI review record
  • keep Linux selftests under tools/testing/, normal kernel paths, empty
    diffs, and mixed kernel/xfstests diffs in the existing review path

Validation

  • focused positive and negative path-classification tests pass
  • pipeline test confirms the patch becomes Skipped, the patchset becomes
    Reviewed, and no review record is created
  • cargo clippy --all-targets --all-features --release -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check
  • release suite passes with the known issue tests: make bad-tag recovery test portable across Git versions #350 portability test excluded:
    408 passed, 15 intentionally ignored, no other failures

The unfiltered local suite reaches the existing Git-version-dependent failure
from #350, which is addressed separately by #368.

Signed-off-by: OllieinCanada <73385593+OllieinCanada@users.noreply.github.com>
Comment thread src/reviewer.rs
Comment on lines +77 to +84
!files.is_empty()
&& files.iter().all(|file| {
let mut components = file.split('/');
components.next() == Some("tests")
&& components.next().is_some_and(|part| !part.is_empty())
&& components.next().is_some_and(|part| !part.is_empty())
})
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a minor nitpick, but you could simplify .next() and the long RHS comparison with:

    !files.is_empty() && files.iter().all(|file| {
        let mut parts = file.split('/').filter(|p| !p.is_empty());
        parts.next() == Some("tests") && parts.count() >= 2
    })
}

@derekbarbosa derekbarbosa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, sorry for the delay!

Thank you for the fix. This looks good. The review comments I posted are minor fixups.

However, this has me thinking if we should try and come up with a solution that would allow certain filepaths to be ignored per-subsystem.

        // Linux selftests live under tools/testing. Top-level tests/<suite>/<case>
        // paths identify xfstests patches, which must not be reviewed as kernel code.

but I am unsure if xfstests' usecase is unique or not. don't consider this a blocker for now :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't try to review patches meant for xfstests

2 participants