-
Notifications
You must be signed in to change notification settings - Fork 27
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 tuples-join-console-lib
- Loading branch information
Showing
102 changed files
with
2,239 additions
and
1,395 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,40 @@ | ||
name: Jenkins | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'backport/**' | ||
- 'dependabot/**' | ||
pull_request_target: | ||
types: [opened, synchronize, reopened] | ||
|
||
env: | ||
python-version: '3.11' | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
rfs-e2e-aws-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Determine Github repository and branch | ||
id: determine-repo-vars | ||
run: | | ||
if [[ "${GITHUB_EVENT_NAME}" == "pull_request_target" ]]; then | ||
branch_name="${{ github.event.pull_request.head.ref }}" | ||
pr_repo_url="https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git" | ||
else | ||
branch_name="${{ github.ref_name }}" | ||
pr_repo_url="https://github.com/${{ github.repository }}.git" | ||
fi | ||
echo "Running jenkins test on repo: $pr_repo_url and branch: $branch_name" | ||
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT | ||
echo "pr_repo_url=$pr_repo_url" >> $GITHUB_OUTPUT | ||
- name: Jenkins Job Trigger and Monitor | ||
uses: lewijacn/jenkins-trigger@1.0.4 | ||
with: | ||
jenkins_url: "https://migrations.ci.opensearch.org" | ||
job_name: "rfs-default-e2e-test" | ||
api_token: "${{ secrets.JENKINS_MIGRATIONS_GENERIC_WEBHOOK_TOKEN }}" | ||
job_params: "GIT_REPO_URL=${{ steps.determine-repo-vars.outputs.pr_repo_url }},GIT_BRANCH=${{ steps.determine-repo-vars.outputs.branch_name }}" |
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
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
15 changes: 15 additions & 0 deletions
15
MetadataMigration/src/main/java/org/opensearch/migrations/cli/Format.java
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,15 @@ | ||
package org.opensearch.migrations.cli; | ||
|
||
import lombok.experimental.UtilityClass; | ||
|
||
/** Shared formatting for command line interface components */ | ||
@UtilityClass | ||
public class Format { | ||
|
||
private static final String INDENT = " "; | ||
|
||
/** Indents to a given level for printing to the console */ | ||
public static String indentToLevel(final int level) { | ||
return INDENT.repeat(level); | ||
} | ||
} |
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
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
22 changes: 22 additions & 0 deletions
22
MetadataMigration/src/main/java/org/opensearch/migrations/commands/MigrationItemResult.java
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 |
---|---|---|
@@ -1,10 +1,32 @@ | ||
package org.opensearch.migrations.commands; | ||
|
||
import org.apache.logging.log4j.util.Strings; | ||
|
||
import org.opensearch.migrations.cli.Clusters; | ||
import org.opensearch.migrations.cli.Format; | ||
import org.opensearch.migrations.cli.Items; | ||
|
||
/** All shared cli result information */ | ||
public interface MigrationItemResult extends Result { | ||
Clusters getClusters(); | ||
Items getItems(); | ||
|
||
default String asCliOutput() { | ||
var sb = new StringBuilder(); | ||
if (getClusters() != null) { | ||
sb.append(getClusters().asCliOutput() + System.lineSeparator()); | ||
} | ||
if (getItems() != null) { | ||
sb.append(getItems().asCliOutput() + System.lineSeparator()); | ||
} | ||
sb.append("Results:" + System.lineSeparator()); | ||
if (Strings.isNotBlank(getErrorMessage())) { | ||
sb.append(Format.indentToLevel(1) + "Issue(s) detected" + System.lineSeparator()); | ||
sb.append("Issues:" + System.lineSeparator()); | ||
sb.append(Format.indentToLevel(1) + getErrorMessage() + System.lineSeparator()); | ||
} else { | ||
sb.append(Format.indentToLevel(1) + getExitCode() + " issue(s) detected" + System.lineSeparator()); | ||
} | ||
return sb.toString(); | ||
} | ||
} |
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
Oops, something went wrong.