Fix extract_todos_structured.py behavior - #377
Conversation
…t self-parsing - Added `.Jules` to exclusions to prevent recursively parsing agent files. - Added self-skip check in loop so `extract_todos_structured.py` is ignored and its regexes are not parsed. - Upgraded regex logic to support the optional `owner` property in structured TODOs.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the structured TODO extraction script to better control directory traversal, avoid self-scanning, and support an owner field in structured TODO metadata while maintaining backward compatibility with the previous format. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- When skipping
extract_todos_structured.py, you currently rely on the filename only; if this script is ever renamed or duplicated under a different name, it will be scanned again—consider skipping by full path or by a clearer marker to make the exclusion more robust.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- When skipping `extract_todos_structured.py`, you currently rely on the filename only; if this script is ever renamed or duplicated under a different name, it will be scanned again—consider skipping by full path or by a clearer marker to make the exclusion more robust.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Fixes a SonarCloud warning about inefficient regex in loops.
Fixes a SonarCloud warning about inefficient regex in loops.
Fixes a SonarCloud warning about inefficient regex in loops.
|
Good call! I've updated the script to use |
Addresses code review feedback indicating that excluding solely by filename 'extract_todos_structured.py' is fragile. Compares file resolutions against Path(__file__).resolve() to ensure only this specific file is ignored regardless of its final name or directory placement.
Addresses a SonarCloud warning about maintainability (too much nesting) by breaking early when files are irrelevant or lines don't contain 'TODO'.
|



This pull request addresses several issues with the
extract_todos_structured.pytool. It adds.Julesto the list of excluded directories to speed up traversal and avoid indexing instructions as code logic. The script was also scanning its own source code and incorrectly identifying the matching regexes themselves as TODOs, so I implemented a check to skip scanningextract_todos_structured.py. Furthermore, it now extracts theownermetadata field from correctly structured TODOs, such as those written by Sentinel (TODO(priority=Low, complexity=Medium, owner=infra):...), while falling back to older patterns ifowneris missing.PR created automatically by Jules for task 7795192670709366839 started by @MasumRab
Summary by Sourcery
Improve structured TODO extraction behavior and metadata handling in the todo scanning script.
Bug Fixes:
Enhancements: