Skip to content

Commit 83a1933

Browse files
Component release issue creation
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
1 parent 142f8c3 commit 83a1933

File tree

2 files changed

+105
-9
lines changed

2 files changed

+105
-9
lines changed

.github/ISSUE_TEMPLATE/component_release_template.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
This is a component issue for __{REPLACE_WITH_RELEASE_VERSION}__.
2-
Coming from [opensearch-build__REPLACE_ISSUE_NUMBER__](https://github.com/opensearch-project/opensearch-build/issues/__REPLACE_ISSUE_NUMBER__). Please follow the following checklist.
1+
This is a component issue for `{{RELEASE_VERSION}}`.
2+
Coming from {{RELEASE_ISSUE}}. Please follow the following checklist.
33
__Please refer to the DATES in that post__.
44

55
<details><summary>How to use this issue</summary>
@@ -22,7 +22,7 @@ Linked at the top of this issue, the overall release issue captures the state of
2222

2323
## What should I do if my plugin isn't making any changes?
2424

25-
If including changes in this release, increment the version on `__{REPLACE_MAJOR_MINOR_PATCH}__` branch to `__{REPLACE_MAJOR_MINOR_PATCH}__` for Min/Core, and `__{REPLACE_MAJOR_MINOR_PATCH_0}__` for components. Otherwise, keep the version number unchanged for both.
25+
If including changes in this release, increment the version on `{{RELEASE_VERSION_X}}` branch to `{{RELEASE_VERSION}}` for Min/Core, and `{{RELEASE_VERSION}}.0` for components. Otherwise, keep the version number unchanged for both.
2626

2727
</p>
2828
</details>
@@ -38,11 +38,11 @@ If including changes in this release, increment the version on `__{REPLACE_MAJOR
3838

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

4343
### Pre-Release
4444

45-
- [ ] Update to the `__REPLACE_MAJOR_MINOR__` release branch in the [distribution manifest](https://github.com/opensearch-project/opensearch-build/blob/main/manifests/__REPLACE_MAJOR_MINOR_PATCH__).
45+
- [ ] 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.
4848
- [ ] Confirm that all changes for `__{REPLACE_MAJOR_MINOR_PATCH}__` have been merged.

.github/workflows/releases.yml

+100-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ name: releases
33

44
on:
55
workflow_dispatch:
6+
inputs:
7+
logLevel:
8+
description: Log level
9+
required: true
10+
default: warning
11+
type: choice
12+
options:
13+
- info
14+
- warning
15+
- debug
616
schedule:
717
- cron: 0 0 * * *
818

@@ -13,22 +23,108 @@ jobs:
1323
matrix: ${{ steps.set-matrix.outputs.matrix }}
1424
steps:
1525
- uses: actions/checkout@v3
26+
with:
27+
repository: opensearch-project/opensearch-build
28+
ref: main
1629
- id: set-matrix
1730
# produces a list of versions, e.g. ["1.0.0","1.0.0","1.0.1","1.1.0","1.2.0","2.0.0"]
1831
run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | cut -d'/' -f2 | sort | uniq | jq -R -s -c 'split("\n")[:-1]')"
19-
check:
32+
component-release-issue:
2033
needs: list-manifest-versions
2134
runs-on: ubuntu-latest
2235
strategy:
36+
fail-fast: false
2337
matrix:
24-
version: ${{ fromJson(needs.list-manifest-versions.outputs.matrix) }}
38+
entry:
39+
- {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}
47+
- {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}
59+
- {repo: OpenSearch-Dashboards}
60+
- {repo: dashboards-observability}
61+
- {repo: dashboards-reporting}
62+
- {repo: dashboards-visualizations}
63+
- {repo: dashboards-query-workbench}
64+
- {repo: dashboards-maps}
65+
- {repo: anomaly-detection-dashboards-plugin}
66+
- {repo: ml-commons-dashboards}
67+
- {repo: index-management-dashboards-plugin}
68+
- {repo: dashboards-notifications}
69+
- {repo: alerting-dashboards-plugin}
70+
- {repo: security-analytics-dashboards-plugin}
71+
- {repo: security-dashboards-plugin}
72+
- {repo: dashboards-search-relevance}
73+
- {repo: opensearch-dashboards-functional-test}
74+
release_version: ${{ fromJson(needs.list-manifest-versions.outputs.matrix) }}
2575
steps:
26-
- uses: actions/checkout@v3
76+
- name: Checkout
77+
uses: actions/checkout@v3
2778
- uses: dblock/create-a-github-issue@v3.0.0
2879
env:
2980
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
VERSION: ${{ matrix.version }}
81+
VERSION: ${{ matrix.release_version }}
82+
id: build-repo-release-issue
3183
with:
3284
search_existing: all
3385
update_existing: false
3486
filename: .github/ISSUE_TEMPLATE/release_template.md
87+
- name: GitHub App token
88+
id: github_app_token
89+
uses: tibdex/github-app-token@v1.6.0
90+
with:
91+
app_id: ${{ secrets.APP_ID }}
92+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
93+
installation_id: 22958780
94+
- name: Check out build repo
95+
uses: actions/checkout@v3
96+
if: ${{ endsWith(matrix.release_version, '.0') }}
97+
- name: Check out plugin repo
98+
uses: actions/checkout@v3
99+
if: ${{ endsWith(matrix.release_version, '.0') }}
100+
with:
101+
path: plugin-repo
102+
repository: opensearch-project/${{ matrix.entry.repo }}
103+
- name: Replace placeholders
104+
if: ${{ endsWith(matrix.release_version, '.0') }}
105+
run: |
106+
# Read the file contents and replace the placeholders
107+
file_path="../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md"
108+
RELEASE_VERSION="${{ matrix.release_version }}"
109+
RELEASE_ISSUE="${{ steps.build-repo-release-issue.outputs.url }}"
110+
RELEASE_VERSION_X="echo ${{ steps.build-repo-release-issue.outputs.url }} | awk -F'.' '{print $1}'"
111+
RELEASE_VERSION_X=$(echo "${{ steps.build-repo-release-issue.outputs.url" | awk -F'.' '{print $1}').x
112+
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"
113+
- name: Check if issue exists
114+
if: ${{ endsWith(matrix.release_version, '.0') }}
115+
id: check_if_issue_exists
116+
uses: actions-cool/issues-helper@v3
117+
with:
118+
actions: 'find-issues'
119+
repo: opensearch-project/${{ matrix.entry.repo }}
120+
token: ${{ steps.github_app_token.outputs.token }}
121+
title-includes: '[RELEASE] Release version ${{ matrix.release_version }}'
122+
- name: Create Issue From File
123+
if: steps.check_if_issue_exists.outputs.check-result =='false'
124+
uses: peter-evans/create-issue-from-file@v4
125+
with:
126+
title: '[RELEASE] Release version ${{ matrix.release_version }}'
127+
content-filepath: ../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md
128+
labels: 'v${{ matrix.release_version }}'
129+
token: ${{ steps.github_app_token.outputs.token }}
130+
repository: opensearch-project/${{ matrix.entry.repo }}

0 commit comments

Comments
 (0)