Skip to content

Commit

Permalink
dune build @fmt --auto-promote with ocamlformat 0.26.2 (#316)
Browse files Browse the repository at this point in the history
Alternative to #315 
Closes #315
  • Loading branch information
Zimmi48 authored Oct 16, 2024
2 parents 7db6b5a + 8950768 commit 161e914
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 191 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ webhooks coming from the web to this local server.

We use `ocamlformat` to auto-format OCaml and Dune files. If
possible, run it with `dune build @fmt --auto-promote` before
committing. As of today, version 0.15.0 is required.
committing. As of today, version 0.26.2 is required.

You may also configure your editor to auto-format your files on save.
If you are inside a `nix-shell` and using Emacs, you can simply do so
Expand Down
124 changes: 62 additions & 62 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_Cards =
[%graphql
{|
[%graphql
{|
query prCards($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner,name: $repo) {
pullRequest(number: $number) {
Expand All @@ -22,8 +22,8 @@ module PullRequest_Cards =
|}]

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

module PullRequest_Milestone =
[%graphql
{|
[%graphql
{|
query prInfo($pr_id: ID!) {
node(id: $pr_id) {
... on PullRequest {
Expand All @@ -49,8 +49,8 @@ module PullRequest_Milestone =
|}]

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 @@ -65,8 +65,8 @@ module PullRequest_ID_and_Milestone =
|}]

module Milestone_ID =
[%graphql
{|
[%graphql
{|
query milestoneID($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner,name: $repo) {
milestone(number: $number) {
Expand All @@ -77,8 +77,8 @@ module Milestone_ID =
|}]

module TeamMembership =
[%graphql
{|
[%graphql
{|
query teamMember($org: String!, $team: String!, $user: String!) {
organization(login:$org) {
team(slug:$team) {
Expand All @@ -99,8 +99,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 @@ -129,8 +129,8 @@ module PullRequest_Refs =
|}]

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

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

module DefaultBranch =
[%graphql
{|
[%graphql
{|
query defaultBranch($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
defaultBranchRef {
Expand All @@ -215,8 +215,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 @@ -229,8 +229,8 @@ module FileContent =
|}]

module RepoId =
[%graphql
{|
[%graphql
{|
query repoId($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
id
Expand All @@ -239,8 +239,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 @@ -266,8 +266,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 @@ -278,8 +278,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 @@ -299,8 +299,8 @@ query getOpenPullRequestWithLabel($owner: String!, $repo:String!, $label:String!
|}]

module GetPullRequestLabelTimeline =
[%graphql
{|
[%graphql
{|
fragment Label on Label {
name
}
Expand Down Expand Up @@ -331,8 +331,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 @@ -353,8 +353,8 @@ query getPullRequestLabels($owner: String!, $repo:String!, $prNumber: Int!, $cur
|}]

module GetBaseAndHeadChecks =
[%graphql
{|
[%graphql
{|
fragment CheckRuns on CheckRunConnection {
nodes {
name
Expand Down Expand Up @@ -400,8 +400,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 @@ -422,8 +422,8 @@ query getChecks($appId: Int!, $owner: String!, $repo:String!, $head: String!) {
|}]

module GetProjectFieldValues =
[%graphql
{|
[%graphql
{|
query getProjectFieldValues($organization: String!, $project: Int!, $field: String!, $options: [String!]!) {
organization(login: $organization) {
projectV2(number: $project) {
Expand All @@ -445,8 +445,8 @@ query getProjectFieldValues($organization: String!, $project: Int!, $field: Stri
(* Mutations *)

module AddCardToProject =
[%graphql
{|
[%graphql
{|
mutation addCard($card_id:ID!, $project_id: ID!) {
addProjectV2ItemById(input:{contentId:$card_id,projectId:$project_id}) {
item {
Expand All @@ -457,8 +457,8 @@ module AddCardToProject =
|}]

module UpdateFieldValue =
[%graphql
{|
[%graphql
{|
mutation updateFieldValue($card_id:ID!, $project_id: ID!, $field_id: ID!, $field_value_id: String!) {
updateProjectV2ItemFieldValue(input: {projectId: $project_id, itemId: $card_id, fieldId: $field_id, value: {singleSelectOptionId: $field_value_id}}) {
clientMutationId
Expand All @@ -467,8 +467,8 @@ module UpdateFieldValue =
|}]

module CreateNewReleaseManagementField =
[%graphql
{|
[%graphql
{|
mutation createNewField($project_id: ID!, $field: String!) {
createProjectV2Field(input: {projectId: $project_id, dataType: SINGLE_SELECT, name: $field, singleSelectOptions: [{name: "Request inclusion", color: GREEN, description: "This merged pull request is proposed for inclusion."}, {name: "Shipped", color: PURPLE, description: "This pull request has been backported (or merged directly in the release branch)."}, {name: "Rejected", color: RED, description: "This merged pull request will not be included in this release."}]}) {
projectV2Field {
Expand All @@ -485,8 +485,8 @@ module CreateNewReleaseManagementField =
|}]
module PostComment =
[%graphql
{|
[%graphql
{|
mutation addComment($id:ID!,$message:String!) {
payload: addComment(input:{subjectId:$id,body:$message}) {
commentEdge {
Expand All @@ -499,8 +499,8 @@ module PostComment =
|}]
module UpdateMilestone =
[%graphql
{|
[%graphql
{|
mutation updateMilestone($issue: ID!, $milestone: ID!) {
updateIssue(input: {id: $issue, milestoneId: $milestone}) {
clientMutationId
Expand All @@ -509,8 +509,8 @@ module UpdateMilestone =
|}]
module MergePullRequest =
[%graphql
{|
[%graphql
{|
mutation mergePullRequest($pr_id: ID!, $commit_headline: String,
$commit_body: String, $merge_method: PullRequestMergeMethod) {
mergePullRequest(
Expand All @@ -527,8 +527,8 @@ module MergePullRequest =
|}]
module ClosePullRequest =
[%graphql
{|
[%graphql
{|
mutation closePullRequest($pr_id: ID!) {
closePullRequest(
input: {pullRequestId: $pr_id}) {
Expand All @@ -540,8 +540,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 @@ -551,8 +551,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 @@ -562,8 +562,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 @@ -590,8 +590,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
2 changes: 1 addition & 1 deletion bot-components/GitHub_queries.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1026,4 +1026,4 @@ let get_artifact_blob ~bot_info ~owner ~repo ~artifact_id =
generic_get_zip ~bot_info
(f "repos/%s/%s/actions/artifacts/%s/zip" owner repo artifact_id)
(let open Zip in
List.map ~f:(fun (entry, contents) -> (entry.filename, contents)) )
List.map ~f:(fun (entry, contents) -> (entry.filename, contents)) )
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
3 changes: 1 addition & 2 deletions bot-components/GraphQL_query.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ let send_graphql_query ~bot_info ?(extra_headers = []) ~api ~query ~parse
| errors ->
let errors =
to_list errors
|> List.map ~f:(fun error ->
error |> member "message" |> to_string )
|> List.map ~f:(fun error -> error |> member "message" |> to_string)
in
Error
( "Server responded to GraphQL request with errors: "
Expand Down
Loading

0 comments on commit 161e914

Please sign in to comment.