Skip to content

Commit

Permalink
Merge branch 'main' into npe-master
Browse files Browse the repository at this point in the history
  • Loading branch information
Anshu Agarwal committed Feb 12, 2024
2 parents e1da3a0 + 4dc5f49 commit 9e8c874
Show file tree
Hide file tree
Showing 767 changed files with 19,662 additions and 3,753 deletions.
1 change: 1 addition & 0 deletions .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ BWC_VERSION:
- "2.11.1"
- "2.11.2"
- "2.12.0"
- "2.13.0"
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ✨ Meta Issue
description: An issue that collects other issues together to describe a larger project or activity.
title: '[META] <title>'
labels: ['Meta, untriaged']
body:
- type: textarea
attributes:
label: Please describe the end goal of this project
description: A clear and concise description of this project/endeavor. This should be understandable to someone with no context.
placeholder: Ex. Views is a way to project indices in OpenSearch, these views act as a focal point for describing the underlying data and how the data is accessed. It allows for restricting the scope and filtering the response consistently.
validations:
required: true
- type: textarea
attributes:
label: Supporting References
description: Please provide links (and descriptions!) to RFCs, design docs, etc
validations:
required: true
- type: textarea
attributes:
label: Issues
description: Please create a list of issues that should be tracked by this meta issue, including a short description. The purpose is to provide everyone on the project with an "at a glance" update of the state us the work being tracked. If you use the format "- [ ]" it will put your list into a checklist.
placeholder: Ex. - [ ] https://github.com/opensearch-project/security/issues/3888 Add views to the cluster metadata schema
validations:
required: true



2 changes: 1 addition & 1 deletion .github/workflows/create-documentation-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Create Issue From File
id: create-issue
uses: peter-evans/create-issue-from-file@v4
uses: peter-evans/create-issue-from-file@v5
with:
title: Add documentation related to new feature
content-filepath: ./ci/documentation/issue.md
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- name: lychee Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1.9.0
uses: lycheeverse/lychee-action@v1.9.1
with:
args: --accept=200,403,429 --exclude-mail **/*.html **/*.md **/*.txt **/*.json --exclude-file .lychee.excludes
fail: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maintainer-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- id: find-maintainers
uses: actions/github-script@v7
uses: actions/github-script@v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: github.repository == 'opensearch-project/OpenSearch'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
- uses: actions/github-script@v7.0.1
with:
script: |
const { issue, repository } = context.payload;
Expand Down
109 changes: 69 additions & 40 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
name: Increment Version

on:
workflow_dispatch:
inputs:
tag:
description: 'the tag'
required: true
type: string
push:
tags:
- '*.*.*'

permissions: {}
permissions:
contents: write
issues: write
pull-requests: write

jobs:
build:
if: github.repository == 'opensearch-project/OpenSearch'
runs-on: ubuntu-latest
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780

- uses: actions/checkout@v4
- name: Fetch Tag and Version Information
- name: Fetch tag and version information
run: |
TAG=$(echo "${GITHUB_REF#refs/*/}")
if [ -n ${{ github.event.inputs.tag }} ]; then
TAG=${{ github.event.inputs.tag }}
fi
CURRENT_VERSION_ARRAY=($(echo "$TAG" | tr . '\n'))
BASE=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:2}")
BASE_X=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:1}.x")
Expand All @@ -44,24 +48,22 @@ jobs:
echo "NEXT_VERSION=$NEXT_VERSION" >> $GITHUB_ENV
echo "NEXT_VERSION_UNDERSCORE=$NEXT_VERSION_UNDERSCORE" >> $GITHUB_ENV
echo "NEXT_VERSION_ID=$NEXT_VERSION_ID" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
ref: ${{ env.BASE }}
token: ${{ steps.github_app_token.outputs.token }}

- name: Increment Patch Version
run: |
echo Incrementing $CURRENT_VERSION to $NEXT_VERSION
echo " - \"$CURRENT_VERSION\"" >> .ci/bwcVersions
sed -i "s/opensearch = $CURRENT_VERSION/opensearch = $NEXT_VERSION/g" buildSrc/version.properties
echo Adding $NEXT_VERSION_UNDERSCORE after $CURRENT_VERSION_UNDERSCORE
sed -i "s/public static final Version $CURRENT_VERSION_UNDERSCORE = new Version(\([[:digit:]]\+\)\(.*\));/\0\n public static final Version $NEXT_VERSION_UNDERSCORE = new Version($NEXT_VERSION_ID\2);/g" libs/core/src/main/java/org/opensearch/Version.java
sed -i "s/CURRENT = $CURRENT_VERSION_UNDERSCORE;/CURRENT = $NEXT_VERSION_UNDERSCORE;/g" libs/core/src/main/java/org/opensearch/Version.java
- name: Increment Patch Version on Major.Minor branch
uses: peternied/opensearch-core-version-updater@v1
with:
previous-version: ${{ env.CURRENT_VERSION }}
new-version: ${{ env.NEXT_VERSION }}
update-current: true

- name: Create Pull Request
- name: Create PR for BASE
id: base_pr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ steps.github_app_token.outputs.token }}
base: ${{ env.BASE }}
branch: 'create-pull-request/patch-${{ env.BASE }}'
commit-message: Increment version to ${{ env.NEXT_VERSION }}
Expand All @@ -76,19 +78,18 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ env.BASE_X }}
token: ${{ steps.github_app_token.outputs.token }}

- name: Add bwc version to .X branch
run: |
echo Adding bwc version $NEXT_VERSION after $CURRENT_VERSION
sed -i "s/- \"$CURRENT_VERSION\"/\0\n - \"$NEXT_VERSION\"/g" .ci/bwcVersions
echo Adding $NEXT_VERSION_UNDERSCORE after $CURRENT_VERSION_UNDERSCORE
sed -i "s/public static final Version $CURRENT_VERSION_UNDERSCORE = new Version(\([[:digit:]]\+\)\(.*\));/\0\n public static final Version $NEXT_VERSION_UNDERSCORE = new Version($NEXT_VERSION_ID\2);/g" libs/core/src/main/java/org/opensearch/Version.java
- name: Add Patch Version on Major.X branch
uses: peternied/opensearch-core-version-updater@v1
with:
previous-version: ${{ env.CURRENT_VERSION }}
new-version: ${{ env.NEXT_VERSION }}
update-current: false

- name: Create Pull Request
- name: Create PR for BASE_X
id: base_x_pr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ steps.github_app_token.outputs.token }}
base: ${{ env.BASE_X }}
branch: 'create-pull-request/patch-${{ env.BASE_X }}'
commit-message: Add bwc version ${{ env.NEXT_VERSION }}
Expand All @@ -103,19 +104,18 @@ jobs:
- uses: actions/checkout@v4
with:
ref: main
token: ${{ steps.github_app_token.outputs.token }}

- name: Add bwc version to main branch
run: |
echo Adding bwc version $NEXT_VERSION after $CURRENT_VERSION
sed -i "s/- \"$CURRENT_VERSION\"/\0\n - \"$NEXT_VERSION\"/g" .ci/bwcVersions
echo Adding $NEXT_VERSION_UNDERSCORE after $CURRENT_VERSION_UNDERSCORE
sed -i "s/public static final Version $CURRENT_VERSION_UNDERSCORE = new Version(\([[:digit:]]\+\)\(.*\));/\0\n public static final Version $NEXT_VERSION_UNDERSCORE = new Version($NEXT_VERSION_ID\2);/g" libs/core/src/main/java/org/opensearch/Version.java
- name: Add Patch Version on main branch
uses: peternied/opensearch-core-version-updater@v1
with:
previous-version: ${{ env.CURRENT_VERSION }}
new-version: ${{ env.NEXT_VERSION }}
update-current: false

- name: Create Pull Request
- name: Create PR for main
id: main_pr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ steps.github_app_token.outputs.token }}
base: main
branch: 'create-pull-request/patch-main'
commit-message: Add bwc version ${{ env.NEXT_VERSION }}
Expand All @@ -126,3 +126,32 @@ jobs:
title: '[AUTO] [main] Add bwc version ${{ env.NEXT_VERSION }}.'
body: |
I've noticed that a new tag ${{ env.TAG }} was pushed, and added a bwc version ${{ env.NEXT_VERSION }}.
- name: Create tracking issue
id: create-issue
uses: actions/github-script@v7.0.1
with:
script: |
const body = `
### Description
A new version of OpenSearch was released, to prepare for the next release new version numbers need to be updated in all active branches of development.
### Exit Criteria
Review and merged the following pull requests
- [ ] ${{ steps.base_pr.outputs.pull-request-url }}
- [ ] ${{ steps.base_x_pr.outputs.pull-request-url }}
- [ ] ${{ steps.main_pr.outputs.pull-request-url }}
### Additional Context
See project wide guidance on branching and versions [[link]](https://github.com/opensearch-project/.github/blob/main/RELEASING.md).
`
const { data: issue }= await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["Build"],
title: "Increment version for ${{ env.NEXT_VERSION }}",
body: body
});
console.error(JSON.stringify(issue));
return issue.number;
result-encoding: string
Loading

0 comments on commit 9e8c874

Please sign in to comment.