-
Notifications
You must be signed in to change notification settings - Fork 0
Add parameters for generating more flexible changesets using the add goal #97
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
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 |
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.
Resolve this TODO when #95 is merged
"Major change"); | ||
|
||
// See invoker.properties for the dependency change details |
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.
Resolve this when #95 is merged
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider propagating the IOException (or wrapping it in a RuntimeException) to ensure that failures in writing the changeset file are not silently ignored.
LOG.error("Failed to create new changeset", e); | |
LOG.error("Failed to create new changeset", e); | |
throw e; |
Copilot uses AI. Check for mistakes.
You can now create changesets with more prefilled info and with predictable names (useful for testing and dependabot).