Skip to content

feat: add configurable MergeStrategy to CommitConfiguration and ChangeTransferPolicy#1118

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-commit-history-issues
Draft

feat: add configurable MergeStrategy to CommitConfiguration and ChangeTransferPolicy#1118
Copilot wants to merge 2 commits intomainfrom
copilot/fix-commit-history-issues

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

Promotions were always using a hardcoded merge strategy, leaving all individual and merge commits visible in the target branch history instead of allowing them to be squashed.

Changes

  • New type PullRequestMergeStrategy (merge | squash) added to pullrequest_types.go; defaults to merge for full backward compatibility
  • CommitConfiguration gains a MergeStrategy field with kubebuilder enum validation and default
  • ChangeTransferPolicySpec gains a Commit CommitConfiguration field so the strategy is configurable at the CTP level
  • CTP controller propagates Commit.MergeStrategy into the PullRequest spec on both creation and merge transition
  • Generated files updated via make generate && make manifests (deepcopy, applyconfiguration builders, CRD YAML)

Example

apiVersion: promoter.argoproj.io/v1alpha1
kind: ChangeTransferPolicy
spec:
  commit:
    mergeStrategy: squash  # or "merge" (default)

SCM provider-level squash implementation (GitHub, GitLab, Forgejo, etc.) is not included here — the field is stored and propagated correctly; provider support is a follow-up.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…eTransferPolicy

Co-authored-by: emirot <2378256+emirot@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix commit history leaving all previous commits feat: add configurable MergeStrategy to CommitConfiguration and ChangeTransferPolicy Feb 27, 2026
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.

2 participants