Skip to content

Comments

Added Git integration, script execution and more configurability#2

Merged
bsels merged 38 commits intomainfrom
git-integration-scripts
Jan 24, 2026
Merged

Added Git integration, script execution and more configurability#2
bsels merged 38 commits intomainfrom
git-integration-scripts

Conversation

@bsels
Copy link
Owner

@bsels bsels commented Jan 24, 2026

PR Checklist

  • Added tests for the changes
  • Updated docs (root README.md, if necessary)
  • Contains at least one versioning Markdown in .versioning

Problem 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.

bsels added 30 commits January 21, 2026 19:45
- 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.
bsels added 8 commits January 24, 2026 13:40
…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.
@bsels bsels merged commit d8bdec7 into main Jan 24, 2026
1 check passed
@bsels bsels deleted the git-integration-scripts branch January 24, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant