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

Onboard 1-click release process #52

Merged

Conversation

Yury-Fridlyand
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand commented Jun 20, 2023

Description

Following @gaiksaya request from opensearch-project/opensearch-build#3633.
As a sample I used JDBC driver files and PR 48: opensearch-project/sql-jdbc#48.

See new workflow run: https://github.com/Bit-Quill/sql-odbc/actions/runs/5325195930/jobs/9646261731
And draft release created: https://github.com/Bit-Quill/sql-odbc/releases
Each zip contains an installer which should be signed by Jenkins and published on artifacts.

image

Issues Resolved

Make release process great again automatic.

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Comment on lines 27 to 30
files: |
mac64-installer.zip
windows32-installer.zip
windows64-installer.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Yury-Fridlyand ,
So the process works in such a way that the pipeline tries to download the artifact here: https://github.com/opensearch-project/opensearch-build-libraries/blob/main/vars/standardReleasePipelineWithGenericTrigger.groovy#L85
Can you tar all 3 into one and just attach that as artifact to the draft release?
Don't need to zip each of them. Just raw artifacts bundled together in artifacts.tar.gz
Not sure if you can fix the naming of the artifacts too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 52fa5a4.
Draft sample:
image
Archive content (3 dirs with one file in each):

mac64-installer
└── OpenSearch SQL ODBC Driver 64-bit-1.5.0.0-Darwin.pkg
windows32-installer
└── OpenSearch SQL ODBC Driver 32-bit-1.5.0.0-Windows.msi
windows64-installer
└── OpenSearch SQL ODBC Driver 64-bit-1.5.0.0-Windows.msi

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 92bdad8, archive content now:

mac64-installer
└── OpenSearch-SQL-ODBC-Driver-64-bit-1.5.0.0-Darwin.pkg
windows32-installer
└── OpenSearch-SQL-ODBC-Driver-32-bit-1.5.0.0-Windows.msi
windows64-installer
└── OpenSearch-SQL-ODBC-Driver-64-bit-1.5.0.0-Windows.msi

jenkins/release.jenkinsFile Outdated Show resolved Hide resolved
jenkins/release.jenkinsFile Outdated Show resolved Hide resolved
Yury-Fridlyand and others added 2 commits June 20, 2023 14:22
Co-authored-by: Sayali Gaikawad <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand Yury-Fridlyand requested a review from gaiksaya June 22, 2023 02:31
Signed-off-by: Yury-Fridlyand <[email protected]>
jobs:
draft-a-release:
name: Draft a release
runs-on: ubuntu-latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Yury-Fridlyand Looks good!
One minor recommendation, there is a 2PR approval process we recently on added (that's why missing from jdbc repo I believe).
Can you add that as well?
Sample code: https://github.com/opensearch-project/spring-data-opensearch/blob/main/.github/workflows/release-drafter.yml#L16-L27

Sorry about that not sure how I missed it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 1751721

Comment on lines +15 to +19
uses: dawidd6/[email protected]
with:
workflow: sql-odbc-main.yml
commit: ${{github.sha}}
workflow_conclusion: success
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also will the Release drafter wait until sql-odbc-main.yml completes? How does this work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow fails if main CI workflow is not completed yet or failed. But it can be manually restarted to get fresh CI results later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See example in https://github.com/Bit-Quill/sql-odbc/actions/runs/5349394842/jobs/9700551170
Automatic run (attempt 1):
image
Restarted later (attempt 2):
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see! Thanks! Wondering if something like trigger and wait will be helpful than failing and retrying always?
Because when you push a tag sql-odbc-main.yml will run too due to push event of tag. So I believe it will fail everytime and we need to retry.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK this workflow can uses GHA run triggered by last merge commit on main. Cutting a tag on that commit will just re-run it.
I agree that it is not the best option, it needs more testing. I can update it and use wait-on-check action later.

@gaiksaya
Copy link
Member

There is one more workflow named as release drafter maybe rename that one to release-notes-drafter?
https://github.com/opensearch-project/sql-odbc/blob/main/.github/workflows/draft-release-notes-workflow.yml#L1

Copy link
Member

@gaiksaya gaiksaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

- id: get_data
run: |
echo "approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '*\n ' | sed 's/@/,/g' | sed 's/,//1')" >> $GITHUB_OUTPUT
echo "version=$(cat version.properties)" >> $GITHUB_OUTPUT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pick up version from right place?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, the sharp eyes!
Fixed in d532186

Signed-off-by: Yury-Fridlyand <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants