Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tekton): add view output action in pipelinerun list view #1128

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions plugins/shared-react/src/types/pipeline/taskRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,3 @@ export type TaskRunKind = {
};
status?: TaskRunStatus;
};

export enum TaskRunResultsAnnotations {
KEY = 'task.results.key',
TYPE = 'task.results.type',
}

export enum TaskRunResultsAnnotationValue {
EXTERNAL_LINK = 'external-link',
}

export enum TaskRunResults {
SBOM = 'LINK_TO_SBOM',
SCAN_OUTPUT = 'SCAN_OUTPUT',
}
40 changes: 33 additions & 7 deletions plugins/tekton/dev/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import {
import { TestApiProvider } from '@backstage/test-utils';

import { mockKubernetesPlrResponse } from '../src/__fixtures__/1-pipelinesData';
import {
acsDeploymentCheck,
acsImageCheckResults,
acsImageScanResult,
} from '../src/__fixtures__/advancedClusterSecurityData';
import { enterpriseContractResult } from '../src/__fixtures__/enterpriseContractData';
import { TektonCI, tektonPlugin } from '../src/plugin';

const mockEntity: Entity = {
Expand All @@ -35,13 +41,33 @@ const mockEntity: Entity = {

class MockKubernetesProxyApi implements KubernetesProxyApi {
async getPodLogs(_request: any): Promise<any> {
return new Promise(resolve => {
setTimeout(() => {
resolve({
text: `\nstreaming logs from container: ${_request.containerName} \n...`,
});
}, 500);
});
const delayedResponse = (data: string, ms: number) =>
new Promise(resolve => {
setTimeout(() => {
resolve({
text: data,
});
}, ms);
});

if (_request.podName.includes('ec-task')) {
return delayedResponse(JSON.stringify(enterpriseContractResult), 100);
}

if (_request.podName.includes('image-scan-task')) {
return delayedResponse(JSON.stringify(acsImageScanResult), 200);
}

if (_request.podName.includes('image-check-task')) {
return delayedResponse(JSON.stringify(acsImageCheckResults), 300);
}

if (_request.podName.includes('deployment-check-task')) {
return delayedResponse(JSON.stringify(acsDeploymentCheck), 400);
}

const response = `\nstreaming logs from container: ${_request.containerName} \n...`;
return delayedResponse(response, 500);
}

async getEventsByInvolvedObjectName(): Promise<any> {
Expand Down
3 changes: 2 additions & 1 deletion plugins/tekton/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"tsc": "tsc"
},
"dependencies": {
"@aonic-ui/pipelines": "^1.0.1",
"@backstage/catalog-model": "^1.4.3",
"@backstage/core-components": "^0.13.6",
"@backstage/core-plugin-api": "^1.7.0",
Expand All @@ -39,7 +40,7 @@
"@material-ui/lab": "^4.0.0-alpha.45",
"@patternfly/patternfly": "^5.1.0",
"@patternfly/react-charts": "^7.1.1",
"@patternfly/react-core": "^5.1.1",
"@patternfly/react-core": "^5.1.2",
"@patternfly/react-icons": "^5.1.1",
"@patternfly/react-tokens": "^5.1.2",
"@patternfly/react-topology": "^5.1.0",
Expand Down
Loading
Loading