XMLWordPrintable

    • 5
    • False
    • None
    • True
    • No

      We will repurpose this story to migrate to Grafana 10.x

      In ACM 2.8.0, we upgraded Grafana to v8.5.20. To ensure that future upgrades are blocked due to merge conflicts, we should follow the steps below:

      When syncing with an upstream project, where we particularly care to be up to date with all the changes that occur, we can safely tell git to merge all upstream changes and directly choose to keep their versions of the changes.
      
      To do this, we can run:
      ```bash
      git merge -X theirs <commit/tag>
      ```
      
      When doing a **squash** commit, git attributes all incoming changes as having been authored by us. Then, when the next merge occurs, many merge conflicts may occur, as git sees both us and them as having modified the same files.
      
      Instead, **git-cherry-pick** should be used in order to apply their commits to our repo without squash and without adding a merge commit.
      
      ```bash
      git cherry-pick <start-commit..end-commit>
      ```
      
      Tags are useful here. For example:
      ```bash
      git cherry-pick v0.30.0..v0.30.2
      ```
      
      Here is how we handled the Thanos upgrade from **v0.29.0** to **v0.30.2**:
      
      ```bash
      git checkout -b upgrade-v0.30.2
      git merge -X theirs v0.30.0
      # resolve merge conflicts (there were not many)
      git cherry-pick v0.30.0..v0.30.2
      ```
      
      Additionally, there is a script which is run as a GitHub app that automatically creates PRs when the upstream creates a PR. While this may not be useful to us in its current state, it may possibly be modified to create a PR once every **tag** or **stable release**.
      
      https://github.com/stolostron/magic-mirror

            smeduri1@redhat.com Subbarao Meduri
            smeduri1@redhat.com Subbarao Meduri
            Xiang Yin Xiang Yin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: