Skip to content

Commit

Permalink
Run ocamlformat.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zimmi48 committed Jun 17, 2024
1 parent 0ee1c8a commit c3536b9
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 154 deletions.
104 changes: 52 additions & 52 deletions bot-components/GitHub_GraphQL.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
(* Queries *)

module PullRequest_Milestone_and_Cards =
[%graphql
{|
[%graphql
{|
fragment Column on ProjectColumn {
id
databaseId
Expand Down Expand Up @@ -34,8 +34,8 @@ module PullRequest_Milestone_and_Cards =
|}]

module PullRequest_ID =
[%graphql
{|
[%graphql
{|
query prID($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner,name: $repo) {
pullRequest(number: $number) {
Expand All @@ -46,8 +46,8 @@ module PullRequest_ID =
|}]

module PullRequest_ID_and_Milestone =
[%graphql
{|
[%graphql
{|
query prInfo($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner,name: $repo) {
pullRequest(number: $number) {
Expand All @@ -63,8 +63,8 @@ module PullRequest_ID_and_Milestone =
|}]

module TeamMembership =
[%graphql
{|
[%graphql
{|
query teamMember($org: String!, $team: String!, $user: String!) {
organization(login:$org) {
team(slug:$team) {
Expand All @@ -85,8 +85,8 @@ module ParseAsString = struct
end

module PullRequest_Refs =
[%graphql
{|
[%graphql
{|
query prRefs($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name:$repo) {
pullRequest(number: $number) {
Expand Down Expand Up @@ -115,8 +115,8 @@ module PullRequest_Refs =
|}]

module Issue_Milestone =
[%graphql
{|
[%graphql
{|
fragment Milestone on Milestone {
id
}
Expand Down Expand Up @@ -151,8 +151,8 @@ module Issue_Milestone =
|}]

module PullRequestReviewsInfo =
[%graphql
{|
[%graphql
{|
fragment Reviews on PullRequestReviewConnection {
nodes {
author { login }
Expand Down Expand Up @@ -189,8 +189,8 @@ module PullRequestReviewsInfo =
|}]

module DefaultBranch =
[%graphql
{|
[%graphql
{|
query defaultBranch($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
defaultBranchRef {
Expand All @@ -201,8 +201,8 @@ module DefaultBranch =
|}]

module FileContent =
[%graphql
{|
[%graphql
{|
query fileContent($owner: String!, $repo: String!, $file: String!) {
repository(owner: $owner, name: $repo) {
file:object(expression: $file) {
Expand All @@ -215,8 +215,8 @@ module FileContent =
|}]

module RepoId =
[%graphql
{|
[%graphql
{|
query repoId($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
id
Expand All @@ -225,8 +225,8 @@ module RepoId =
|}]

module GetCheckRuns =
[%graphql
{|
[%graphql
{|
query getCheckRuns($appId: Int!, $owner: String!, $repo: String!, $commit: String!, $context: String!) {
repository(owner:$owner, name:$repo) {
obj: object(expression: $commit) {
Expand All @@ -252,8 +252,8 @@ module GetCheckRuns =
|}]

module GetLabel =
[%graphql
{|
[%graphql
{|
query getLabels($owner: String!, $repo: String!, $label: String!) {
repository(owner:$owner, name:$repo) {
label(name: $label) {
Expand All @@ -264,8 +264,8 @@ module GetLabel =
|}]

module GetOpenPullRequestWithLabel =
[%graphql
{|
[%graphql
{|

query getOpenPullRequestWithLabel($owner: String!, $repo:String!, $label:String!, $cursor: String, $len: Int!) {
repository(name: $repo,owner:$owner) {
Expand All @@ -285,8 +285,8 @@ query getOpenPullRequestWithLabel($owner: String!, $repo:String!, $label:String!
|}]

module GetPullRequestLabelTimeline =
[%graphql
{|
[%graphql
{|
fragment Label on Label {
name
}
Expand Down Expand Up @@ -317,8 +317,8 @@ query getPullRequestLabelTimeline($owner: String!, $repo:String!, $prNumber: Int
|}]

module GetPullRequestLabels =
[%graphql
{|
[%graphql
{|

query getPullRequestLabels($owner: String!, $repo:String!, $prNumber: Int!, $cursor: String, $len: Int!) {
repository(name: $repo,owner:$owner) {
Expand All @@ -339,8 +339,8 @@ query getPullRequestLabels($owner: String!, $repo:String!, $prNumber: Int!, $cur
|}]

module GetBaseAndHeadChecks =
[%graphql
{|
[%graphql
{|
fragment CheckRuns on CheckRunConnection {
nodes {
name
Expand Down Expand Up @@ -386,8 +386,8 @@ query getChecks($appId: Int!, $owner: String!, $repo:String!, $prNumber: Int!, $
|}]

module GetPipelineSummary =
[%graphql
{|
[%graphql
{|
query getChecks($appId: Int!, $owner: String!, $repo:String!, $head: String!) {
repository(name: $repo,owner:$owner) {
getPipelineSummaryCommit: object(expression: $head) {
Expand All @@ -410,8 +410,8 @@ query getChecks($appId: Int!, $owner: String!, $repo:String!, $head: String!) {
(* Mutations *)

module MoveCardToColumn =
[%graphql
{|
[%graphql
{|
mutation moveCard($card_id:ID!,$column_id:ID!) {
moveProjectCard(input:{cardId:$card_id,columnId:$column_id}) {
clientMutationId
Expand All @@ -420,8 +420,8 @@ module MoveCardToColumn =
|}]

module PostComment =
[%graphql
{|
[%graphql
{|
mutation addComment($id:ID!,$message:String!) {
payload: addComment(input:{subjectId:$id,body:$message}) {
commentEdge {
Expand All @@ -434,8 +434,8 @@ module PostComment =
|}]

module UpdateMilestone =
[%graphql
{|
[%graphql
{|
mutation updateMilestone($issue: ID!, $milestone: ID!) {
updateIssue(input: {id: $issue, milestoneId: $milestone}) {
clientMutationId
Expand All @@ -444,8 +444,8 @@ module UpdateMilestone =
|}]

module MergePullRequest =
[%graphql
{|
[%graphql
{|
mutation mergePullRequest($pr_id: ID!, $commit_headline: String,
$commit_body: String, $merge_method: PullRequestMergeMethod) {
mergePullRequest(
Expand All @@ -462,8 +462,8 @@ module MergePullRequest =
|}]

module ClosePullRequest =
[%graphql
{|
[%graphql
{|
mutation closePullRequest($pr_id: ID!) {
closePullRequest(
input: {pullRequestId: $pr_id}) {
Expand All @@ -475,8 +475,8 @@ module ClosePullRequest =
|}]

module LabelIssue =
[%graphql
{|
[%graphql
{|
mutation labelIssue($issue_id: ID!, $label_ids: [ID!]!) {
addLabelsToLabelable(
input: {labelableId: $issue_id, labelIds:$label_ids}) {
Expand All @@ -486,8 +486,8 @@ module LabelIssue =
|}]

module UnlabelIssue =
[%graphql
{|
[%graphql
{|
mutation unlabelIssue($issue_id: ID!, $label_ids: [ID!]!) {
removeLabelsFromLabelable(
input: {labelableId: $issue_id, labelIds:$label_ids}) {
Expand All @@ -497,8 +497,8 @@ module UnlabelIssue =
|}]

module NewCheckRun =
[%graphql
{|
[%graphql
{|
mutation newCheckRun($name: String!, $repoId: ID!, $headSha: String!,
$status: RequestableCheckStatusState!, $title: String!, $text: String, $summary: String!,
$url: String!, $conclusion: CheckConclusionState, $externalId: String) {
Expand All @@ -525,8 +525,8 @@ module NewCheckRun =
|}]

module UpdateCheckRun =
[%graphql
{|
[%graphql
{|
mutation updateCheckRun($checkRunId: ID!, $repoId: ID!
$conclusion: CheckConclusionState!, $title: String!, $text: String,
$url: String, $summary: String!) {
Expand Down
44 changes: 22 additions & 22 deletions bot-components/GitHub_queries.ml
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,28 @@ let get_backported_pr_info ~bot_info number base_ref =
>|= function
| Ok (cards, milestone) ->
(let open Option in
milestone
>>= fun milestone ->
milestone.description
>>= extract_backport_info ~bot_info
>>= (fun full_backport_info ->
full_backport_info.backport_info
|> List.find ~f:(fun {backport_to} ->
String.equal ("refs/heads/" ^ backport_to) base_ref ) )
>>= fun {request_inclusion_column; backported_column} ->
List.find_map cards ~f:(fun card ->
if
card.column
>>= (fun column -> column.databaseId)
|> Option.equal Int.equal (Some request_inclusion_column)
then
List.find_map card.columns ~f:(fun column ->
if
Option.equal Int.equal (Some backported_column)
column.databaseId
then Some {card_id= card.id; column_id= column.id}
else None )
else None ) )
milestone
>>= fun milestone ->
milestone.description
>>= extract_backport_info ~bot_info
>>= (fun full_backport_info ->
full_backport_info.backport_info
|> List.find ~f:(fun {backport_to} ->
String.equal ("refs/heads/" ^ backport_to) base_ref ) )
>>= fun {request_inclusion_column; backported_column} ->
List.find_map cards ~f:(fun card ->
if
card.column
>>= (fun column -> column.databaseId)
|> Option.equal Int.equal (Some request_inclusion_column)
then
List.find_map card.columns ~f:(fun column ->
if
Option.equal Int.equal (Some backported_column)
column.databaseId
then Some {card_id= card.id; column_id= column.id}
else None )
else None ) )
|> fun res -> Ok res
| Error err ->
Error (f "Error in backported_pr_info: %s." err)
Expand Down
4 changes: 2 additions & 2 deletions bot-components/GitLab_GraphQL.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module GetRetriedJobs =
[%graphql
{|
[%graphql
{|
query getRetriedJobs($fullPath: ID!, $jobId: JobID!) {
project(fullPath: $fullPath) {
job(id: $jobId) {
Expand Down
Loading

0 comments on commit c3536b9

Please sign in to comment.