opensearch-project / opensearch-build

🧰 OpenSearch / OpenSearch-Dashboards Build Systems
Apache License 2.0
134 stars 267 forks source link

[Enhancement] Branch Cut workflow to have the intelligence to detect version bump before cutting branch. #4814

Open 5u5hma opened 1 month ago

5u5hma commented 1 month ago

Is your feature request related to a problem? Please describe

In the Managed Side we have a process called AutoSync which helps in syncing GitHub to Git Farm so when there is a bump commit in 2.x and then branch cut it helps identify the bump and the next version commits to sync further. However, when the bump commit merge is missed and branch is cut from 2.x already and then later version bump commit happens in the version specific branch, this impacts the sync process on managed side there by blocking next version syncs for that respective plugin.

Example:

Version bump is after the branch cut for 2.14.0 https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/commits/2.14 fb1536ef79da4694d377435448607c50b3a2a5dd - this is the branch cut commit post which the version bump commit is done.

Describe the solution you'd like

So we would like to have the intelligence added in the branch cut workflow to check for the version bump is completed before cutting the branch.

Describe alternatives you've considered

The only alternative is for manual intervention framework Metadata for plugin which is done by the release POC and the plugin team collaborated which is not much useful if there are more plugins impacted in similar issue.

Additional context

Some of the plugins seen with similar issue in 2.14.0 recently are Anomaly detection, dashboards anomaly detection, security analytics.

peterzhuamazon commented 1 month ago

Hi Sushma,

Based on the original code of branch cut. It does not use any jenkins lib nor does it engage build python code. It is simply a couple of git commands doing the checkout and push again with new branch name: https://github.com/opensearch-project/opensearch-build/blob/opensearch-2.14.0/jenkins/release-branch/release-branch.jenkinsfile

Probably a few tweaks to branch cut workflow to help improve the version enforcing:

  1. Add a param / option to enforce the version check: VERSION_CHECK: <VERSION>.
  2. Use either gradle or yarn based on the input manifest provided to do a simple version check.
  3. If version mismatch, do not fail the entire run but rather save the component in a list and report later without cutting that specific branch.

We can also add a version check standalone workflow if needed and use it as a pre-requisite of branch cut, tho that might be an overkill at the moment.

Thanks.

peterzhuamazon commented 1 month ago

Trying to monitor the version bump in potential central release dashboards improvements:

gaiksaya commented 1 month ago

Hi @5u5hma,

Creating a release branch via automation is something that we added recently. Please note that we take this action only on the day of first release candidate creation. This is more of a proactive measure instead to avoid build failures. As @peterzhuamazon mentioned, we can add a check to make sure versions are bumped before a branch is cut via automation workflow. However, each repo has its own maintainers and codeowners that might decide to cut branch when they want which includes before the version bump, etc which we or the automation workflow has no control over whatsoever. I believe this will be still be an edge case for automation mentioned in issue description.

@dblock @prudhvigodithi Please add your thoughts if any.