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

umputun / ralphex / 26431227500

26 May 2026 03:44AM UTC coverage: 83.252% (-0.1%) from 83.363%
26431227500

Pull #364

github

umputun
docs: document processor phase architecture

Archive the completed implementation plan and update project guidance with the phase package boundaries.
Pull Request #364: Refactor processor runner into phase engines

1101 of 1215 new or added lines in 15 files covered. (90.62%)

20 existing lines in 4 files now uncovered.

7670 of 9213 relevant lines covered (83.25%)

222.9 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 {
80✔
12
        return &BreakController{deps: deps}
80✔
13
}
80✔
14

15
func (b *BreakController) context(parent context.Context) (context.Context, context.CancelFunc) {
30✔
16
        ch := b.breakCh()
30✔
17
        if ch == nil {
53✔
18
                return parent, func() {}
46✔
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{} {
38✔
47
        if b == nil || b.deps == nil {
38✔
NEW
48
                return nil
×
NEW
49
        }
×
50
        return b.deps.BreakCh
38✔
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