Skip to content

Add filter to import SCM - #741

Open
jkloetzke wants to merge 4 commits into
BobBuildTool:masterfrom
jkloetzke:filter-import-scm
Open

jkloetzke wants to merge 4 commits into
BobBuildTool:masterfrom
jkloetzke:filter-import-scm

Conversation

@jkloetzke

Copy link
Copy Markdown
Member

Fixes #657.

The live build-id was predicted by hashing the 'url' relative to the
current working directory. This ignores the project root and the
'recipeRelative' option. Hash the actual source directory instead.
Sometimes only some files of a directory are needed by a package, e.g.
a single defconfig file. Putting such files into a common directory that
is imported by multiple packages causes all of them to be rebuilt if any
file is changed.

Add a 'filter' attribute to the import SCM that takes an ordered list of
rsync-like include/exclude rules. Both the short ("+ PATTERN",
"- PATTERN") and the long form ("include PATTERN", "exclude PATTERN") are
supported. The first matching rule decides and excluded directories are
not traversed, just like rsync does. The new 'pruneEmptyDirs' option
skips empty directories, regardless of whether a filter is used or not.

The selection is computed in one place and used for local imports,
Jenkins builds and the live build-id prediction. The options are only
added to the digest if they are used. This keeps the variant-id of
existing recipes stable.

Fixes BobBuildTool#657.
Verify the rsync-like matching rules, pruneEmptyDirs and that local
imports, Jenkins builds and the live build-id prediction agree. The
black box test checks that packages which import different files from
the same directory are only rebuilt if their files change.
@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.73171% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.45%. Comparing base (c1d4b7d) to head (4783352).

Files with missing lines Patch % Lines
pym/bob/scm/imp.py 95.73% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #741      +/-   ##
==========================================
+ Coverage   90.39%   90.45%   +0.05%     
==========================================
  Files          59       59              
  Lines       17404    17551     +147     
==========================================
+ Hits        15733    15875     +142     
- Misses       1671     1676       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

checkoutSCM: scm: import: allow to select/filter specific files

1 participant