|
| 1 | +# go-control-plane Fork |
| 2 | + |
| 3 | +This is a fork of [go-control-plane](https://github.com/envoyproxy/go-control-plane). Before introducing any changes here, please create an issue or submit a change to the upstream repository, as it might impact other users |
| 4 | + |
| 5 | +## How to Contribute |
| 6 | + |
| 7 | +In this fork, we maintain two branches: |
| 8 | + |
| 9 | +- `main`: This branch is synced daily with the upstream repository via an automated action. The only custom addition is the job responsible for synchronization |
| 10 | +- `release`: This branch contains all user-introduced changes. It diverges from the stable version to ensure no unreleased commits are included. Any changes you make should target this branch |
| 11 | + |
| 12 | +## Steps to Contribute |
| 13 | + |
| 14 | +1. Check out the `release` branch |
| 15 | +2. Make your changes and create a pull request targeting the `release` branch |
| 16 | +3. Once your pull request is reviewed, merge it into the `release` branch |
| 17 | + |
| 18 | +## Releasing |
| 19 | + |
| 20 | +For standard releases, the `Sync with Upstream` action handles synchronization and creates custom versions whenever there’s a new upstream release. We fetch upstream tags, so, for example, `v0.13.1` in this fork corresponds directly to the same version in the upstream repository |
| 21 | + |
| 22 | +Our job appends a custom suffix (`+kong-1`) to the upstream tag. If you merge a change and want to create a release, you should tag your commit using the following pattern: |
| 23 | + |
| 24 | +```text |
| 25 | +<current-version>+kong-<incremented-number> |
| 26 | +``` |
| 27 | + |
| 28 | +### Why use `+` instead of `-`? |
| 29 | + |
| 30 | +- Per Semantic Versioning (https://semver.org/), anything after a hyphen (`-`) denotes a pre-release (e.g., `1.2.3-alpha.1`). Many tooling ecosystems interpret pre-releases as being "behind" the final release and will constantly flag that a newer non-pre-release version is available |
| 31 | +- Anything after a plus (`+`) is build metadata. Build metadata does not affect version precedence. By using tags like `vX.Y.Z+kong-N`, we keep the base version identical to upstream and attach our fork-specific identifier without triggering dependency updaters to suggest moving to plain `vX.Y.Z` |
| 32 | + |
| 33 | +#### Example |
| 34 | + |
| 35 | +The current tag is `v0.13.1+kong-1`. After merging your changes, you want to release a new version. You should tag your commit as: |
| 36 | + |
| 37 | +`v0.13.1+kong-2` |
| 38 | + |
| 39 | +After tagging, push the commit to the repository to finalize the release. |
| 40 | + |
| 41 | +## Conflict resolution |
| 42 | + |
| 43 | +It might happen that the automatic release job can hit a conflict. In this situation the maintainer needs to resolve this manually |
| 44 | + |
| 45 | +### Instruction |
| 46 | + |
| 47 | +1. Fetch current `main` and `release` branch |
| 48 | + |
| 49 | + ```bash |
| 50 | + git fetch origin --tags |
| 51 | + ``` |
| 52 | + |
| 53 | +2. Update the current main branch with origin |
| 54 | + |
| 55 | + ```bash |
| 56 | + git reset --hard origin/main |
| 57 | + ``` |
| 58 | + |
| 59 | +3. Change to the release branch |
| 60 | + |
| 61 | + ```bash |
| 62 | + git checkout release |
| 63 | + git reset --hard origin/release |
| 64 | + ``` |
| 65 | + |
| 66 | +4. Remove Untracked files and directories |
| 67 | + |
| 68 | + ```bash |
| 69 | + git clean -fd |
| 70 | + ``` |
| 71 | + |
| 72 | +5. Get the new tag value |
| 73 | + |
| 74 | + ```bash |
| 75 | + ./.github/scripts/get-version-tags.sh |
| 76 | + ``` |
| 77 | + |
| 78 | + **Output:** |
| 79 | + |
| 80 | + ```bash |
| 81 | + Current release tag prefix: v0.13.1 |
| 82 | + Upstream tag: v0.13.2 |
| 83 | + New tag: v0.13.2+kong-1 |
| 84 | + ``` |
| 85 | + |
| 86 | + if tags are equal, you are going to see message `"Tags are equal, no need to release"` and you don't need to release/rebase anything |
| 87 | + |
| 88 | +6. Rebase release branch between tags: |
| 89 | + |
| 90 | + ```bash |
| 91 | + git rebase --onto "<upstream-tag>" <current-release-tag-prefix> release |
| 92 | + ``` |
| 93 | + |
| 94 | +7. If you encounter git conflicts, resolve them, and follow git instruction |
| 95 | + |
| 96 | + - resolve conflicts |
| 97 | + - `git add <files>` |
| 98 | + - `git rebase --continue` |
| 99 | + |
| 100 | +8. Tag the commit |
| 101 | + |
| 102 | + ```bash |
| 103 | + git tag "<new-tag>" |
| 104 | + ``` |
| 105 | + |
| 106 | +9. Push changes to origin |
| 107 | + |
| 108 | + ```bash |
| 109 | + git push origin release --tags --force-with-lease |
| 110 | + ``` |
0 commit comments