-
Notifications
You must be signed in to change notification settings - Fork 0
feat(dependabot): use jq for robust JSON parsing v1.5.0 #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Replace fragile grep string matching with proper jq JSON parsing for Dependabot CLI output. grep retained as fallback. Changes: - Add jq to prerequisites check (Section 1) - Update Section 5 with jq as primary parsing method - Add jq extraction example for dependency summaries - Correct JSON field paths (data.dependencies[], data["pr-title"]) - Bump version: 1.4.0 → 1.5.0 Benefits: - Handles JSON formatting/whitespace variations - Proper field extraction from nested structures - More meaningful error messages - Future-proof against CLI output changes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @vnz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the reliability of processing Dependabot CLI output by transitioning from basic string matching to structured JSON parsing. This change ensures that the system can accurately interpret and extract dependency update information, making the plugin more resilient to formatting variations and improving overall data integrity. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces jq for robust JSON parsing of Dependabot CLI output, which is a great improvement over the fragile grep method. The changes are well-structured, with jq as the primary method and grep retained as a fallback. The documentation updates are clear and comprehensive. I've added a few suggestions to further improve the clarity of the documentation in SKILL.md.
- Soften jq prerequisite message (recommended, not required) - Use bracket notation for previous-version field (hyphen consistency) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Thanks @gemini-code-assist for the review! Both suggestions applied in 82ead5f:
|
|
That's great to hear, @vnz! I appreciate you clarifying the And thank you for implementing the correct bracket notation for These updates significantly improve the clarity and robustness of the Dependabot plugin's documentation. Excellent work! |
Summary
Replace fragile
grepstring matching with properjqJSON parsing for Dependabot CLI output. Thegrepapproach is retained as a fallback for environments without jq.Problem
The current grep-based parsing:
Is fragile because:
"type": "create_pull_request"vs"type":"create_pull_request")Solution
Use jq for structural JSON parsing:
Changes
data.dependencies[],data["pr-title"])Files Modified
plugins/dependabot/skills/dependabot/SKILL.md— Sections 1 and 5plugins/dependabot/.claude-plugin/plugin.json— version bump.claude-plugin/marketplace.json— version bumpVerification
🤖 Generated with Claude Code