-
Notifications
You must be signed in to change notification settings - Fork 4
Add option to group updates of the same dependency #480
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
WalkthroughThe changes introduce a new parameter for grouping dependency updates across multiple configuration, test, and source files. The updates include minor formatting fixes in workflow and lint configuration files, enhanced documentation in the README, and adjustments in action metadata. New test cases and updates to the release notes generation functions now support grouping dependency updates when enabled. Additionally, the input interface has been extended to capture the new flag. All modifications maintain existing functionality while expanding configurability. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Context
participant Notes
participant DependencyGrouper
User->>Context: Provide inputs (group-dependencies flag)
Context-->>Notes: Return complete inputs
Notes->>Notes: Start generating release notes
alt Group dependencies enabled
Notes->>DependencyGrouper: Call groupDependencyUpdates()
DependencyGrouper-->>Notes: Return grouped dependency updates
end
Notes->>Notes: Collapse sections into final markdown
Notes-->>User: Output release notes markdown
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
README.md (1)
7-7
: Potential formatting issue with[!NOTE]
.GitHub Flavored Markdown may not render
[!NOTE]
as expected. Consider using a standard blockquote for clarity.src/notes.ts (2)
111-160
: Manual parsing approach.The logic is straightforward but somewhat verbose. Overall, it effectively segments the header, category sections, and footer.
Consider a simpler or more structured parser approach if maintainability becomes an issue.
280-348
: Regex-based approach for Renovate and Dependabot.Effectively groups repeated dependencies while preserving the earliest version and PR links. Consider handling edge cases for non-semver or special dependency names if needed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
dist/context.d.ts
is excluded by!**/dist/**
dist/index.js
is excluded by!**/dist/**
dist/index.js.map
is excluded by!**/dist/**
,!**/*.map
dist/notes.d.ts
is excluded by!**/dist/**
📒 Files selected for processing (9)
.github/workflows/dependency-review.yml
(1 hunks).markdownlint-cli2.yaml
(1 hunks)README.md
(3 hunks)__tests__/notes.test.ts
(4 hunks)__tests__/release.test.ts
(1 hunks)__tests__/version.test.ts
(1 hunks)action.yml
(1 hunks)src/context.ts
(2 hunks)src/notes.ts
(3 hunks)
✅ Files skipped from review due to trivial changes (2)
- .github/workflows/dependency-review.yml
- .markdownlint-cli2.yaml
🔇 Additional comments (22)
action.yml (1)
33-36
: New parameter for dependency grouping looks good!The addition of the
group-dependencies
parameter with a clear description and appropriate default value aligns well with the overall action design. This will provide users with flexibility in how dependencies are presented in release notes.__tests__/release.test.ts (1)
150-150
: Properly updated test configurationThe test inputs object has been correctly updated to include the new
groupDependencies
parameter with the default value oftrue
, maintaining consistency with the action.yml configuration.__tests__/version.test.ts (1)
17-17
: Test inputs updated correctlyThe
fakeInputs
object has been properly updated to include the newgroupDependencies
parameter with the default value oftrue
, maintaining consistency with other test files and the action configuration.src/context.ts (2)
15-15
: Interface updated correctly for new parameterThe
Inputs
interface has been properly extended with the newgroupDependencies
boolean property.
30-30
: Input initialization implemented properlyThe
getInputs
function correctly retrieves thegroup-dependencies
value using the appropriategetBooleanInput
method, which handles the string-to-boolean conversion.__tests__/notes.test.ts (10)
2-2
: The import looks good.The new import for
groupDependencyUpdates
is consistent with its usage in this file.
86-86
: No concerns with this new property.
groupDependencies
is set totrue
, aligning with the intended test scenario.
126-126
: Consistent usage ofgroupDependencies
.Repeating the input further ensures coverage for grouping logic.
323-325
: Documentation comment note.These lines only contain a comment instructing future additions, no functional impact.
327-344
: Thorough test for Renovate dependency grouping.Verifies combining multiple versions of the same dependency into a single line item. Looks correct and complete.
346-364
: Dependabot grouping test is clear.Ensures that multiple bump lines for the same dependency are consolidated properly.
366-394
: Comprehensive test for mixed grouping scenarios.Confirmed that grouping only occurs within the same section. This is expected behavior and is well-validated.
395-418
: Valid test covering ungrouped dependencies.Verifies that different dependency names remain separate, confirming correct grouping boundaries.
419-438
: Good coverage for empty sections.Ensures the grouping logic gracefully bypasses empty or unrelated items, preserving original structure.
439-451
: Ensures original sections are preserved.Guarantees no unexpected merges across different categories. The test scenario is well covered.
README.md (2)
40-53
: Documented new input parameters.The table is well-structured and clearly explains the new inputs. Usage details are consistent with the code.
64-65
: New output parameters.
release-header
andrelease-footer
offer more customization in the release notes.src/notes.ts (5)
57-62
: Conditional grouping logic.Invoking
groupDependencyUpdates
only ifgroupDependencies
istrue
is a clean approach that preserves existing behavior by default.
98-106
: Updated docstring.The expanded explanation clarifies how sections are collapsed. It's helpful and accurate.
161-209
: Section collapsing logic.Appropriately uses
<details>
to collapse sections exceeding the threshold. Implementation is concise and matches the docstring.
248-253
: New function signature for grouping dependencies.Clear doc comment specifying the behavior and return structure.
350-399
: Second pass: constructing consolidated entries.Correctly merges all references for the same dependency while preserving the order of non-dependency items.
Docstrings generation was requested by @lucacome. * #480 (comment) The following files were modified: * `src/context.ts` * `src/notes.ts`
Note Generated docstrings for this pull request at #481 |
Summary by CodeRabbit
New Features
Documentation
Chores