Skip to content

Commit 0cd131d

Browse files
committed
patchwork: fix type mismatch in patch filtering for project ID
Fix a critical bug in patch filtering where project ID comparison was failing due to type mismatch. The configuration file specifies project IDs as strings (e.g., "423"), but the Patchwork API returns them as integers (e.g., 423). This caused the comparison in _is_patch_matching() to fail, resulting in no patches being detected as matching. This bug was preventing KPD from detecting candidate patches in lei-based patchwork instances, including the Linux firmware loader project. The fix converts the expected_value to int before comparison for properties in PATCH_FILTERING_PROPERTIES (project, delegate). Tested with the firmware loader project - now successfully detects patches including "firmware_loader: prevent integer overflow in firmware_loading_timeout()". Since lei-based patchwork instances now work, updates docs to declare it as supported. Generated-by: Claude AI Signed-off-by: Luis Chamberlain <[email protected]>
1 parent fe15c6d commit 0cd131d

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ docker pull ghcr.io/kernel-patches/kernel-patches-daemon:latest
8787
- Authentication: GitHub Apps preferred over personal tokens
8888
- Mirror setup: Uses `mirror_dir` with fallback repositories for bandwidth optimization
8989
- Lookback period: Recommended 14-21 days for kernel projects (default 7 may be too short)
90+
- Lei-based patchwork support: Works with kernel.org's new subsystem-specific instances
9091

9192
### Testing Structure
9293

CONFIG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,22 @@ KPD validates configuration on startup and will report specific errors for:
142142
- Check lookback period is appropriate (7 days may be too short for kernel projects)
143143
- Confirm search patterns match the patches you expect to process
144144
- Use `--dry-run-list-candidates-only` to debug patch detection
145+
- Verify project IDs in search_patterns are correct strings
146+
- For lei-based patchwork instances, ensure proper API endpoint access
147+
148+
## Lei-based Patchwork Instances
149+
150+
KPD supports the new lei-based patchwork instances deployed by kernel.org for specific subsystems. These instances:
151+
- Use pseudo email addresses like `[email protected]`
152+
- May have different API response characteristics
153+
- Are designed to limit patch scope to specific subsystems
154+
- Work with the same KPD configuration format
155+
156+
When configuring for lei-based instances:
157+
1. Use the standard patchwork.kernel.org server
158+
2. Specify the correct project ID for your subsystem
159+
3. Consider longer lookback periods (14-21 days) as patches may have extended review cycles
160+
4. Test with dry-run mode to verify patch detection
145161

146162
## Example Configuration
147163

kernel_patches_daemon/patchwork.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def _is_patch_matching(self, patch: Dict[str, Any]) -> bool:
380380
# these values can be None so we need to filter them out first
381381
if not patch[prop_name]:
382382
return False
383-
if patch[prop_name]["id"] != expected_value:
383+
if patch[prop_name]["id"] != int(expected_value):
384384
return False
385385
except KeyError:
386386
return False

0 commit comments

Comments
 (0)