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

umputun / ralphex / 26432277551

26 May 2026 04:27AM UTC coverage: 83.252% (-0.1%) from 83.363%
26432277551

Pull #364

github

umputun
fix(processor): guard external review phase holder
Pull Request #364: Refactor processor runner into phase engines

1114 of 1228 new or added lines in 15 files covered. (90.72%)

22 existing lines in 5 files now uncovered.

7680 of 9225 relevant lines covered (83.25%)

222.69 hits per line

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

93.33
/pkg/processor/phase/break_controller.go
1
package phase
2

3
import "context"
4

5
// BreakController translates break-channel events into cancellable phase contexts.
6
type BreakController struct {
7
        deps *Deps
8
}
9

10
// NewBreakController creates a break controller backed by shared dependencies.
11
func NewBreakController(deps *Deps) *BreakController {
81✔
12
        return &BreakController{deps: deps}
81✔
13
}
81✔
14

15
func (b *BreakController) context(parent context.Context) (context.Context, context.CancelFunc) {
31✔
16
        ch := b.breakCh()
31✔
17
        if ch == nil {
55✔
18
                return parent, func() {}
48✔
19
        }
20
        ctx, cancel := context.WithCancel(parent)
7✔
21
        go func() {
14✔
22
                select {
7✔
23
                case <-ch:
5✔
24
                        cancel()
5✔
25
                case <-ctx.Done():
2✔
26
                }
27
        }()
28
        return ctx, cancel
7✔
29
}
30

31
func (b *BreakController) isBreak(loopCtx, parentCtx context.Context) bool {
21✔
32
        return loopCtx.Err() != nil && parentCtx.Err() == nil
21✔
33
}
21✔
34

35
func (b *BreakController) drain() {
8✔
36
        ch := b.breakCh()
8✔
37
        if ch == nil {
9✔
38
                return
1✔
39
        }
1✔
40
        select {
7✔
41
        case <-ch:
2✔
42
        default:
5✔
43
        }
44
}
45

46
func (b *BreakController) breakCh() <-chan struct{} {
39✔
47
        if b == nil || b.deps == nil {
39✔
NEW
48
                return nil
×
NEW
49
        }
×
50
        return b.deps.BreakCh
39✔
51
}
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

© 2026 Coveralls, Inc