-
Feature
-
Resolution: Unresolved
-
Major
-
None
-
L
-
False
-
-
False
-
-
0% To Do, 100% In Progress, 0% Done
-
-
Feature Overview (aka. Goal Summary)
This feature aims to close the loop on template management by automating the delivery of template version updates to all consuming software components. Currently, when a template author releases a new version (e.g., bumping java-template from 1.0 to 1.1), downstream component owners only receive a notification that an upgrade is available.
The automated solution will calculate the precise structural and file-level difference (diff) between the component's existing, older template version and the newly available version. It will then automatically create a Pull Request (PR) in the component's source code repository (e.g., GitHub, GitLab) containing only the necessary changes to upgrade the component. This PR serves as an immediate, version-controlled, and human-reviewable mechanism for applying the upgrade.
Goals (aka. expected user outcomes)
- Automated Delivery: Provide an automated, version-controlled mechanism for applying template updates directly into the component's repository.
- Reduced Toil: Component owners are presented with a ready-to-merge PR, drastically reducing the manual effort required to keep components updated.
- Clear Attribution: Ensure all generated PRs are clearly attributed to the automation system (e.g., via a dedicated bot user).
- Promote Consistency: Encourage faster adoption of template best practices, security fixes, and dependency updates across all generated components.
Requirements (aka. Acceptance Criteria):
- Trigger Condition: The system must automatically trigger the PR creation process whenever a template's version is officially marked as released and is greater than the version currently used by a component.
- Diff Calculation: The system must accurately compute the delta (file changes, additions, deletions) between the output of the component's current template version and the output of the new template version.
- PR Creation: A new Pull Request must be generated for each affected component repository.
- Source Branch:* Changes must be committed to a new branch (e.g., feature/template-upgrade-v[NEW_VERSION]).
{} Target Branch:{*} The PR must target the component's main configured branch (e.g., main or master).
- Source Branch:* Changes must be committed to a new branch (e.g., feature/template-upgrade-v[NEW_VERSION]).
- PR Metadata:
- Title: The PR title must clearly state the action and versions, e.g., [Template Upgrade]: Update [Template Name] from v1.0 to v1.1.
- Description: The description must contain the template's release notes (if available), a summary of the automated changes, and clear instructions for the reviewer.
- Author: The PR must be authored by a designated automation bot user.
- Assignment: The PR must be assigned to the component's primary owner(s) or team, as defined in the component metadata. (Technical Note: Verify if the version control system API allows assigning to teams/multiple users).
- Skip Logic: If the diff calculation results in no file changes (an empty PR), the system must log the event but skip the PR creation.
- Error Handling: If an unresolvable merge conflict is detected during the PR generation process (e.g., if the user modified a file that the template also changed fundamentally), the system must skip PR creation for that component and revert to sending the original "New Version Available" notification, including a specific warning about the conflict.
- Configuration: Platform Engineers should be able to enable/disable this feature via YAML configuration file. As well as the PR information similar to the configuration used when sending notifications.
Out of Scope (Optional)
- Auto-Merging: The system will not automatically merge the generated template upgrade PRs. Human review and approval are mandatory.
- Conflict Resolution: The system will not attempt advanced or interactive conflict resolution. Simple conflicts (like appending to a file) may be handled by Git, but complex conflicts are the responsibility of the component owner.
- Bulk Management UI: Development of a dedicated user interface for managing and triggering bulk template upgrades is deferred. Initial focus is on the automated trigger.
Customer Considerations (Optional)
- Conflict Awareness: The PR description must explicitly warn the developer that their custom code might conflict with the template changes and provide instructions on how to handle the inevitable merge conflicts using standard Git tools.
- Bot Identity: Ensure the bot identity is trustworthy and clearly documented, so users understand why the PR is appearing.
Documentation Considerations
- New Feature Guide: Update the "Template Management" documentation section to include the new automated PR flow.
- Developer Workflow: Create a specific guide detailing the expected developer workflow: review the automated PR, handle any conflicts, and merge.