Skip to content

Commit 13780c8

Browse files
Automate release issue
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
1 parent 09b5143 commit 13780c8

File tree

3 files changed

+66
-54
lines changed

3 files changed

+66
-54
lines changed

.github/ISSUE_TEMPLATE/component_release_template.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ If including changes in this release, increment the version on `{{RELEASE_VERSIO
3232
- [ ] Assign this issue to a release owner.
3333
- [ ] Finalize scope and feature set and update [the Public Roadmap](https://github.com/orgs/opensearch-project/projects/1).
3434
- [ ] All the tasks in this issue have been reviewed by the release owner.
35-
- [ ] Create, update, triage and label all features and issues targeted for this release with `v__REPLACE_MAJOR_MINOR_PATCH__`.
35+
- [ ] Create, update, triage and label all features and issues targeted for this release with `v{{RELEASE_VERSION}}`.
3636

3737
### CI/CD
3838

39-
- [ ] All code changes for `__{REPLACE_MAJOR_MINOR_PATCH}__` are complete.
39+
- [ ] All code changes for `{{RELEASE_VERSION}}` are complete.
4040
- [ ] Ensure working and passing CI.
4141
- [ ] Check that this repo is included in the [distribution manifest](https://github.com/opensearch-project/opensearch-build/blob/main/manifests/{{RELEASE_VERSION}}).
4242

@@ -45,7 +45,7 @@ If including changes in this release, increment the version on `{{RELEASE_VERSIO
4545
- [ ] Update to the `{{RELEASE_VERSION}}` release branch in the [distribution manifest](https://github.com/opensearch-project/opensearch-build/blob/main/manifests/{{RELEASE_VERSION}}).
4646
- [ ] Increment the version on the parent branch to the next development iteration.
4747
- [ ] Gather, review and publish release notes following the [rules](https://github.com/opensearch-project/opensearch-plugins/blob/main/RELEASE_NOTES.md) and back port it to the release branch.[git-release-notes](https://github.com/ariatemplates/git-release-notes) may be used to generate release notes from your commit history.
48-
- [ ] Confirm that all changes for `__{REPLACE_MAJOR_MINOR_PATCH}__` have been merged.
48+
- [ ] Confirm that all changes for `{{RELEASE_VERSION}}` have been merged.
4949
- [ ] Add this repo to the [manifest](https://github.com/opensearch-project/opensearch-build/blob/main/manifests/) for the next developer iteration.
5050

5151
### Release Testing

.github/workflows/os-release-issues.yml

+39-29
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v3
2626
with:
27-
repository: prudhvigodithi/opensearch-build
27+
repository: opensearch-project/opensearch-build
2828
ref: main
2929
- id: set-matrix
3030
# produces a list of major versions, e.g. ["1.4.0","2.10.0","2.6.0","2.7.0","2.8.0","2.9.0","3.0.0"]
@@ -37,66 +37,76 @@ jobs:
3737
matrix:
3838
entry:
3939
- {repo: OpenSearch}
40+
- {repo: alerting}
41+
- {repo: anomaly-detection}
42+
- {repo: asynchronous-search}
43+
- {repo: common-utils}
44+
- {repo: cross-cluster-replication}
45+
- {repo: geospatial}
46+
- {repo: index-management}
4047
- {repo: job-scheduler}
48+
- {repo: k-NN}
49+
- {repo: neural-search}
50+
- {repo: ml-commons}
51+
- {repo: notifications}
52+
- {repo: observability}
53+
- {repo: performance-analyzer}
54+
- {repo: performance-analyzer-rca}
55+
- {repo: reporting}
56+
- {repo: security}
57+
- {repo: security-analytics}
58+
- {repo: sql}
4159
release_version: ${{ fromJson(needs.list-manifest-versions.outputs.matrix) }}
42-
4360
steps:
44-
#- name: GitHub App token
45-
# id: github_app_token
46-
# uses: tibdex/github-app-token@v1.6.0
47-
# with:
48-
# app_id: ${{ secrets.APP_ID }}
49-
# private_key: ${{ secrets.APP_PRIVATE_KEY }}
50-
# installation_id: 22958780
51-
61+
- name: GitHub App token
62+
id: github_app_token
63+
uses: tibdex/github-app-token@v1.6.0
64+
with:
65+
app_id: ${{ secrets.APP_ID }}
66+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
67+
installation_id: 22958780
5268
- name: Checkout
5369
uses: actions/checkout@v3
54-
5570
- name: Check if build repo release issue exists
5671
id: check_if_build_repo_issue_exists
5772
uses: actions-cool/issues-helper@v3
5873
with:
5974
actions: 'find-issues'
60-
repo: prudhvigodithi/opensearch-build
61-
# token: ${{ steps.github_app_token.outputs.token }}
62-
token: ${{ secrets.PAT }}
75+
repo: opensearch-project/opensearch-build
76+
token: ${{ steps.github_app_token.outputs.token }}
77+
issue-state: 'open'
6378
title-includes: '[RELEASE] Release version ${{ matrix.release_version }}'
64-
6579
- name: Check out plugin repo
6680
uses: actions/checkout@v3
6781
with:
6882
path: plugin-repo
69-
repository: prudhvigodithi/${{ matrix.entry.repo }}
70-
83+
repository: opensearch-project/${{ matrix.entry.repo }}
7184
- name: Check if plugin repo release issue exists
7285
if: steps.check_if_build_repo_issue_exists.outputs.issues != '[]'
7386
id: check_if_plugin_repo_issue_exists
7487
uses: actions-cool/issues-helper@v3
7588
with:
7689
actions: 'find-issues'
77-
repo: prudhvigodithi/${{ matrix.entry.repo }}
78-
# token: ${{ steps.github_app_token.outputs.token }}
79-
token: ${{ secrets.PAT }}
90+
repo: opensearch-project/${{ matrix.entry.repo }}
91+
token: ${{ steps.github_app_token.outputs.token }}
92+
issue-state: 'open'
8093
title-includes: '[RELEASE] Release version ${{ matrix.release_version }}'
81-
82-
- name: Replace placeholders
94+
- name: Replace Placeholders
8395
if: steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]'
8496
run: |
8597
# Read the file contents and replace the placeholders
8698
file_path="../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md"
8799
RELEASE_VERSION="${{ matrix.release_version }}"
88-
RELEASE_ISSUE_NUMBER =$(echo "${{ steps.check_if_plugin_repo_issue_exists.outputs.issueNumbers }}" | grep -oE '[0-9]+' | head -n1)
89-
RELEASE_ISSUE="https://github.com/prudhvigodithi/opensearch-build/issues/$RELEASE_ISSUE_NUMBER"
100+
RELEASE_ISSUE_NUMBER=$(echo '${{ steps.check_if_build_repo_issue_exists.outputs.issues }}' | jq '.[0].number')
101+
RELEASE_ISSUE="https://github.com/opensearch-project/opensearch-build/issues/${RELEASE_ISSUE_NUMBER}"
90102
RELEASE_VERSION_X=$(echo "${{ matrix.release_version }}" | awk -F'.' '{print $1}').x
91103
sed -e "s|{{RELEASE_VERSION}}|${RELEASE_VERSION}|g" -e "s|{{RELEASE_ISSUE}}|${RELEASE_ISSUE}|g" -e "s|{{RELEASE_VERSION_X}}|${RELEASE_VERSION_X}|g" "$file_path" > "$file_path.tmp" && mv "$file_path.tmp" "$file_path"
92-
93-
- name: Create Issue From File
104+
- name: Create component release issue from file
94105
if: steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]'
95106
uses: peter-evans/create-issue-from-file@v4
96107
with:
97108
title: '[RELEASE] Release version ${{ matrix.release_version }}'
98109
content-filepath: ../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md
99110
labels: 'v${{ matrix.release_version }}'
100-
# token: ${{ steps.github_app_token.outputs.token }}
101-
token: ${{ secrets.PAT }}
102-
repository: prudhvigodithi/${{ matrix.entry.repo }}
111+
token: ${{ steps.github_app_token.outputs.token }}
112+
repository: opensearch-project/${{ matrix.entry.repo }}

.github/workflows/osd-release-issues.yml

+24-22
Original file line numberDiff line numberDiff line change
@@ -62,40 +62,42 @@ jobs:
6262
installation_id: 22958780
6363
- name: Checkout
6464
uses: actions/checkout@v3
65-
- uses: dblock/create-a-github-issue@v3.0.0
66-
env:
67-
GITHUB_TOKEN: ${{ steps.github_app_token.outputs.token }}
68-
VERSION: ${{ matrix.release_version }}
69-
id: build-repo-release-issue
65+
- name: Check if build repo release issue exists
66+
id: check_if_build_repo_issue_exists
67+
uses: actions-cool/issues-helper@v3
7068
with:
71-
search_existing: all
72-
update_existing: false
73-
filename: .github/ISSUE_TEMPLATE/release_template.md
74-
- name: Check out build repo
75-
uses: actions/checkout@v3
69+
actions: 'find-issues'
70+
repo: opensearch-project/opensearch-build
71+
token: ${{ steps.github_app_token.outputs.token }}
72+
issue-state: 'open'
73+
title-includes: '[RELEASE] Release version ${{ matrix.release_version }}'
7674
- name: Check out plugin repo
7775
uses: actions/checkout@v3
7876
with:
7977
path: plugin-repo
8078
repository: opensearch-project/${{ matrix.entry.repo }}
81-
- name: Replace placeholders
82-
run: |
83-
# Read the file contents and replace the placeholders
84-
file_path="../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md"
85-
RELEASE_VERSION="${{ matrix.release_version }}"
86-
RELEASE_ISSUE="${{ steps.build-repo-release-issue.outputs.url }}"
87-
RELEASE_VERSION_X=$(echo "${{ steps.build-repo-release-issue.outputs.url }}" | awk -F'.' '{print $1}').x
88-
sed -e "s|{{RELEASE_VERSION}}|${RELEASE_VERSION}|g" -e "s|{{RELEASE_ISSUE}}|${RELEASE_ISSUE}|g" -e "s|{{RELEASE_VERSION_X}}|${RELEASE_VERSION_X}|g" "$file_path" > "$file_path.tmp" && mv "$file_path.tmp" "$file_path"
89-
- name: Check if issue exists
90-
id: check_if_issue_exists
79+
- name: Check if plugin repo release issue exists
80+
if: steps.check_if_build_repo_issue_exists.outputs.issues != '[]'
81+
id: check_if_plugin_repo_issue_exists
9182
uses: actions-cool/issues-helper@v3
9283
with:
9384
actions: 'find-issues'
9485
repo: opensearch-project/${{ matrix.entry.repo }}
9586
token: ${{ steps.github_app_token.outputs.token }}
87+
issue-state: 'open'
9688
title-includes: '[RELEASE] Release version ${{ matrix.release_version }}'
97-
- name: Create Issue From File
98-
if: steps.check_if_issue_exists.outputs.issues == '[]'
89+
- name: Replace Placeholders
90+
if: steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]'
91+
run: |
92+
# Read the file contents and replace the placeholders
93+
file_path="../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md"
94+
RELEASE_VERSION="${{ matrix.release_version }}"
95+
RELEASE_ISSUE_NUMBER=$(echo '${{ steps.check_if_build_repo_issue_exists.outputs.issues }}' | jq '.[0].number')
96+
RELEASE_ISSUE="https://github.com/opensearch-project/opensearch-build/issues/${RELEASE_ISSUE_NUMBER}"
97+
RELEASE_VERSION_X=$(echo "${{ matrix.release_version }}" | awk -F'.' '{print $1}').x
98+
sed -e "s|{{RELEASE_VERSION}}|${RELEASE_VERSION}|g" -e "s|{{RELEASE_ISSUE}}|${RELEASE_ISSUE}|g" -e "s|{{RELEASE_VERSION_X}}|${RELEASE_VERSION_X}|g" "$file_path" > "$file_path.tmp" && mv "$file_path.tmp" "$file_path"
99+
- name: Create component release issue from file
100+
if: steps.check_if_plugin_repo_issue_exists.outputs.issues == '[]'
99101
uses: peter-evans/create-issue-from-file@v4
100102
with:
101103
title: '[RELEASE] Release version ${{ matrix.release_version }}'

0 commit comments

Comments
 (0)