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

mindersec / minder / 24480259744

15 Apr 2026 09:51PM UTC coverage: 59.413% (-0.1%) from 59.539%
24480259744

Pull #6380

github

web-flow
Merge 89f1bc33a into d547963f7
Pull Request #6380: feat(engine): expose structured commit metadata for pull request evaluation

6 of 81 new or added lines in 3 files covered. (7.41%)

19955 of 33587 relevant lines covered (59.41%)

36.05 hits per line

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

0.0
/internal/engine/commitinfo/commitinfo.go
1
// Package commitinfo provides utilities for extracting and normalizing
2
// pull request commit metadata into a provider-agnostic structure.
3
//
4
// It is designed to decouple commit data handling from provider-specific
5
// implementations (e.g., GitHub) and avoid import cycles between engine
6
// components.
7
package commitinfo
8

9
import (
10
        "strings"
11

12
        "github.com/google/go-github/v63/github"
13
)
14

15
// CommitInfo represents normalized pull request commit metadata.
16
type CommitInfo struct {
17
        SHA     string
18
        Message string
19
        Author  string
20
}
21

22
// Extract normalizes a GitHub commit into a CommitInfo struct.
NEW
23
func Extract(c *github.RepositoryCommit) CommitInfo {
×
NEW
24
        msg := ""
×
NEW
25
        if c.GetCommit() != nil {
×
NEW
26
                msg = c.GetCommit().GetMessage()
×
NEW
27
        }
×
28

NEW
29
        firstLine := msg
×
NEW
30
        if idx := strings.Index(msg, "\n"); idx != -1 {
×
NEW
31
                firstLine = msg[:idx]
×
NEW
32
        }
×
NEW
33
        firstLine = strings.TrimSpace(firstLine)
×
NEW
34

×
NEW
35
        author := ""
×
NEW
36
        if c.GetCommit() != nil && c.GetCommit().Author != nil {
×
NEW
37
                author = c.GetCommit().Author.GetName()
×
NEW
38
        }
×
39

NEW
40
        return CommitInfo{
×
NEW
41
                SHA:     c.GetSHA(),
×
NEW
42
                Message: firstLine,
×
NEW
43
                Author:  author,
×
NEW
44
        }
×
45
}
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