Added Git integration, script execution and more configurability#2
Merged
Added Git integration, script execution and more configurability#2
Conversation
- Introduced `Git` enum to represent Git states. - Added a Maven parameter to configure Git interaction. - Implemented utility methods for Git operations (stash, commit).
…iles` - Enhance coverage by testing various scenarios, including null inputs, exceptions, and success cases. - Update `ProcessUtils` to remove hardcoded `add .` for more precise file handling.
- Introduced Maven parameters to customize commit messages for version updates and Markdown creation. - Updated `pom.xml` with dependency and plugin updates. - Enhanced `BaseMojo`, `CreateVersionMarkdownMojo`, and `UpdatePomMojo` to include commit and stash utility methods.
… messages - Updated placeholder format in `CreateVersionMarkdownMojo` and `UpdatePomMojo` for clarity and consistency. - Added `PlaceHolderWithType` model to support dynamic placeholder replacements. - Implemented `Utils.prepareFormatString` for safer and more flexible string formatting. - Refactored version update logic to handle project count and generate commit messages dynamically.
- Cover scenarios such as null inputs, invalid placeholders, and various formatting cases. - Ensure proper behavior with special characters, repeated placeholders, and complex strings.
…tests - Extend test coverage by validating Git-related process commands. - Update `CreateVersionMarkdownMojoTest` and `UpdatePomMojoTest` with mocked `ProcessBuilder` and `mockedExecutedProcesses` assertions. - Refactor `BaseMojo` Git operations (`stashFiles`, `commit`) to align with updated test expectations.
…it messages and Git integration - Documented new properties: `versioning.commit.message.create`, `versioning.commit.message.update`, and `versioning.git.enabled`. - Improved property tables for better readability and clarity.
- Introduced `versioning.update.scripts` parameter to specify versioning scripts. - Added `scriptPaths` to manage derived script file paths as `Path` objects. - Updated `UpdatePomMojo` to process and store script paths.
- Implemented `executeScripts` method in `UpdatePomMojo` to handle script execution during updates. - Added `ProcessUtils.executeScripts` for script execution with environment variables. - Updated version update logic to invoke scripts for each processed module.
- Added details about the `versioning.update.scripts` property, including its purpose, default value, and usage. - Improved property tables for clarity and added examples for better readability.
- Added comprehensive tests to verify behavior for null inputs, process completion, and error handling scenarios. - Validated environment variables, project directory handling, and script execution outcomes.
- Verify script execution flow for single and multi-project scenarios. - Assert proper behavior for environment variables, process invocation, and script execution counts.
- Supports dry-run and in-place updates of version strings in `README.md`. - Integrates optional Git staging for modified files.
- Replaced `versioning.git.enabled` with the more flexible `versioning.git` configuration. - Updated workflow to execute `update-readme.sh` during version updates. - Enhanced README documentation with details about the new Git operation modes.
…ails - Enhanced readability by adjusting column alignments in property tables. - Expanded description of `DRY_RUN` and `GIT_STASH` environment variable values.
- Converted script paths to absolute paths for better reliability. - Updated corresponding unit tests to reflect the changes.
- Configured `jacoco-maven-plugin` with `prepare-agent` and `report` goals. - Introduced `jacoco.version` property to manage plugin versioning.
- Configured `jacoco-maven-plugin` with `prepare-agent` and `report` goals. - Introduced `jacoco.version` property to manage plugin versioning.
…n CI workflow - Added `HTML` format configuration for JaCoCo reports in `pom.xml`. - Updated GitHub Actions workflow to zip coverage report with relative paths.
- Updated `MarkdownUtils` to remove trailing whitespace during YAML serialization. - Adjusted corresponding test cases to reflect the changes.
- Introduced `formatHeaderLine` method to support `{version}` and `{date}` placeholders with customizable date patterns.
- Added caching for custom date formatters to improve performance.
- Extended test coverage for various formatting scenarios and edge cases.
- Introduced `versioning.version.file` parameter with default placeholder `{version} - {date#YYYY-MM-DD}`.
- Updated `mergeVersionMarkdownsInChangelog` to utilize the new header format.
- Extended unit tests to cover header format validation and edge cases.
…pdate documentation accordingly
… parameter descriptions
…te, and support custom date formats
…ation/deserialization logic - Introduced `ArtifactIdentifier` enum for configurable artifact identification modes (`GROUP_ID_AND_ARTIFACT_ID`, `ONLY_ARTIFACT_ID`). - Updated `BaseMojo` to support new `versioning.identifier` parameter. - Added custom serializers and deserializers for `MavenArtifact` to handle artifact-only and full identification scenarios. - Adjusted `MarkdownUtils` to allow configurable YAML serialization/deserialization based on identifier mode. - Extended documentation and updated methods to reflect the changes.
…rialization - Added `MavenArtifactArtifactOnlyKeyDeserializer` for handling artifact ID-only YAML keys. - Updated `MarkdownUtils` to support key-based deserialization and enhance serialization logic. - Adjusted `BaseMojo` with default initialization for `identifier`. - Extended tests for key-based deserialization and artifact-only scenarios.
- Added unit tests for `MavenArtifactArtifactOnlyDeserializer`, `MavenArtifactArtifactOnlyKeyDeserializer`, and `MavenArtifactArtifactOnlySerializer`. - Verified serialization and deserialization of artifact ID-only scenarios. - Extended assertions for expected error handling and field mapping.
…odules - Added integration tests for `ArtifactIdentifier.ONLY_ARTIFACT_ID` mode. - Verified file-based versioning with distinct semantic version bumps per module. - Asserted accurate changelog and POM updates for PATCH, MINOR, and MAJOR version increments. - Included tests for dry-run execution and validation of generated markdown files.
…te README to include details on the new `versioning.identifier` property.
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.
PR Checklist
.versioningProblem or reason
Missing support for git integration.
Current customization functionality.
Implementation
Added configuration for git and include process calls.
Added optional script execution on updates to modify other files during the verison update.
Added more configuration properties.