Skip to content

Commit

Permalink
dry run dumps markdown
Browse files Browse the repository at this point in the history
this will allow testing it in a preview wihtout opening an issue
  • Loading branch information
prince-chrismc committed Mar 16, 2021
1 parent 081984d commit 3f58b93
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions internal/main.go
Expand Up @@ -88,13 +88,7 @@ func Run(token string, dryRun bool) error {
return nil // The published results are the same, no need to update the table.
}

if dryRun {
fmt.Println(string(bytes))
return nil
}

_, _, err = client.Issues.Edit(context, "prince-chrismc", "conan-center-index-pending-review", 1, &github.IssueRequest{
Body: github.String(`## :sparkles: Summary of Pull Requests Pending Review!
commentBody := `## :sparkles: Summary of Pull Requests Pending Review!
### :ballot_box_with_check: Selection Criteria:
Expand All @@ -111,8 +105,16 @@ Icon | Description | Notes
:memo: | Modification to an existing recipe |
:green_book: | Documentation change | matches the label
:warning: | The merge commit status does **not** indicate success | only displayed when ready to merge` +
format.UnderReview(retval) + format.ReadyToMerge(retval) + format.Statistics(stats) +
"\n\n<details><summary>Raw JSON data</summary>\n\n```json\n" + string(bytes) + "\n```\n\n</details>"),
format.UnderReview(retval) + format.ReadyToMerge(retval) + format.Statistics(stats) +
"\n\n<details><summary>Raw JSON data</summary>\n\n```json\n" + string(bytes) + "\n```\n\n</details>"

if dryRun {
fmt.Println(commentBody)
return nil
}

_, _, err = client.Issues.Edit(context, "prince-chrismc", "conan-center-index-pending-review", 1, &github.IssueRequest{
Body: github.String(commentBody),
})
if err != nil {
fmt.Printf("Problem editing issue %v\n", err)
Expand Down

1 comment on commit 3f58b93

@prince-chrismc
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ Summary of Pull Requests Pending Review!

☑️ Selection Criteria:

  • There has been at least one approval (at any point)
  • No reviews and commited to in the last 24hrs
  • No labels with exception to "bump version" and "docs"

🗺️ Legend

Icon Description Notes
🆕 Adding a recipe which does not yet exist
⬆️ Version bump closely matches the label
📝 Modification to an existing recipe
📗 Documentation change matches the label
⚠️ The merge commit status does not indicate success only displayed when ready to merge
### :nerd_face: Please Review! 

There are ***9** pull requests currently under way :eyes:

PR | By | Recipe | Reviews | :stop_sign: Blockers | :star2: Approvers
:---: | --- | --- | :---: | --- | ---
[#4487](https://github.com/conan-io/conan-center-index/pull/4487)|[ChGen](https://github.com/ChGen)|:new: zmqpp|39||prince-chrismc

#4556|anton-danielsson|:memo: protobuf|39||mathbunnyru, prince-chrismc
#4715|SpaceIm|:memo: simdjson|7||SSE4, prince-chrismc, a4z
#4797|ChatPion|:memo: opencv|9||SSE4, prince-chrismc
#4856|SSE4|:new: portable-file-dialogs|15|danimtb|SpaceIm, uilianries, jgsogo, czoido, mathbunnyru
#4872|SpaceIm|:memo: tesseract|2||prince-chrismc, SSE4
#4890|prince-chrismc|:memo: ixwebsocket|0||
#4893|SpaceIm|:memo: pcre|2||prince-chrismc, ericLemanissier
#4894|SpaceIm|:memo: pcre2|2||prince-chrismc, ericLemanissier

#### :bar_chart: Statistics

> :warning: These are just rough metrics counting the labels and may not reflect the acutal state of pull requests

- Commit: 3f58b93c3619de594dd00ba0617d134a3523e04d
- Pull Requests:
   - Open: 109
   - Draft: 17
   - Average Age: 76 days, 11 hours, and 45.31 minutes
- Labels:
   - Stale: 3
   - Failed: 78
   - Blocked: 7
Raw JSON data
[
   {
      "Number": 4487,
      "OpenedBy": "ChGen",
      "Recipe": "zmqpp",
      "Change": 0,
      "ReviewURL": "https://github.com/conan-io/conan-center-index/pull/4487",
      "LastCommitSHA": "da8ee6c23ee260fb2317c7fde6698f0710f65d66",
      "LastCommitAt": "0001-01-01T00:00:00Z",
      "CciBotPassed": true,
      "Summary": {
         "Count": 39,
         "ValidApprovals": 1,
         "TeamApproval": false,
         "Approvals": [
            "prince-chrismc"
         ],
         "Blockers": null
      }
   },
   {
      "Number": 4556,
      "OpenedBy": "anton-danielsson",
      "Recipe": "protobuf",
      "Change": 1,
      "ReviewURL": "https://github.com/conan-io/conan-center-index/pull/4556",
      "LastCommitSHA": "facc2895230f752557d90c3e7e5c005147193ba9",
      "LastCommitAt": "0001-01-01T00:00:00Z",
      "CciBotPassed": true,
      "Summary": {
         "Count": 39,
         "ValidApprovals": 2,
         "TeamApproval": false,
         "Approvals": [
            "mathbunnyru",
            "prince-chrismc"
         ],
         "Blockers": []
      }
   },
   {
      "Number": 4715,
      "OpenedBy": "SpaceIm",
      "Recipe": "simdjson",
      "Change": 1,
      "ReviewURL": "https://github.com/conan-io/conan-center-index/pull/4715",
      "LastCommitSHA": "23ac1650ee5fd238c09fb1ebda5a298e42bc7348",
      "LastCommitAt": "0001-01-01T00:00:00Z",
      "CciBotPassed": true,
      "Summary": {
         "Count": 7,
         "ValidApprovals": 2,
         "TeamApproval": true,
         "Approvals": [
            "SSE4",
            "prince-chrismc",
            "a4z"
         ],
         "Blockers": null
      }
   },
   {
      "Number": 4797,
      "OpenedBy": "ChatPion",
      "Recipe": "opencv",
      "Change": 1,
      "ReviewURL": "https://github.com/conan-io/conan-center-index/pull/4797",
      "LastCommitSHA": "f6716853ec7064eecbcab7aca7a99315d924f462",
      "LastCommitAt": "0001-01-01T00:00:00Z",
      "CciBotPassed": true,
      "Summary": {
         "Count": 9,
         "ValidApprovals": 2,
         "TeamApproval": true,
         "Approvals": [
            "SSE4",
            "prince-chrismc"
         ],
         "Blockers": null
      }
   },
   {
      "Number": 4856,
      "OpenedBy": "SSE4",
      "Recipe": "portable-file-dialogs",
      "Change": 0,
      "ReviewURL": "https://github.com/conan-io/conan-center-index/pull/4856",
      "LastCommitSHA": "46becab12cb576a8aa851a5f7db5dde443f7ced8",
      "LastCommitAt": "0001-01-01T00:00:00Z",
      "CciBotPassed": true,
      "Summary": {
         "Count": 15,
         "ValidApprovals": 4,
         "TeamApproval": true,
         "Approvals": [
            "SpaceIm",
            "uilianries",
            "jgsogo",
            "czoido",
            "mathbunnyru"
         ],
         "Blockers": [
            "danimtb"
         ]
      }
   },
   {
      "Number": 4872,
      "OpenedBy": "SpaceIm",
      "Recipe": "tesseract",
      "Change": 1,
      "ReviewURL": "https://github.com/conan-io/conan-center-index/pull/4872",
      "LastCommitSHA": "770d232151108426f4fadf48e2967434865c96a0",
      "LastCommitAt": "0001-01-01T00:00:00Z",
      "CciBotPassed": true,
      "Summary": {
         "Count": 2,
         "ValidApprovals": 2,
         "TeamApproval": true,
         "Approvals": [
            "prince-chrismc",
            "SSE4"
         ],
         "Blockers": null
      }
   },
   {
      "Number": 4890,
      "OpenedBy": "prince-chrismc",
      "Recipe": "ixwebsocket",
      "Change": 1,
      "ReviewURL": "https://github.com/conan-io/conan-center-index/pull/4890",
      "LastCommitSHA": "7a5d45f0c79e5e84c91df0448d81f98dc696ea4f",
      "LastCommitAt": "2021-03-15T12:27:13Z",
      "CciBotPassed": false,
      "Summary": {
         "Count": 0,
         "ValidApprovals": 0,
         "TeamApproval": false,
         "Approvals": null,
         "Blockers": null
      }
   },
   {
      "Number": 4893,
      "OpenedBy": "SpaceIm",
      "Recipe": "pcre",
      "Change": 1,
      "ReviewURL": "https://github.com/conan-io/conan-center-index/pull/4893",
      "LastCommitSHA": "35885d910fd38430a1232117d0ac1349c2adfc38",
      "LastCommitAt": "0001-01-01T00:00:00Z",
      "CciBotPassed": true,
      "Summary": {
         "Count": 2,
         "ValidApprovals": 2,
         "TeamApproval": false,
         "Approvals": [
            "prince-chrismc",
            "ericLemanissier"
         ],
         "Blockers": null
      }
   },
   {
      "Number": 4894,
      "OpenedBy": "SpaceIm",
      "Recipe": "pcre2",
      "Change": 1,
      "ReviewURL": "https://github.com/conan-io/conan-center-index/pull/4894",
      "LastCommitSHA": "ad5584c6e03e640b0d40d09b53914ac312c7137a",
      "LastCommitAt": "0001-01-01T00:00:00Z",
      "CciBotPassed": true,
      "Summary": {
         "Count": 2,
         "ValidApprovals": 2,
         "TeamApproval": false,
         "Approvals": [
            "prince-chrismc",
            "ericLemanissier"
         ],
         "Blockers": null
      }
   }
]

Please sign in to comment.