Skip to content

Commit

Permalink
Move all release jenkins workflows under one folder (#4882)
Browse files Browse the repository at this point in the history
Signed-off-by: Sayali Gaikawad <[email protected]>
  • Loading branch information
gaiksaya authored Jul 23, 2024
1 parent 23250f6 commit b1a56f2
Show file tree
Hide file tree
Showing 24 changed files with 27 additions and 371 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/jenkins/TestOpenSearchReleasePromotionTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class TestOpenSearchReleasePromotionTest extends BuildPipelineTest {

@Test
void shouldExecuteWithoutErrors() {
super.testPipeline('jenkins/promotion/release-promotion.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/promotion/release-promotion.jenkinsfile')
super.testPipeline('jenkins/release-workflows/release-promotion.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/release-promotion.jenkinsfile')

def callStack = helper.getCallStack()
// Parameters Check
Expand Down Expand Up @@ -202,7 +202,7 @@ class TestOpenSearchReleasePromotionTest extends BuildPipelineTest {

@Test
void verifyCfnCommands() {
runScript('jenkins/promotion/release-promotion.jenkinsfile')
runScript('jenkins/release-workflows/release-promotion.jenkinsfile')
def callStack = helper.getCallStack()
assertCallStack().contains(
'release-promotion.cfInvalidate({distribution=CLOUDFRONT_DISTRIBUTION_ID, paths=[/releases/bundle/opensearch/1.x/*, /releases/bundle/opensearch-dashboards/1.x/*], waitForCompletion=true})'
Expand Down
12 changes: 6 additions & 6 deletions tests/jenkins/TestReleaseBranch.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ class TestReleaseBranch extends BuildPipelineTest {

@Test
public void testBranchCreation() {
super.testPipeline('jenkins/release-branch/release-branch.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-branch/release-branch-buildmanifest.jenkinsfile')
super.testPipeline('jenkins/release-workflows/release-branch.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/release-branch-buildmanifest.jenkinsfile')
}

@Test
public void testBranchExistence() {
helper.addShMock("""git ls-remote https://github.com/opensearch-project/OpenSearch.git 2.11""") { script ->
return [stdout: "ref/2.11", exitValue: 0]
}
runScript('jenkins/release-branch/release-branch.jenkinsfile')
runScript('jenkins/release-workflows/release-branch.jenkinsfile')
assertThat(getCommandExecutions('echo', ''), hasItem('Branch already exists, skipping branch creation for the repo https://github.com/opensearch-project/OpenSearch.git'))
}

Expand All @@ -94,15 +94,15 @@ class TestReleaseBranch extends BuildPipelineTest {
return [stdout: "", exitValue: 0]
}

super.testPipeline('jenkins/release-branch/release-branch.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-branch/release-branch-inputmanifest.jenkinsfile')
super.testPipeline('jenkins/release-workflows/release-branch.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/release-branch-inputmanifest.jenkinsfile')
}

@Test
public void testVerifyParameters() {
binding.setVariable('MANIFEST_FILE', "")
binding.setVariable('TARGET_BRANCH', "")
runScript('jenkins/release-branch/release-branch.jenkinsfile')
runScript('jenkins/release-workflows/release-branch.jenkinsfile')
assertThat(getCommandExecutions('error', ''), hasItem('Required parameters are missing. Please provide the mandatory arguments MANIFEST_FILE, SOURCE_BRANCH and TARGET_BRANCH'))
}

Expand Down
28 changes: 14 additions & 14 deletions tests/jenkins/TestReleaseManifestCommitLock.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class TestReleaseManifestCommitLock extends BuildPipelineTest {
@Test
public void testManifestCommitLock_matchBuildManifest() {
addParam('MANIFEST_LOCK_ACTION', 'MATCH_BUILD_MANIFEST')
super.testPipeline('jenkins/release-manifest-commit-lock/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-manifest-commit-lock/testManifestCommitLock_matchBuildManifest')
super.testPipeline('jenkins/release-workflows/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/testManifestCommitLock_matchBuildManifest')
def callStack = helper.getCallStack()
assertCallStack().contains('stage(Parameters Check, groovy.lang.Closure)')
assertCallStack().contains('stage(MATCH_BUILD_MANIFEST, groovy.lang.Closure)')
Expand All @@ -59,8 +59,8 @@ class TestReleaseManifestCommitLock extends BuildPipelineTest {
@Test
public void testManifestCommitLock_updateToRecentCommits() {
addParam('MANIFEST_LOCK_ACTION', 'UPDATE_TO_RECENT_COMMITS')
super.testPipeline('jenkins/release-manifest-commit-lock/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-manifest-commit-lock/testManifestCommitLock_updateToRecentCommits')
super.testPipeline('jenkins/release-workflows/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/testManifestCommitLock_updateToRecentCommits')
def callStack = helper.getCallStack()
assertCallStack().contains('stage(Parameters Check, groovy.lang.Closure)')
assertCallStack().contains('stage(UPDATE_TO_RECENT_COMMITS, groovy.lang.Closure)')
Expand All @@ -69,8 +69,8 @@ class TestReleaseManifestCommitLock extends BuildPipelineTest {
@Test
public void testManifestCommitLock_updateToTags() {
addParam('MANIFEST_LOCK_ACTION', 'UPDATE_TO_TAGS')
super.testPipeline('jenkins/release-manifest-commit-lock/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-manifest-commit-lock/testManifestCommitLock_updateToTags')
super.testPipeline('jenkins/release-workflows/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/testManifestCommitLock_updateToTags')
def callStack = helper.getCallStack()
assertCallStack().contains('stage(Parameters Check, groovy.lang.Closure)')
assertCallStack().contains('stage(UPDATE_TO_TAGS, groovy.lang.Closure)')
Expand All @@ -81,8 +81,8 @@ class TestReleaseManifestCommitLock extends BuildPipelineTest {

@Test
public void testManifestCommitLock_createPullRequest() {
super.testPipeline('jenkins/release-manifest-commit-lock/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-manifest-commit-lock/testManifestCommitLock_createPullRequest')
super.testPipeline('jenkins/release-workflows/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/testManifestCommitLock_createPullRequest')
assertThat(getShellCommands('git'), hasItem("\n git remote set-url origin \"https://opensearch-ci:[email protected]/opensearch-project/opensearch-build\"\n git config user.email \"[email protected]\"\n git config user.name \"opensearch-ci\"\n git checkout -b manifest-lock\n "))
assertThat(getShellCommands('git'), hasItem("\n git status --porcelain | grep '^ M' | cut -d \" \" -f3 | xargs git add\n git commit -sm \"Manifest Commit Lock for Release 2.0.0\"\n git push origin manifest-lock --force\n gh pr create --title '[2.0.0] Manifest Commit Lock with action MATCH_BUILD_MANIFEST' --body 'Manifest Commit Lock for Release 2.0.0 ' -H manifest-lock -B main\n "))
}
Expand All @@ -93,8 +93,8 @@ class TestReleaseManifestCommitLock extends BuildPipelineTest {
helper.addShMock("""git ls-remote https://github.com/opensearch-project/OpenSearch.git 2.0""") { script ->
return [stdout: "", exitValue: 0]
}
super.testPipeline('jenkins/release-manifest-commit-lock/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-manifest-commit-lock/testUpdateToRecentCommit')
super.testPipeline('jenkins/release-workflows/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/testUpdateToRecentCommit')
assertCallStack().contains('release-manifest-commit-lock.readYaml({file=manifests/2.0.0/opensearch-dashboards-2.0.0.yml})')
assertCallStack().contains('release-manifest-commit-lock.readYaml({file=manifests/2.0.0/opensearch-dashboards-2.0.0.yml})')
assertCallStack().contains('release-manifest-commit-lock.sh({script=git ls-remote https://github.com/opensearch-project/OpenSearch.git 2.0 | cut -f 1, returnStdout=true})')
Expand All @@ -110,8 +110,8 @@ class TestReleaseManifestCommitLock extends BuildPipelineTest {
helper.registerAllowedMethod('readYaml', [Map.class], { args ->
return new Yaml().load((buildManifest as File).text)
})
super.testPipeline('jenkins/release-manifest-commit-lock/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-manifest-commit-lock/testMatchBuildManifest')
super.testPipeline('jenkins/release-workflows/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/testMatchBuildManifest')
assertThat(getShellCommands('curl'), hasItem("{script=curl -sSL https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.0.0/3813/linux/x64/tar/dist/opensearch/manifest.yml, returnStdout=true}"))
assertCallStack().contains("release-manifest-commit-lock.writeYaml({file=manifests/2.0.0/opensearch-dashboards-2.0.0.yml, data={schema-version=1.1, build={name=OpenSearch, version=2.0.0, platform=linux, architecture=x64, distribution=tar, location=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.0.0/3813/linux/x64/tar/dist/opensearch/opensearch-2.0.0-linux-x64.tar.gz, id=3813}, components=[{name=OpenSearch, repository=https://github.com/opensearch-project/OpenSearch.git, ref=bae3b4e4178c20ac24fece8e82099abe3b2630d0, commit_id=bae3b4e4178c20ac24fece8e82099abe3b2630d0, location=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.0.0/3813/linux/x64/tar/builds/opensearch/dist/opensearch-min-2.0.0-linux-x64.tar.gz}, {name=common-utils, repository=https://github.com/opensearch-project/common-utils.git, ref=2.0, commit_id=e59ea173af31fd468ce443fc4022649cad306e36}, {name=job-scheduler, repository=https://github.com/opensearch-project/job-scheduler.git, ref=2.0, commit_id=b5b21097894ecec7a78da622ee96763908b32898, location=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.0.0/3813/linux/x64/tar/builds/opensearch/plugins/opensearch-job-scheduler-2.0.0.0.zip}, {name=ml-commons, repository=https://github.com/opensearch-project/ml-commons.git, ref=2.0, commit_id=5c6e4bd4d996cf2d0a9726e1537ef98822d1795f, location=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.0.0/3813/linux/x64/tar/builds/opensearch/plugins/opensearch-ml-2.0.0.0.zip}]}, overwrite=true})")
assertCallStack().contains("release-manifest-commit-lock.writeYaml(")
Expand All @@ -125,8 +125,8 @@ class TestReleaseManifestCommitLock extends BuildPipelineTest {
helper.registerAllowedMethod('readYaml', [Map.class], { args ->
return new Yaml().load((buildManifest as File).text)
})
super.testPipeline('jenkins/release-manifest-commit-lock/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-manifest-commit-lock/testUpdateToRecentCommit_excludeFTRepo')
super.testPipeline('jenkins/release-workflows/release-manifest-commit-lock.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/release-workflows/testUpdateToRecentCommit_excludeFTRepo')
// The test asserts that FT repo uses the release branch
assertCallStack().contains("release-manifest-commit-lock.writeYaml({file=manifests/2.0.0/opensearch-dashboards-2.0.0.yml, data={ci={image={name=opensearchstaging/ci-runner:centos7-x64-arm64-jdkmulti-node10.24.1-cypress6.9.1-20211028}}, build={name=OpenSearch Dashboards, version=3.0.0}, components=[{name=OpenSearch-Dashboards, ref=tags/3.0.0, repository=https://github.com/opensearch-project/OpenSearch-Dashboards.git}, {name=functionalTestDashboards, repository=https://github.com/opensearch-project/opensearch-dashboards-functional-test.git, ref=3.0}, {name=observabilityDashboards, ref=tags/3.0.0, repository=https://github.com/opensearch-project/dashboards-observability.git}, {name=indexManagementDashboards, ref=tags/3.0.0, repository=https://github.com/opensearch-project/index-management-dashboards-plugin}, {name=ganttChartDashboards, ref=tags/3.0.0, repository=https://github.com/opensearch-project/dashboards-visualizations.git}, {name=reportsDashboards, ref=tags/3.0.0, repository=https://github.com/opensearch-project/dashboards-reports.git}, {name=queryWorkbenchDashboards, ref=tags/3.0.0, repository=https://github.com/opensearch-project/sql.git}, {name=anomalyDetectionDashboards, ref=tags/3.0.0, repository=https://github.com/opensearch-project/anomaly-detection-dashboards-plugin}], schema-version=1.0}, overwrite=true})")
}
Expand Down
8 changes: 4 additions & 4 deletions tests/jenkins/TestReleaseNotesCheckAndCompile.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class TestReleaseNotesCheckAndCompile extends BuildPipelineTest {
addParam('GIT_ISSUE_NUMBER', gitIssueNumber)
addParam('COMMENT_UNIQUE_ID', commentUniqueID)

super.testPipeline("jenkins/release-notes-check/release-notes-check.jenkinsfile",
"tests/jenkins/jenkinsjob-regression-files/release-notes-check/release-notes-check.jenkinsfile")
super.testPipeline("jenkins/release-workflows/release-notes-check.jenkinsfile",
"tests/jenkins/jenkinsjob-regression-files/release-workflows/release-notes-check.jenkinsfile")
assertJobStatusSuccess()
def callStack = helper.getCallStack()
assertCallStack().contains('Check release notes, groovy.lang.Closure')
Expand All @@ -66,8 +66,8 @@ class TestReleaseNotesCheckAndCompile extends BuildPipelineTest {
@Test
public void releaseNotesCompile() {
addParam('ACTION', 'compile')
super.testPipeline("jenkins/release-notes-check/release-notes-check.jenkinsfile",
"tests/jenkins/jenkinsjob-regression-files/release-notes-check/release-notes-compile.jenkinsfile")
super.testPipeline("jenkins/release-workflows/release-notes-check.jenkinsfile",
"tests/jenkins/jenkinsjob-regression-files/release-workflows/release-notes-compile.jenkinsfile")
assertJobStatusSuccess()
def callStack = helper.getCallStack()
assertCallStack().contains('Skipping stage Check release notes')
Expand Down

This file was deleted.

Loading

0 comments on commit b1a56f2

Please sign in to comment.