Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate the creation of release tags after every release #378

Closed
3 tasks
Tracked by #1361
bbarani opened this issue Sep 2, 2021 · 6 comments
Closed
3 tasks
Tracked by #1361

Automate the creation of release tags after every release #378

bbarani opened this issue Sep 2, 2021 · 6 comments
Assignees
Labels
enhancement New Enhancement good first issue Good for newcomers triaged This issue has been reviewed by the triage team

Comments

@bbarani
Copy link
Member

bbarani commented Sep 2, 2021

Is your feature request related to a problem? Please describe.
Currently the plugin teams are creating release tags manually after every release. This can lead to discrepancies when they cut the release tag using a different commit id compared to the one shipped with the artifact

Describe the solution you'd like
The build system knows the the commit id associated with each (generated) component artifacts shipped as part of a distribution. We should come up with an automated process (workflow) to cut release tags for all the components participating in a release based on the commit id (in the build manifest file) after every release.

  • Create proof of concept
  • Create a design document
  • Implementation

Describe alternatives you've considered
Manually creating release tags after release

@bbarani bbarani added enhancement New Enhancement v1.2.0 OpenSearch 1.2 version labels Sep 2, 2021
@peternied peternied added the triaged This issue has been reviewed by the triage team label Sep 28, 2021
@bbarani bbarani added the good first issue Good for newcomers label Oct 11, 2021
@peternied peternied removed the v1.2.0 OpenSearch 1.2 version label Nov 16, 2021
@dblock
Copy link
Member

dblock commented Dec 14, 2021

This can help, given a manifest, e.g. https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/1.2.1/53/linux/x64/dist/opensearch/manifest.yml

version=1.2.1.0
for im in $(yq eval -o=j manifest.yml | jq -cr '.components[]'); do
      name=$(echo $im | jq -r '.name' -)
      repo=$(echo $im | jq -r '.repository' | sed s/.git$//g)
      commit_id=$(echo $im | jq -r '.commit_id' -)     
      echo $name $repo $commit_id
done

@dblock
Copy link
Member

dblock commented Dec 22, 2021

For 1.2.3 this is what I am doing:

doit.sh

#!/bin/bash
set -e

version=1.2.3
build_number=295

wget https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/$version/$build_number/linux/x64/dist/opensearch/manifest.yml

for im in $(yq eval -o=j manifest.yml | jq -cr '.components[]'); do
      name=$(echo $im | jq -r '.name' -)
      repo=$(echo $im | jq -r '.repository' -)
      commit_id=$(echo $im | jq -r '.commit_id' -)
      echo "Tagging $name at $commit_id ..."
      mkdir $name
      cd $name
      git init
      git remote add origin $repo
      git fetch --depth 1 origin $commit_id
      git checkout FETCH_HEAD
      if [ "$name" == "OpenSearch" ]; then
            git tag $version
      else
            git tag $version.0
      fi
      git push origin --tags
      cd ..
done

common-utils and performance-analyzer-rca

The common-utils and performance-analyzer-rca projects don't redistribute anything, so I had to tag that one manually.

@peterzhuamazon
Copy link
Member

We need to add another workflow to change input manifest with tags and PR changes.

@zelinh
Copy link
Member

zelinh commented Feb 8, 2022

Why we don't use the build manifest to fetch the component name, repo, commit_id and etc.
e.g. from https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/$version/$build_number/linux/x64/build/opensearch/manifest.yml
This will also include plugin like common-util which didn't redistribute.

@zelinh
Copy link
Member

zelinh commented Feb 11, 2022

The current approach I am thinking is:
With version and build number as input parameters, we could acquire the build manifest from S3 using downloadFromS3 groovy method with manifest path like following (distribution-build-opensearch/$version/$build_number/linux/x64/build/opensearch/manifest.yml). We could get the information (e.g. component’s name, commit id, repo link) from the build manifest with implemented BuildManifest.groovy and some new functions to retrieve data from components. With all these, we could then create GitHub release tag for all components with a Github bot account.

@zelinh
Copy link
Member

zelinh commented Mar 9, 2022

Closing this as this has been completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New Enhancement good first issue Good for newcomers triaged This issue has been reviewed by the triage team
Projects
None yet
Development

No branches or pull requests

5 participants