Skip to content

Commit

Permalink
Handle core label creation
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi committed Jul 5, 2023
1 parent 6e9a8f2 commit 5e10028
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/os-increment-plugin-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
fail-fast: false
matrix:
entry:
# Adding the core repo OpenSearch for the label creation automation
- {repo: OpenSearch}
- {repo: alerting}
- {repo: anomaly-detection}
- {repo: asynchronous-search}
Expand Down Expand Up @@ -66,11 +68,13 @@ jobs:
OPENSEARCH_VERSION=$OPENSEARCH_VERSION-SNAPSHOT
echo "OPENSEARCH_VERSION=$OPENSEARCH_VERSION" >> $GITHUB_ENV
- name: Check out plugin repo
if: ${{ matrix.entry.repo != 'OpenSearch' }}
uses: actions/checkout@v3
with:
repository: opensearch-project/${{ matrix.entry.repo }}
ref: ${{ matrix.branch }}
- name: Increment Version in ${{ matrix.entry.repo }}
if: ${{ matrix.entry.repo != 'OpenSearch' }}
run: |
echo "OpenSearch Core repo version on branch ${{ matrix.branch }} is ${{ env.OPENSEARCH_VERSION_NUMBER }}"
if [ ${{ matrix.entry.path }} ]; then
Expand Down Expand Up @@ -109,7 +113,7 @@ jobs:
repo: "${{ matrix.entry.repo }}",
name: labelName,
color: randomColor,
description: "Issues targeting release ${{labelName}}"
description: "Issues targeting release " + labelName
};
await github.rest.issues.createLabel(newLabel);
labelFound = true;
Expand All @@ -120,6 +124,7 @@ jobs:
console.log(labelFound);
return labelFound
- name: Create Pull Request
if: ${{ matrix.entry.repo != 'OpenSearch' }}
id: cpr
uses: peter-evans/create-pull-request@v4
with:
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/osd-increment-plugin-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
fail-fast: false
matrix:
entry:
# Adding the core repo OpenSearch-Dashboards for the label creation automation
- {repo: OpenSearch-Dashboards}
- {repo: dashboards-observability}
- {repo: dashboards-reporting}
- {repo: dashboards-visualizations, path: gantt-chart}
Expand Down Expand Up @@ -50,6 +52,7 @@ jobs:
ref: ${{ matrix.branch }}
path: OpenSearch-Dashboards
- name: Check out plugin repo
if: ${{ matrix.entry.repo != 'OpenSearch-Dashboards' }}
uses: actions/checkout@v3
with:
repository: opensearch-project/${{ matrix.entry.repo }}
Expand All @@ -60,18 +63,19 @@ jobs:
with:
node-version-file: './OpenSearch-Dashboards/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Install Yarn
- name: Install Yarn and Setup Dashboard Version
shell: bash
run: |
YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
DASHBOARD_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').version")
echo "DASHBOARD_VERSION=$DASHBOARD_VERSION" >> $GITHUB_ENV
- run: node -v
- run: yarn -v
- name: Bootstrap and Version Increment
if: ${{ matrix.entry.repo != 'OpenSearch-Dashboards' }}
run: |
DASHBOARD_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').version")
echo "DASHBOARD_VERSION=$DASHBOARD_VERSION" >> $GITHUB_ENV
cd OpenSearch-Dashboards/plugins/${{ matrix.entry.repo }}
if [ ${{ matrix.entry.path }} ]; then
yarn osd bootstrap
Expand All @@ -85,7 +89,7 @@ jobs:
cd ${{ matrix.entry.repo }}/
# tmp `elif` solution for opensearch-dashboards-functional-test (ref: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1801#issuecomment-1545947935)
elif [ ${{ matrix.entry.repo }} == "opensearch-dashboards-functional-test" ]; then
jq --arg DASHBOARD_VERSION "$DASHBOARD_VERSION" '.version = $DASHBOARD_VERSION' package.json > package-tmp.json
jq --arg DASHBOARD_VERSION "${{ env.DASHBOARD_VERSION }}" '.version = ${{ env.DASHBOARD_VERSION }}' package.json > package-tmp.json
mv package-tmp.json package.json
OSD_PLUGIN_VERSION=$(node -p "require('./package.json').version")
echo "OSD_PLUGIN_VERSION=$OSD_PLUGIN_VERSION" >> $GITHUB_ENV
Expand Down Expand Up @@ -126,7 +130,7 @@ jobs:
repo: "${{ matrix.entry.repo }}",
name: labelName,
color: randomColor,
description: "Issues targeting release ${{labelName}}"
description: "Issues targeting release " + labelName
};
await github.rest.issues.createLabel(newLabel);
labelFound = true;
Expand All @@ -137,6 +141,7 @@ jobs:
console.log(labelFound);
return labelFound
- name: Create Pull Request
if: ${{ matrix.entry.repo != 'OpenSearch-Dashboards' }}
id: cpr
uses: peter-evans/create-pull-request@v5
with:
Expand Down

0 comments on commit 5e10028

Please sign in to comment.