forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into main-opentelemetry
Signed-off-by: suraj kumar <surajkumar.tu@gmail.com>
- Loading branch information
Showing
143 changed files
with
4,504 additions
and
590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Close Stalled PRs | ||
on: | ||
schedule: | ||
- cron: '15 15 * * *' # Run every day at 15:15 UTC / 7:15 PST / 8:15 PDT | ||
permissions: | ||
pull-requests: write | ||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: GitHub App token | ||
id: github_app_token | ||
uses: tibdex/github-app-token@v1.5.0 | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
installation_id: 22958780 | ||
- name: Stale PRs | ||
uses: actions/stale@v8 | ||
with: | ||
repo-token: ${{ steps.github_app_token.outputs.token }} | ||
stale-pr-label: 'stalled' | ||
stale-pr-message: 'This PR is stalled because it has been open for 30 days with no activity. Remove stalled label or comment or this will be closed in 7 days.' | ||
close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.' | ||
days-before-pr-stale: 30 | ||
days-before-pr-close: 7 | ||
days-before-issue-stale: -1 | ||
days-before-issue-close: -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
buildSrc/src/main/groovy/org/opensearch/gradle/CheckCompatibilityTask.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.gradle | ||
|
||
import groovy.json.JsonSlurper | ||
import org.ajoberstar.grgit.Grgit | ||
import org.ajoberstar.grgit.operation.BranchListOp | ||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.tasks.Input | ||
import org.gradle.api.tasks.Internal | ||
import org.gradle.api.tasks.TaskAction | ||
import org.gradle.internal.os.OperatingSystem | ||
|
||
import java.nio.file.Paths | ||
|
||
class CheckCompatibilityTask extends DefaultTask { | ||
|
||
static final String REPO_URL = 'https://raw.githubusercontent.com/opensearch-project/opensearch-plugins/main/plugins/.meta' | ||
|
||
@Input | ||
List repositoryUrls = project.hasProperty('repositoryUrls') ? project.property('repositoryUrls').split(',') : getRepoUrls() | ||
|
||
@Input | ||
String ref = project.hasProperty('ref') ? project.property('ref') : 'main' | ||
|
||
@Internal | ||
List failedComponents = [] | ||
|
||
@Internal | ||
List gitFailedComponents = [] | ||
|
||
@Internal | ||
List compatibleComponents = [] | ||
|
||
@TaskAction | ||
void checkCompatibility() { | ||
logger.info("Checking compatibility for: $repositoryUrls for $ref") | ||
repositoryUrls.parallelStream().forEach { repositoryUrl -> | ||
def tempDir = File.createTempDir() | ||
try { | ||
if (cloneAndCheckout(repositoryUrl, tempDir)) { | ||
if (repositoryUrl.toString().endsWithAny('notifications', 'notifications.git')) { | ||
tempDir = Paths.get(tempDir.getAbsolutePath(), 'notifications') | ||
} | ||
project.exec { | ||
workingDir = tempDir | ||
def stdout = new ByteArrayOutputStream() | ||
executable = (OperatingSystem.current().isWindows()) ? 'gradlew.bat' : './gradlew' | ||
args 'assemble' | ||
standardOutput stdout | ||
} | ||
compatibleComponents.add(repositoryUrl) | ||
} else { | ||
logger.lifecycle("Skipping compatibility check for $repositoryUrl") | ||
} | ||
} catch (ex) { | ||
failedComponents.add(repositoryUrl) | ||
logger.info("Gradle assemble failed for $repositoryUrl", ex) | ||
} finally { | ||
tempDir.deleteDir() | ||
} | ||
} | ||
if (!failedComponents.isEmpty()) { | ||
logger.lifecycle("Incompatible components: $failedComponents") | ||
logger.info("Compatible components: $compatibleComponents") | ||
} | ||
if (!gitFailedComponents.isEmpty()) { | ||
logger.lifecycle("Components skipped due to git failures: $gitFailedComponents") | ||
logger.info("Compatible components: $compatibleComponents") | ||
} | ||
if (!compatibleComponents.isEmpty()) { | ||
logger.lifecycle("Compatible components: $compatibleComponents") | ||
} | ||
} | ||
|
||
protected static List getRepoUrls() { | ||
def json = new JsonSlurper().parse(REPO_URL.toURL()) | ||
def labels = json.projects.values() | ||
return labels as List | ||
} | ||
|
||
protected boolean cloneAndCheckout(repoUrl, directory) { | ||
try { | ||
def grgit = Grgit.clone(dir: directory, uri: repoUrl) | ||
def remoteBranches = grgit.branch.list(mode: BranchListOp.Mode.REMOTE) | ||
String targetBranch = 'origin/' + ref | ||
if (remoteBranches.find { it.name == targetBranch } == null) { | ||
gitFailedComponents.add(repoUrl) | ||
logger.info("$ref does not exist for $repoUrl. Skipping the compatibility check!!") | ||
return false | ||
} else { | ||
logger.info("Checking out $targetBranch") | ||
grgit.checkout(branch: targetBranch) | ||
return true | ||
} | ||
} catch (ex) { | ||
logger.error('Exception occurred during GitHub operations', ex) | ||
gitFailedComponents.add(repoUrl) | ||
return false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
modules/transport-netty4/licenses/netty-buffer-4.1.93.Final.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
modules/transport-netty4/licenses/netty-buffer-4.1.94.Final.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eec248b26f16e888688e5bb37b7eeda76b78d2f7 |
1 change: 0 additions & 1 deletion
1
modules/transport-netty4/licenses/netty-codec-4.1.93.Final.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
modules/transport-netty4/licenses/netty-codec-4.1.94.Final.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
c70ef20ca338558147887df60f46341bc47f6900 |
1 change: 0 additions & 1 deletion
1
modules/transport-netty4/licenses/netty-codec-http-4.1.93.Final.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
modules/transport-netty4/licenses/netty-codec-http-4.1.94.Final.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9e5404764092c1f6305ad5719078f46ab228d587 |
1 change: 0 additions & 1 deletion
1
modules/transport-netty4/licenses/netty-codec-http2-4.1.93.Final.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
modules/transport-netty4/licenses/netty-codec-http2-4.1.94.Final.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
f651595784d6cca4cbca6a8ad74c48fceed6cea8 |
1 change: 0 additions & 1 deletion
1
modules/transport-netty4/licenses/netty-common-4.1.93.Final.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
modules/transport-netty4/licenses/netty-common-4.1.94.Final.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ad4ecf779ebc794cd351f57792f56ea01387b868 |
1 change: 0 additions & 1 deletion
1
modules/transport-netty4/licenses/netty-handler-4.1.93.Final.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
modules/transport-netty4/licenses/netty-handler-4.1.94.Final.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cd9121ce24d6d3f2898946d04b0ef3ec548b00b4 |
1 change: 0 additions & 1 deletion
1
modules/transport-netty4/licenses/netty-resolver-4.1.93.Final.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
modules/transport-netty4/licenses/netty-resolver-4.1.94.Final.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
e96f649e8e9dcb29a1f8e95328b99c9eb6cf76c2 |
1 change: 0 additions & 1 deletion
1
modules/transport-netty4/licenses/netty-transport-4.1.93.Final.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
modules/transport-netty4/licenses/netty-transport-4.1.94.Final.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ec783a737f96991a87b1d5794e2f9eb2024d708a |
1 change: 0 additions & 1 deletion
1
modules/transport-netty4/licenses/netty-transport-native-unix-common-4.1.93.Final.jar.sha1
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
modules/transport-netty4/licenses/netty-transport-native-unix-common-4.1.94.Final.jar.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3fa5f9d04b6b782d869d6e0657d896eeadca5866 |
Oops, something went wrong.