Skip to content

Investigate merge-key comment handling in PR controller #953

@efiacor

Description

@efiacor

Status: Not started
Related: GH #1115

The PR controller calls ensureMergeKey after clone/upgrade to add # kpt-merge: comment directives for upstream update reconciliation. The current implementation is a local copy of pkg/task/mergekey.go to avoid importing v1alpha1 types.

Questions to investigate:

  • Is the non-fatal error handling correct? Silent fallback means packages may lack merge-keys without user visibility — future upstream updates produce noisy diffs (delete+add instead of update)

  • Should a missing merge-key surface as a condition or event so users know upstream updates may be degraded?

  • Can the duplication with pkg/task/mergekey.go be eliminated now that v1alpha2 types are separate? Or should it remain isolated?

  • Are there edge cases where ensureMergeKey silently drops resources (e.g. multi-doc YAML files, non-UTF8 content)?

Acceptance Criteria:

  • Investigation doc covering error handling strategy, duplication rationale, and edge cases

  • Decision on whether to surface merge-key failures to users (condition/event/silent)

  • Decision on code deduplication approach

  • Any identified edge cases covered by unit tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions