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

Automation for component release issue creation: Fix the GH 256 job limit #3742

Merged
merged 1 commit into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/os-release-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
name: release-issue-os

on:
workflow_dispatch:
inputs:
logLevel:
description: Log level
required: true
default: warning
type: choice
options:
- info
- warning
- debug
schedule:
- cron: 0 1 * * *

jobs:
list-manifest-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
repository: opensearch-project/opensearch-build
ref: main
- id: set-matrix
# 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"]
run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | cut -d'/' -f2 | grep '0$' | grep -v '[0-9]0$' | sort | uniq | jq -R -s -c 'split("\n")[:-1]')"
component-release-issue:
needs: list-manifest-versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
entry:
- {repo: OpenSearch}
- {repo: alerting}
- {repo: anomaly-detection}
- {repo: asynchronous-search}
- {repo: common-utils}
- {repo: cross-cluster-replication}
- {repo: geospatial}
- {repo: index-management}
- {repo: job-scheduler}
- {repo: k-NN}
- {repo: neural-search}
- {repo: ml-commons}
- {repo: notifications}
- {repo: observability}
- {repo: performance-analyzer}
- {repo: performance-analyzer-rca}
- {repo: reporting}
- {repo: security}
- {repo: security-analytics}
- {repo: sql}
release_version: ${{ fromJson(needs.list-manifest-versions.outputs.matrix) }}
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780
- name: Check out build repo
uses: actions/checkout@v3
- name: Check out plugin repo
uses: actions/checkout@v3
with:
path: plugin-repo
repository: opensearch-project/${{ matrix.entry.repo }}
- name: Replace placeholders
run: |
# Read the file contents and replace the placeholders
file_path="../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md"
RELEASE_VERSION="${{ matrix.release_version }}"
RELEASE_ISSUE="${{ steps.build-repo-release-issue.outputs.url }}"
RELEASE_VERSION_X=$(echo "${{ steps.build-repo-release-issue.outputs.url }}" | awk -F'.' '{print $1}').x
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"
- name: Check if issue exists
id: check_if_issue_exists
uses: actions-cool/issues-helper@v3
with:
actions: 'find-issues'
repo: opensearch-project/${{ matrix.entry.repo }}
token: ${{ steps.github_app_token.outputs.token }}
title-includes: '[RELEASE] Release version ${{ matrix.release_version }}'
- name: Create Issue From File
if: steps.check_if_issue_exists.outputs.check-result =='false'
uses: peter-evans/create-issue-from-file@v4
with:
title: '[RELEASE] Release version ${{ matrix.release_version }}'
content-filepath: ../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md
labels: 'v${{ matrix.release_version }}'
token: ${{ steps.github_app_token.outputs.token }}
repository: opensearch-project/${{ matrix.entry.repo }}
94 changes: 94 additions & 0 deletions .github/workflows/osd-release-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
name: release-issue-osd

on:
workflow_dispatch:
inputs:
logLevel:
description: Log level
required: true
default: warning
type: choice
options:
- info
- warning
- debug
schedule:
- cron: 0 1 * * *

jobs:
list-manifest-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
repository: opensearch-project/opensearch-build
ref: main
- id: set-matrix
# 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"]
run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | cut -d'/' -f2 | grep '0$' | grep -v '[0-9]0$' | sort | uniq | jq -R -s -c 'split("\n")[:-1]')"
component-release-issue:
needs: list-manifest-versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
entry:
- {repo: OpenSearch-Dashboards}
- {repo: dashboards-observability}
- {repo: dashboards-reporting}
- {repo: dashboards-visualizations}
- {repo: dashboards-query-workbench}
- {repo: dashboards-maps}
- {repo: anomaly-detection-dashboards-plugin}
- {repo: ml-commons-dashboards}
- {repo: index-management-dashboards-plugin}
- {repo: dashboards-notifications}
- {repo: alerting-dashboards-plugin}
- {repo: security-analytics-dashboards-plugin}
- {repo: security-dashboards-plugin}
- {repo: dashboards-search-relevance}
- {repo: opensearch-dashboards-functional-test}
release_version: ${{ fromJson(needs.list-manifest-versions.outputs.matrix) }}
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780
- name: Check out build repo
uses: actions/checkout@v3
- name: Check out plugin repo
uses: actions/checkout@v3
with:
path: plugin-repo
repository: opensearch-project/${{ matrix.entry.repo }}
- name: Replace placeholders
run: |
# Read the file contents and replace the placeholders
file_path="../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md"
RELEASE_VERSION="${{ matrix.release_version }}"
RELEASE_ISSUE="${{ steps.build-repo-release-issue.outputs.url }}"
RELEASE_VERSION_X=$(echo "${{ steps.build-repo-release-issue.outputs.url }}" | awk -F'.' '{print $1}').x
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"
- name: Check if issue exists
id: check_if_issue_exists
uses: actions-cool/issues-helper@v3
with:
actions: 'find-issues'
repo: opensearch-project/${{ matrix.entry.repo }}
token: ${{ steps.github_app_token.outputs.token }}
title-includes: '[RELEASE] Release version ${{ matrix.release_version }}'
- name: Create Issue From File
if: steps.check_if_issue_exists.outputs.check-result =='false'
uses: peter-evans/create-issue-from-file@v4
with:
title: '[RELEASE] Release version ${{ matrix.release_version }}'
content-filepath: ../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md
labels: 'v${{ matrix.release_version }}'
token: ${{ steps.github_app_token.outputs.token }}
repository: opensearch-project/${{ matrix.entry.repo }}
99 changes: 2 additions & 97 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ name: releases

on:
workflow_dispatch:
inputs:
logLevel:
description: Log level
required: true
default: warning
type: choice
options:
- info
- warning
- debug
schedule:
- cron: 0 0 * * *

Expand All @@ -23,107 +13,22 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
repository: opensearch-project/opensearch-build
ref: main
- id: set-matrix
# 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"]
run: echo "::set-output name=matrix::$(ls manifests/**/opensearch*.yml | cut -d'/' -f2 | sort | uniq | jq -R -s -c 'split("\n")[:-1]')"
component-release-issue:
check:
needs: list-manifest-versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
entry:
- {repo: OpenSearch}
- {repo: alerting}
- {repo: anomaly-detection}
- {repo: asynchronous-search}
- {repo: common-utils}
- {repo: cross-cluster-replication}
- {repo: geospatial}
- {repo: index-management}
- {repo: job-scheduler}
- {repo: k-NN}
- {repo: neural-search}
- {repo: ml-commons}
- {repo: notifications}
- {repo: observability}
- {repo: performance-analyzer}
- {repo: performance-analyzer-rca}
- {repo: reporting}
- {repo: security}
- {repo: security-analytics}
- {repo: sql}
- {repo: OpenSearch-Dashboards}
- {repo: dashboards-observability}
- {repo: dashboards-reporting}
- {repo: dashboards-visualizations}
- {repo: dashboards-query-workbench}
- {repo: dashboards-maps}
- {repo: anomaly-detection-dashboards-plugin}
- {repo: ml-commons-dashboards}
- {repo: index-management-dashboards-plugin}
- {repo: dashboards-notifications}
- {repo: alerting-dashboards-plugin}
- {repo: security-analytics-dashboards-plugin}
- {repo: security-dashboards-plugin}
- {repo: dashboards-search-relevance}
- {repo: opensearch-dashboards-functional-test}
release_version: ${{ fromJson(needs.list-manifest-versions.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: dblock/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ matrix.release_version }}
id: build-repo-release-issue
with:
search_existing: all
update_existing: false
filename: .github/ISSUE_TEMPLATE/release_template.md
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780
- name: Check out build repo
uses: actions/checkout@v3
if: ${{ endsWith(matrix.release_version, '.0') }}
- name: Check out plugin repo
uses: actions/checkout@v3
if: ${{ endsWith(matrix.release_version, '.0') }}
with:
path: plugin-repo
repository: opensearch-project/${{ matrix.entry.repo }}
- name: Replace placeholders
if: ${{ endsWith(matrix.release_version, '.0') }}
run: |
# Read the file contents and replace the placeholders
file_path="../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md"
RELEASE_VERSION="${{ matrix.release_version }}"
RELEASE_ISSUE="${{ steps.build-repo-release-issue.outputs.url }}"
RELEASE_VERSION_X=$(echo "${{ steps.build-repo-release-issue.outputs.url }}" | awk -F'.' '{print $1}').x
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"
- name: Check if issue exists
if: ${{ endsWith(matrix.release_version, '.0') }}
id: check_if_issue_exists
uses: actions-cool/issues-helper@v3
with:
actions: 'find-issues'
repo: opensearch-project/${{ matrix.entry.repo }}
token: ${{ steps.github_app_token.outputs.token }}
title-includes: '[RELEASE] Release version ${{ matrix.release_version }}'
- name: Create Issue From File
if: steps.check_if_issue_exists.outputs.check-result =='false'
uses: peter-evans/create-issue-from-file@v4
with:
title: '[RELEASE] Release version ${{ matrix.release_version }}'
content-filepath: ../opensearch-build/.github/ISSUE_TEMPLATE/component_release_template.md
labels: 'v${{ matrix.release_version }}'
token: ${{ steps.github_app_token.outputs.token }}
repository: opensearch-project/${{ matrix.entry.repo }}
Loading