Add parameters for generating more flexible changesets using the add goal#97
Merged
Add parameters for generating more flexible changesets using the add goal#97
Conversation
niklasga
commented
Jun 24, 2025
| invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:add -DchangesetContent='Minor change' -DchangesetLevel=MINOR -DchangesetFilename=minor.md | ||
| invoker.goals.3=${project.groupId}:${project.artifactId}:${project.version}:add -DchangesetContent='Major change' -DchangesetLevel=major -DchangesetFilename=major.md | ||
|
|
||
| # TODO Enable this goal to test the dependency change, once that PR is merged |
| "\n" + | ||
| "Major change"); | ||
|
|
||
| // See invoker.properties for the dependency change details |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request adds parameters to the Maven add goal to allow generating changesets with prefilled content and predictable filenames, which is useful for testing and dependabot scenarios. Key changes include:
- Introduction of new parameters (changesetContent, changesetLevel, changesetFilename) and their usage in AddMojo.java.
- Updates to integration tests (verify.groovy and invoker.properties) to validate the new filename and content behavior.
- Modifications in ChangesetWriter.java to support writing changesets with an optionally supplied file.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| changesets-maven-plugin/src/main/java/se/fortnox/changesets/maven/AddMojo.java | Added new parameters and logic for flexible changeset creation |
| changesets-maven-plugin/src/it/add-changeset-from-property/verify.groovy | Updated tests to check multiple changesets with predictable filenames |
| changesets-maven-plugin/src/it/add-changeset-from-property/invoker.properties | Modified invoker goals to supply predictable changeset filenames |
| changesets-maven-plugin/pom.xml | Added configuration to skip certain invocations during tests |
| changesets-java/src/main/java/se/fortnox/changesets/ChangesetWriter.java | Refactored changeset file writing logic to accommodate custom filenames |
| .github/workflows/dependabot-changesets.yml | Updated workflow steps and echo outputs for dependabot metadata |
| LOG.info("Writing changeset to {}", changesetFile); | ||
| Files.writeString(changesetFile, fileContent, StandardOpenOption.CREATE_NEW); | ||
| } catch (IOException e) { | ||
| LOG.error("Failed to create new changeset", e); |
There was a problem hiding this comment.
Consider propagating the IOException (or wrapping it in a RuntimeException) to ensure that failures in writing the changeset file are not silently ignored.
Suggested change
| LOG.error("Failed to create new changeset", e); | |
| LOG.error("Failed to create new changeset", e); | |
| throw e; |
magnusp
approved these changes
Jun 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You can now create changesets with more prefilled info and with predictable names (useful for testing and dependabot).