Skip to content

Commit

Permalink
status pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoragrega committed Oct 20, 2021
1 parent 1d420e7 commit 74334a7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
26 changes: 23 additions & 3 deletions client/src/components/ReviewMerged.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<!--TOOD pop over menu?-->
<v-tooltip bottom v-for="stage in pipeline.stages" v-bind:key="`merged-${pipeline.id}-${stage.name}`">
<template v-slot:activator="{ on, attrs }">
<v-btn icon color="green" v-bind:key="stage.name" v-bind="attrs" v-on="on">
<v-icon>mdi-check-circle-outline</v-icon>
<v-btn icon :color=stageColor(stage) v-bind:key="stage.name" v-bind="attrs" v-on="on">
<v-icon>{{stageIcon(stage)}}</v-icon>
</v-btn>
</template>
<span>{{ stage.name }}</span>
Expand All @@ -36,5 +36,25 @@ const ReviewMergedProps = Vue.extend({
})
@Component
export default class ReviewMerged extends ReviewMergedProps {}
export default class ReviewMerged extends ReviewMergedProps {
stageColor(stage) {
switch (stage.status) {
case "success": return "green";
case "failed": return "red";
case "running": return "yellow";
}
return "grey"
}
stageIcon(stage) {
switch (stage.status) {
case "success": return "mdi-check-circle-outline";
case "failed": return "mdi-alert-circle-outline";
case "running": return "mdi-play-circle-outline";
case "skipped": return "mdi-skip-next-circle-outline";
case "pending": return "mdi-pause-circle-outline";
case "canceled": return "mdi-minus-circle-outline";
case "manual": return "mdi-account-circle-outline";
}
}
}
</script>
5 changes: 3 additions & 2 deletions gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,15 @@ func buildStages(jobs []*gitlab.Job) (stages []fastlane.Stage, err error) {
stages = append(stages, fastlane.Stage{Name: job.Stage})
}

status, err := status(stages[pos].Status, job.Status)
newStatus, err := status(stages[pos].Status, job.Status)
if err != nil {
return nil, err
}

stages[pos].Status = newStatus
stages[pos].Jobs = append(stages[pos].Jobs, fastlane.Job{
Name: job.Name,
Status: status,
Status: fastlane.Status(job.Status),
WebURL: job.WebURL,
})
}
Expand Down

0 comments on commit 74334a7

Please sign in to comment.