8000 Add status of diff files on PR report by TP-113 · Pull Request #486 · k1LoW/octocov · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add status of diff files on PR report #486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gh/gh.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
type PullRequestFile struct {
Filename string
BlobURL string
Status string
}

func (g *Gh) FetchPullRequestFiles(ctx context.Context, owner, repo string, number int) ([]*PullRequestFile, error) {
Expand All @@ -338,6 +339,7 @@
files = append(files, &PullRequestFile{
Filename: f.GetFilename(),
BlobURL: f.GetBlobURL(),
Status: f.GetStatus(),
})
}
page += 1
Expand Down Expand Up @@ -389,9 +391,9 @@
continue
}
// Truncate less than a second
if s.GetStartedAt().Time.Unix() < t.Unix() && t.Unix() <= s.GetCompletedAt().Time.Unix() {

Check failure on line 394 in gh/gh.go

View workflow job for this annotation

GitHub Actions / Test

QF1008: could remove embedded field "Time" from selector (staticcheck)
log.Print("detect step")
return s.GetCompletedAt().Time.Sub(s.GetStartedAt().Time), nil

Check failure on line 396 in gh/gh.go

View workflow job for this annotation

GitHub Actions / Test

QF1008: could remove embedded field "Time" from selector (staticcheck)
}
}
}
Expand Down Expand Up @@ -419,7 +421,7 @@
continue
}
// Truncate less than a second
if s.GetStartedAt().Time.Unix() < t.Unix() && t.Unix() <= s.GetCompletedAt().Time.Unix() {

Check failure on line 424 in gh/gh.go

View workflow job for this annotation

GitHub Actions / Test

QF1008: could remove embedded field "Time" from selector (staticcheck)
log.Print("detect step")
return Step{
Name: s.GetName(),
Expand Down
4 changes: 2 additions & 2 deletions report/diff_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func (d *DiffReport) FileCoveragesTable(files []*gh.PullRequestFile) string {
pc += fc.FileCoverageB.Covered
pt += fc.FileCoverageB.Total
}
rows = append(rows, []string{fmt.Sprintf("[%s](%s)", f.Filename, f.BlobURL), fmt.Sprintf("%.1f%%", floor1(fc.A)), diff})
rows = append(rows, []string{fmt.Sprintf("[%s](%s)", f.Filename, f.BlobURL), fmt.Sprintf("%.1f%%", floor1(fc.A)), diff, f.Status})
}
if !exist {
return ""
Expand Down Expand Up @@ -306,7 +306,7 @@ func (d *DiffReport) FileCoveragesTable(files []*gh.PullRequestFile) string {
}

table := tablewriter.NewWriter(buf)
h := []string{"Files", "Coverage", "+/-"}
h := []string{"Files", "Coverage", "+/-", "Status"}
table.SetHeader(h)
table.SetAutoFormatHeaders(false)
table.SetAutoWrapText(false)
Expand Down
Loading
0