Skip to content

Commit

Permalink
Merge pull request openshift#14537 from openshift-cherrypick-robot/ch…
Browse files Browse the repository at this point in the history
…erry-pick-14512-to-release-4.16

[release-4.16] OCPBUGS-45015: Remove ClusterTask dependency in console from Pipelines 1.17
  • Loading branch information
openshift-merge-bot[bot] authored Dec 2, 2024
2 parents 7f4e311 + c304872 commit d54ed47
Show file tree
Hide file tree
Showing 27 changed files with 1,112 additions and 279 deletions.
74 changes: 70 additions & 4 deletions frontend/packages/pipelines-plugin/console-extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[
{
"type": "console.flag/hookProvider",
"properties": {
"handler": { "$codeRef": "pipelinesComponent.useIsPipelineOperatorVersion_1_17_or_newer" }
}
},
{
"type": "console.model-metadata",
"properties": {
Expand Down Expand Up @@ -137,6 +143,9 @@
"label": "%pipelines-plugin~ClusterTask%",
"labelPlural": "%pipelines-plugin~ClusterTasks%",
"abbr": "CT"
},
"flags": {
"disallowed": ["PIPELINES_OPERATOR_VERSION_1_17_OR_NEWER"]
}
},
{
Expand Down Expand Up @@ -228,6 +237,48 @@
"badge": "dev"
}
},
{
"type": "console.model-metadata",
"properties": {
"model": {
"group": "operator.tekton.dev",
"version": "v1alpha1",
"kind": "TektonConfig"
},
"color": "#38812f",
"label": "%pipelines-plugin~TektonConfig%",
"labelPlural": "%pipelines-plugin~TektonConfigs%",
"abbr": "TC"
}
},
{
"type": "console.model-metadata",
"properties": {
"model": {
"group": "operator.tekton.dev",
"version": "v1alpha1",
"kind": "TektonHub"
},
"color": "#38812f",
"label": "%pipelines-plugin~TektonHub%",
"labelPlural": "%pipelines-plugin~TektonHubs%",
"abbr": "TH"
}
},
{
"type": "console.model-metadata",
"properties": {
"model": {
"group": "operator.tekton.dev",
"version": "v1alpha1",
"kind": "TektonResult"
},
"color": "#38812f",
"label": "%pipelines-plugin~TektonResult%",
"labelPlural": "%pipelines-plugin~TektonResults%",
"abbr": "TR"
}
},
{
"type": "console.flag/model",
"properties": {
Expand Down Expand Up @@ -407,7 +458,10 @@
"component": { "$codeRef": "tasksComponent.ClusterTaskDetailsPage" }
},
"flags": {
"disallowed": ["HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASK_DETAILS"]
"disallowed": [
"HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASK_DETAILS",
"PIPELINES_OPERATOR_VERSION_1_17_OR_NEWER"
]
}
},
{
Expand Down Expand Up @@ -632,7 +686,10 @@
"component": { "$codeRef": "tasksComponent.ClusterTaskListPage" }
},
"flags": {
"disallowed": ["HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASKS_LIST"]
"disallowed": [
"HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASKS_LIST",
"PIPELINES_OPERATOR_VERSION_1_17_OR_NEWER"
]
}
},
{
Expand All @@ -646,7 +703,10 @@
"component": { "$codeRef": "tasksComponent.ClusterTaskListPage" }
},
"flags": {
"disallowed": ["HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASKS_LIST"]
"disallowed": [
"HIDE_STATIC_PIPELINE_PLUGIN_CLUSTERTASKS_LIST",
"PIPELINES_OPERATOR_VERSION_1_17_OR_NEWER"
]
}
},
{
Expand Down Expand Up @@ -1101,6 +1161,9 @@
"version": "v1beta1"
},
"template": { "$codeRef": "yamlTemplates.newClusterTaskTemplate" }
},
"flags": {
"disallowed": ["PIPELINES_OPERATOR_VERSION_1_17_OR_NEWER"]
}
},
{
Expand All @@ -1112,7 +1175,10 @@
},
"flags": {
"required": ["OPENSHIFT_PIPELINE"],
"disallowed": ["HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_BUILDER"]
"disallowed": [
"HIDE_STATIC_PIPELINE_PLUGIN_PIPELINE_BUILDER",
"PIPELINES_OPERATOR_VERSION_1_17_OR_NEWER"
]
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ export const pipelineBuilderPage = {
},
addRedHatTask: (taskName: string) => {
cy.get(pipelineBuilderPO.formView.quickSearch).type(taskName);
cy.byTestID(`item-name-${taskName}-Red Hat`).click();
cy.get(`[data-test="item-name-${taskName}-Red Hat"]`)
.its('length')
.then((length) => {
if (length > 1) {
cy.get(`[data-test="item-name-${taskName}-Red Hat"]`).eq(1).click();
} else {
cy.get(`[data-test="item-name-${taskName}-Red Hat"]`).first().click();
}
});
cy.byTestID('task-cta').click();
},
clickAddTask: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ Given('user is at developer perspective', () => {
Given('user has created or selected namespace {string}', (projectName: string) => {
Cypress.env('NAMESPACE', projectName);
projectNameSpace.selectOrCreateProject(projectName);
cy.exec(
`oc apply -f testData/installTasksInsteadOfClusterTask.yaml -n ${Cypress.env('NAMESPACE')}`,
{
failOnNonZeroExit: false,
},
).then(function (result) {
cy.log(`STDOUT: ${result.stdout}`);
cy.log(`STDERR: ${result.stderr}`);
});
});

Given('user is at the Topology page', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ When('user enters pipeline name as {string}', (pipelineName: string) => {
pipelineBuilderPage.enterPipelineName(pipelineName);
});

When('user selects {string} from Task drop down', (taskName: string) => {
pipelineBuilderPage.selectTask(taskName);
});

When('user clicks Create button on Pipeline Builder page', () => {
pipelineBuilderPage.clickCreateButton();
});
Expand Down Expand Up @@ -178,10 +174,6 @@ When('user enters pipeline name {string}', (pipelineName: string) => {
pipelineBuilderPage.enterPipelineName(pipelineName);
});

And('user selects the first task as {string}', (task: string) => {
pipelineBuilderPage.selectTask(task);
});

And('user clicks on Add finally task', () => {
pipelineBuilderPage.addFinallyNode();
});
Expand Down Expand Up @@ -369,10 +361,6 @@ And(
},
);

When('user selects {string} from Select task list', (task: string) => {
pipelineBuilderPage.selectTask(task);
});

And('user enters pipeline name as {string}', (pipelineName: string) => {
pipelineBuilderPage.enterPipelineName(pipelineName);
});
Expand Down Expand Up @@ -539,7 +527,15 @@ When('user searches {string} in quick search bar', (searchItem: string) => {

When('user selects {string} from {string}', (taskName: string, publisher: string) => {
cy.get('[aria-label="Quick search list"]').should('be.visible');
cy.get(`[data-test="item-name-${taskName}-${publisher}"]`).click();
cy.get(`[data-test="item-name-${taskName}-${publisher}"]`)
.its('length')
.then((length) => {
if (length > 1) {
cy.get(`[data-test="item-name-${taskName}-${publisher}"]`).eq(1).click();
} else {
cy.get(`[data-test="item-name-${taskName}-${publisher}"]`).first().click();
}
});
});

When('user selects {string} from git community', () => {
Expand Down Expand Up @@ -571,7 +567,15 @@ When('user should see the Create button enabled after installation', () => {
When('user selects {string} from Add task quick search', (searchItem: string) => {
cy.byTestID('task-list').click();
cy.get(pipelineBuilderPO.formView.quickSearch).type(searchItem);
cy.byTestID(`item-name-${searchItem}-Red Hat`).click();
cy.get(`[data-test="item-name-${searchItem}-Red Hat"]`)
.its('length')
.then((length) => {
if (length > 1) {
cy.get(`[data-test="item-name-${searchItem}-Red Hat"]`).eq(1).click();
} else {
cy.get(`[data-test="item-name-${searchItem}-Red Hat"]`).first().click();
}
});
cy.get(pipelineBuilderPO.formView.addInstallTask).click();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ spec:
- name: revision
value: $(params.GIT_REVISION)
- name: subdirectory
value: ''
value: ""
- name: deleteExisting
value: 'true'
value: "true"
taskRef:
kind: ClusterTask
name: git-clone
resolver: cluster
params:
- name: kind
value: task
- name: name
value: git-clone
- name: namespace
value: openshift-pipelines
workspaces:
- name: output
workspace: workspace
Expand All @@ -44,16 +50,22 @@ spec:
- name: IMAGE
value: $(params.IMAGE_NAME)
- name: TLSVERIFY
value: 'false'
value: "false"
- name: PATH_CONTEXT
value: $(params.PATH_CONTEXT)
- name: VERSION
value: $(params.VERSION)
runAfter:
- fetch-repository
taskRef:
kind: ClusterTask
name: s2i-nodejs
resolver: cluster
params:
- name: kind
value: task
- name: name
value: s2i-nodejs
- name: namespace
value: openshift-pipelines
workspaces:
- name: source
workspace: workspace
Expand All @@ -64,7 +76,13 @@ spec:
runAfter:
- build
taskRef:
kind: ClusterTask
name: openshift-client
resolver: cluster
params:
- name: kind
value: task
- name: name
value: openshift-client
- name: namespace
value: openshift-pipelines
workspaces:
- name: workspace
- name: workspace
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ spec:
- name: revision
value: $(params.GIT_REVISION)
- name: subdirectory
value: ''
value: ""
- name: deleteExisting
value: 'true'
value: "true"
taskRef:
kind: ClusterTask
name: git-clone
resolver: cluster
params:
- name: kind
value: task
- name: name
value: git-clone
- name: namespace
value: openshift-pipelines
workspaces:
- name: output
workspace: workspace
Expand All @@ -44,16 +50,22 @@ spec:
- name: IMAGE
value: $(params.IMAGE_NAME)
- name: TLSVERIFY
value: 'false'
value: "false"
- name: PATH_CONTEXT
value: $(params.PATH_CONTEXT)
- name: VERSION
value: $(params.VERSION)
runAfter:
- fetch-repository
taskRef:
kind: ClusterTask
name: s2i-python
resolver: cluster
params:
- name: kind
value: task
- name: name
value: s2i-python
- name: namespace
value: openshift-pipelines
workspaces:
- name: source
workspace: workspace
Expand All @@ -64,7 +76,13 @@ spec:
runAfter:
- build
taskRef:
kind: ClusterTask
name: openshift-client
resolver: cluster
params:
- name: kind
value: task
- name: name
value: openshift-client
- name: namespace
value: openshift-pipelines
workspaces:
- name: workspace
Loading

0 comments on commit d54ed47

Please sign in to comment.