This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebf2490
commit 081984d
Showing
7 changed files
with
111 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package format | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/prince-chrismc/conan-center-index-pending-review/v2/pkg/pending_review" | ||
) | ||
|
||
func ReadyToMerge(prs []*pending_review.PullRequestSummary) string { | ||
tableBody, rowCount := ReviewsToMarkdownRows(prs, true) | ||
|
||
if rowCount == 0 { | ||
return "" | ||
} | ||
|
||
breif := "**1** pull request is" | ||
if rowCount > 1 { | ||
breif = "***" + fmt.Sprint(rowCount) + "** pull requests are" | ||
} | ||
|
||
return ` | ||
### :heavy_check_mark: Ready to Merge | ||
Currently ` + breif + ` waiting to be merged :tada: | ||
PR | By | Recipe | Reviews | :stop_sign: Blockers | :star2: Approvers | ||
:---: | --- | --- | :---: | --- | --- | ||
` + tableBody | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package format | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/prince-chrismc/conan-center-index-pending-review/v2/internal/duration" | ||
"github.com/prince-chrismc/conan-center-index-pending-review/v2/internal/stats" | ||
) | ||
|
||
func Statistics(stats stats.Stats) string { | ||
return ` | ||
#### :bar_chart: Statistics | ||
> :warning: These are just rough metrics counting the labels and may not reflect the acutal state of pull requests | ||
- Commit: ` + os.Getenv("GITHUB_SHA") + ` | ||
- Pull Requests: | ||
- Open: ` + fmt.Sprint(stats.Open) + ` | ||
- Draft: ` + fmt.Sprint(stats.Draft) + ` | ||
- Average Age: ` + duration.String(stats.Age.GetCurrentAverage()) + ` | ||
- Labels: | ||
- Stale: ` + fmt.Sprint(stats.Stale) + ` | ||
- Failed: ` + fmt.Sprint(stats.Failed) + ` | ||
- Blocked: ` + fmt.Sprint(stats.Blocked) + ` | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package format | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/prince-chrismc/conan-center-index-pending-review/v2/pkg/pending_review" | ||
) | ||
|
||
func UnderReview(prs []*pending_review.PullRequestSummary) string { | ||
tableBody, rowCount := ReviewsToMarkdownRows(prs, false) | ||
|
||
if rowCount == 0 { | ||
return ` | ||
:confused: There's nothing within the review process... You should [open a bug report](https://github.com/prince-chrismc/conan-center-index-pending-review/issues/new) | ||
` | ||
} | ||
|
||
breif := "is **1** pull request" | ||
if rowCount > 1 { | ||
breif = "are ***" + fmt.Sprint(rowCount) + "** pull requests" | ||
} | ||
|
||
return ` | ||
### :nerd_face: Please Review! | ||
There ` + breif + ` currently under way :eyes: | ||
PR | By | Recipe | Reviews | :stop_sign: Blockers | :star2: Approvers | ||
:---: | --- | --- | :---: | --- | --- | ||
` + tableBody | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters