Skip to content

Commit

Permalink
feat(3211): Build detail view - Hide steps and logs for virtual builds (
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar1312 authored Oct 23, 2024
1 parent f10e9b1 commit 1e43ed0
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/build/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default Model.extend({
status: attr('string'),
stats: attr(),
statusMessage: attr('string', { defaultValue: null }),
statusMessageType: attr('string', { defaultValue: null }),
steps: attr(),
templateId: attr('number'),
startTimeWords: computed('startTime', {
Expand Down
50 changes: 50 additions & 0 deletions app/pipeline/build/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,56 @@ export default Controller.extend({
}
),

statusMessageAlertType: computed('model.build.statusMessageType', {
get() {
const statusMessageType = this.get('model.build.statusMessageType');

switch (statusMessageType) {
case 'ERROR':
return 'danger';
case 'INFO':
return 'info';
case 'WARN':
default:
return 'warning';
}
}
}),

statusMessageAlertIcon: computed('model.build.statusMessageType', {
get() {
const statusMessageType = this.get('model.build.statusMessageType');

switch (statusMessageType) {
case 'INFO':
return 'info-circle';
case 'ERROR':
case 'WARN':
default:
return 'exclamation-triangle';
}
}
}),

isVirtualBuild: computed(
'model.build.jobId',
'model.event.workflowGraph.nodes',
{
get() {
const jobId = parseInt(this.get('model.build.jobId'), 10);
const nodes = this.get('model.event.workflowGraph.nodes');

return nodes.find(node => node.id === jobId).virtual;
}
}
),

showStepCollection: computed('isVirtualBuild', 'stepList', {
get() {
return !this.get('isVirtualBuild') && this.get('stepList');
}
}),

prEvents: computed(
'job.id',
'model.event.pr.url',
Expand Down
6 changes: 3 additions & 3 deletions app/pipeline/build/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
{{#if this.build.statusMessage}}
<InfoMessage
@message={{this.build.statusMessage}}
@type="warning"
@icon="exclamation-triangle"
@type={{this.statusMessageAlertType}}
@icon={{this.statusMessageAlertIcon}}
/>
{{/if}}
{{#if this.build.meta.build.warning}}
Expand All @@ -66,7 +66,7 @@
</div>


{{#if this.stepList}}
{{#if this.showStepCollection}}
<BuildStepCollection
@preselectedStepName={{this.preselectedStepName}}
@selectedArtifact={{this.selectedArtifact}}
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"qunit": "^2.19.1",
"qunit-dom": "^2.0.0",
"sass-embedded": "^1.77.0",
"screwdriver-data-schema": "^24.0.0",
"screwdriver-data-schema": "^24.1.0",
"sinon": "^18.0.0",
"webpack": "^5.76.2"
}
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/pipeline-builds-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ module('Acceptance | pipeline build', function (hooks) {
const build = makeBuilds(1000000)[0];

build.id = 1000000;
build.jobId = 12345;
build.status = 'FAILURE';

return [
Expand Down
2 changes: 1 addition & 1 deletion tests/mock/workflow-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default () =>
{ name: '~pr' },
{ name: '~commit' },
{ id: 12345, name: 'main' },
{ is: 123456, name: 'publish' }
{ id: 123456, name: 'publish' }
],
edges: [
{ src: '~pr', dest: 'main' },
Expand Down

0 comments on commit 1e43ed0

Please sign in to comment.