• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / GitProjectHealth / 10880334038

16 Sep 2024 08:38AM UTC coverage: 20.325% (-0.2%) from 20.538%
10880334038

Pull #54

github

web-flow
Merge 9db8bd0be into aef27716a
Pull Request #54: Metrics fixing

20 of 234 new or added lines in 20 files covered. (8.55%)

252 existing lines in 18 files now uncovered.

1961 of 9648 relevant lines covered (20.33%)

0.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/GitLabHealth-Model-Visualization/GLHGroupVisualization.class.st
1
Class {
2
        #name : 'GLHGroupVisualization',
3
        #superclass : 'MiAbstractVisualization',
4
        #instVars : [
5
                'noPipelineColor',
6
                'passingPipelineColor',
7
                'failingPipelinecolor'
8
        ],
9
        #category : 'GitLabHealth-Model-Visualization',
10
        #package : 'GitLabHealth-Model-Visualization'
11
}
12

13
{ #category : 'running' }
14
GLHGroupVisualization >> createLegend [
×
15

×
16
        | legend |
×
17
        legend := RSLegend new.
×
18
        legend
×
19
                text: 'Repository with last pipeline passing'
×
20
                withBoxColor: self passingPipelineColor.
×
21
        legend
×
22
                text: 'Repository with last Pipeline failing'
×
23
                withBoxColor: self failingPipelinecolor.
×
24
        legend
×
25
                text: 'Repository without pipeline'
×
26
                withBoxColor: self noPipelineColor.
×
27

×
28
        legend legendDo: [ :l |
×
29
                l
×
30
                        draggable;
×
31
                        withBorder;
×
32
                        padding: 20 ].
×
33
        legend location right middle.
×
34

×
35
        ^ legend
×
UNCOV
36
]
×
37

38
{ #category : 'running' }
39
GLHGroupVisualization >> createShapeFor: project [
×
40

×
41
        | box inspect |
×
42

×
43
        box := RSBox new
×
44
                       size: 5;
×
45
                       model: project;
×
46
                       yourself.
×
47
        box color: (project lastPipeline
×
48
                ifNil: [ self noPipelineColor ]
×
49
                ifNotNil: [ :lastPipeline |
×
50
                        (lastPipeline status = #success)
×
51
                                ifTrue: [ Color green ]
×
52
                                ifFalse: [ Color red ]
×
53
                ]).
×
54

×
55
        inspect := RSInspectableInteraction new.
×
56
        inspect inspectShapeBlock: [ :proj |
×
57
                proj inspect.
×
58
                "block must return a Window :-("
×
59
                SystemWindow  new
×
60
        ].
×
61
        box @ inspect.
×
62

×
63
        box @ (RSPopup text: [ :proj |
×
64
                String streamContents: [ :st | 
×
65
                        st << proj name ;  cr ; << 'on: '.
×
66
                        BasicDatePrinter default printYMD: proj lastPipelineDate withLeadingSpace: false on: st.
×
67
                        st space.
×
68
                        BasicDatePrinter default printHMS: proj lastPipelineDate separatedBy: $: on: st ] ]).
×
69

×
70
        ^ box
×
UNCOV
71
]
×
72

73
{ #category : 'running' }
74
GLHGroupVisualization >> createShapes: aGLHGroup [
×
75

×
76
        ^(aGLHGroup allToScope: GLHGroup) collect: [ :group || lbl projects composite |
×
77
                projects := (group projects sorted: [:a :b | a lastPipelineDate > b lastPipelineDate])
×
78
                        collect: [ :project | self createShapeFor: project ]
×
79
                        as: RSGroup.
×
80

×
81
                RSGridLayout on: projects.
×
82
                lbl := RSLabel new
×
83
                                 text: group name;
×
84
                                 color: Color white;
×
85
                                 yourself.
×
86

×
87
                RSLocation new
×
88
                        above;
×
89
                        move: lbl on: projects.
×
90
                composite := RSComposite new.
×
91
                composite @ RSAnimatedPopup @ RSDraggable.
×
92

×
93
                composite
×
94
                        color: Color gray;
×
95
                        model: group;
×
96
                        shapes: projects , { lbl }.
×
97
                composite padding: 10.
×
98
                composite
×
99
        ]
×
UNCOV
100
]
×
101

102
{ #category : 'accessing' }
103
GLHGroupVisualization >> failingPipelinecolor [
×
104

×
105
        ^ failingPipelinecolor
×
UNCOV
106
]
×
107

108
{ #category : 'accessing' }
109
GLHGroupVisualization >> failingPipelinecolor: anObject [
×
110

×
111
        failingPipelinecolor := anObject
×
UNCOV
112
]
×
113

114
{ #category : 'running' }
115
GLHGroupVisualization >> forGroup: aGLHGroups [
×
116

×
117
        | c shapes legend |
×
118
        c := RSCanvas new.
×
119

×
120
        shapes := aGLHGroups flatCollect: [ :group |
×
121
                          self createShapes: group ].
×
122
        c addAll: shapes.
×
123

×
124
        c @ RSCanvasController.
×
125
        RSLineBuilder orthoHorizontal
×
126
                markerEnd: (RSMarker new
×
127
                                 offset: 2;
×
128
                                 shape: (RSShapeFactory triangle
×
129
                                                  color: Color black;
×
130
                                                  size: 5;
×
131
                                                  yourself));
×
132
                attachPoint: RSHorizontalAttachPoint new;
×
133
                canvas: c;
×
134
                shapes: c nodes;
×
135
                connectFrom: #group.
×
136
        RSHorizontalVanDerPloegTreeLayout new on: c nodes.
×
137

×
138
        legend := self createLegend.
×
139
        legend container: c.
×
140
        legend build.
×
141

×
142
        ^ c
×
UNCOV
143
]
×
144

145
{ #category : 'initialization' }
146
GLHGroupVisualization >> initialize [
×
147

×
148
        super initialize.
×
149

×
150
        noPipelineColor := Color purple lighter.
×
151
        passingPipelineColor := Color green.
×
152
        failingPipelinecolor := Color red
×
UNCOV
153
]
×
154

155
{ #category : 'accessing' }
156
GLHGroupVisualization >> noPipelineColor [
×
157

×
158
        ^ noPipelineColor
×
UNCOV
159
]
×
160

161
{ #category : 'accessing' }
162
GLHGroupVisualization >> noPipelineColor: anObject [
×
163

×
164
        noPipelineColor := anObject
×
UNCOV
165
]
×
166

167
{ #category : 'accessing' }
168
GLHGroupVisualization >> passingPipelineColor [
×
169

×
170
        ^ passingPipelineColor
×
UNCOV
171
]
×
172

173
{ #category : 'accessing' }
174
GLHGroupVisualization >> passingPipelineColor: anObject [
×
175

×
176
        passingPipelineColor := anObject
×
UNCOV
177
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc