Skip to content

Commit

Permalink
Add message/icon to show TRSS status (#830)
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Xia <Lan_Xia@ca.ibm.com>
  • Loading branch information
llxia authored Oct 30, 2023
1 parent 22c0cce commit cd062da
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 42 deletions.
7 changes: 6 additions & 1 deletion test-result-summary-client/src/Build/ReleaseSummary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ReleaseSummary = () => {

useEffect(() => {
const updateData = async () => {
const { parentId } = getParams(location.search);
const { parentId, childBuildsResult } = getParams(location.search);
const originUrl = window.location.origin;

const build = await fetchData(`/api/getParents?id=${parentId}`);
Expand All @@ -23,8 +23,13 @@ const ReleaseSummary = () => {
const nl = `\n`;
if (build && build[0]) {
const { buildName, buildUrl, timestamp, startBy } = build[0];
let buildsResultOutput = '';
if (childBuildsResult === 'PROGRESSING') {
buildsResultOutput = `**Warning:** The release summary report is not yet complete. Currently, it only contains partial results. ${nl}${nl}`;
}
report =
`#### Release Summary Report for ${buildName} ${nl}` +
buildsResultOutput +
`**Report generated at:** ${new Date().toUTCString()} ${nl} ${nl}` +
`TRSS [Build](${originUrl}/buildDetail?parentId=${parentId}&testSummaryResult=failed&buildNameRegex=%5ETest) ` +
`and TRSS [Grid View](${originUrl}/resultSummary?parentId=${parentId}) ${nl}` +
Expand Down
69 changes: 35 additions & 34 deletions test-result-summary-client/src/Build/Summary/BuildStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,41 @@ import { Tooltip } from 'antd';
import BuildStatusIcon from './BuildStatusIcon.jsx';

const BuildStatus = ({ status, id, buildNum }) => {
if (status && id && buildNum) {
return (
<div>
<Tooltip title="Build tree">
<Link
to={{
pathname: '/buildTreeView',
search: params({ parentId: id }),
}}
>
<ApartmentOutlined />
</Link>
</Tooltip>
<Link
to={{
pathname: '/buildDetail',
search: params({ parentId: id }),
}}
style={{
color:
status === 'SUCCESS'
? '#2cbe4e'
: status === 'FAILURE'
? '#f50'
: '#DAA520',
}}
>
{' '}
Build #{buildNum} <BuildStatusIcon status={status} />
</Link>
</div>
);
}
return null;
if (status && id && buildNum) {
return (
<div>
<Tooltip title="Build tree">
<Link
to={{
pathname: '/buildTreeView',
search: params({ parentId: id }),
}}
>
<ApartmentOutlined />
</Link>
</Tooltip>
<Link
to={{
pathname: '/buildDetail',
search: params({ parentId: id }),
}}
style={{
color:
status === 'SUCCESS'
? '#2cbe4e'
: status === 'FAILURE'
? '#f50'
: '#DAA520',
}}
>
{' '}
Build #{buildNum}
<BuildStatusIcon status={status} />
</Link>
</div>
);
}
return null;
};

export default BuildStatus;
16 changes: 12 additions & 4 deletions test-result-summary-client/src/Build/Summary/BuildStatusIcon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,27 @@ export default class BuildStatusIcon extends Component {
if (status === 'PROGRESSING') {
icon = (
<LoadingOutlined
style={{ fontSize: 16, color: '#DAA520' }}
style={{ fontSize: 18, padding: 8, color: '#DAA520' }}
/>
);
} else if (status === 'SUCCESS') {
icon = (
<CheckOutlined style={{ fontSize: 16, color: '#2cbe4e' }} />
<CheckOutlined
style={{ fontSize: 18, padding: 8, color: '#2cbe4e' }}
/>
);
} else if (status === 'FAILURE') {
icon = (
<CloseOutlined style={{ fontSize: 16, color: '#f50' }} />
<CloseOutlined
style={{ fontSize: 18, padding: 8, color: '#f50' }}
/>
);
} else {
icon = <InfoOutlined style={{ fontSize: 16, color: '#f50' }} />;
icon = (
<InfoOutlined
style={{ fontSize: 18, padding: 8, color: '#f50' }}
/>
);
}
return <Tooltip title={status}>{icon}</Tooltip>;
}
Expand Down
8 changes: 7 additions & 1 deletion test-result-summary-client/src/Build/Summary/Overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import moment from 'moment';
import BuildLink from '../BuildLink';
import renderDuration from '../Duration';
import BuildStatus from './BuildStatus';
import BuildStatusIcon from './BuildStatusIcon.jsx';
import './Overview.css';

const DAY_FORMAT = 'MMM DD YYYY, hh:mm a';
Expand Down Expand Up @@ -65,13 +66,18 @@ export default class Overview extends Component {
<Link
to={{
pathname: '/releaseSummary',
search: params({ parentId: id, buildName }),
search: params({
parentId: id,
buildName,
childBuildsResult,
}),
}}
>
<div className="overview-report-link">
<Button type="primary">
Release Summary Report
</Button>
<BuildStatusIcon status={childBuildsResult} />
</div>
</Link>
<Divider style={{ fontSize: '20px' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function ResultSummary() {
buildMap: {},
summary: {},
parentBuildInfo: {},
childBuildsResult: 'SUCCESS',
childBuildsResult: 'UNDEFINED',
javaVersion: null,
});

Expand Down Expand Up @@ -74,7 +74,7 @@ export default function ResultSummary() {
parentId,
})}`
);
let childBuildsResult = 'SUCCESS';
let childBuildsResult = 'UNSTABLE';
let javaVersion = null;
const buildMap = {};
let jdkVersionOpts = [];
Expand Down

0 comments on commit cd062da

Please sign in to comment.