Skip to content

Commit

Permalink
add new command for building toolchain dockers (!ci-toolchain-me)
Browse files Browse the repository at this point in the history
build toolchain dockers in different pipeline
  • Loading branch information
dkijania committed Nov 28, 2023
1 parent 7d11e9b commit aaaa5e7
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Pipeline.build
],
path = "Release",
name = "MinaToolchainArtifactBullseye",
tags = [ PipelineTag.Type.Long, PipelineTag.Type.Release ]
tags = [ PipelineTag.Type.Toolchain ]
},
steps = [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Pipeline.build
],
path = "Release",
name = "MinaToolchainArtifactBuster",
tags = [ PipelineTag.Type.Long, PipelineTag.Type.Release ],
tags = [ PipelineTag.Type.Toolchain ],
mode = PipelineMode.Type.Stable
},
steps = [
Expand Down
4 changes: 3 additions & 1 deletion buildkite/src/Pipeline/Filter.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
let Prelude = ../External/Prelude.dhall
let Tag = ./Tag.dhall

let Filter : Type = < FastOnly | Long | LongAndVeryLong | TearDownOnly | AllTests >
let Filter : Type = < FastOnly | Long | LongAndVeryLong | TearDownOnly | ToolchainsOnly | AllTests >

let tags: Filter -> List Tag.Type = \(filter: Filter) ->
merge {
FastOnly = [ Tag.Type.Fast ]
, LongAndVeryLong = [ Tag.Type.Long, Tag.Type.VeryLong ]
, Long = [ Tag.Type.Long ]
, TearDownOnly = [ Tag.Type.TearDown ]
, ToolchainsOnly = [ Tag.Type.Toolchain ]
, AllTests = [ Tag.Type.Lint, Tag.Type.Release, Tag.Type.Test ]
} filter

Expand All @@ -21,6 +22,7 @@ let show: Filter -> Text = \(filter: Filter) ->
FastOnly = "FastOnly"
, LongAndVeryLong = "LongAndVeryLong"
, Long = "Long"
, ToolchainsOnly = "Toolchain"
, TearDownOnly = "TearDownOnly"
, AllTests = "AllTests"
} filter
Expand Down
7 changes: 5 additions & 2 deletions buildkite/src/Pipeline/Tag.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let Prelude = ../External/Prelude.dhall
let List/any = Prelude.List.any

let Tag : Type = < Fast | Long | VeryLong | TearDown | Lint | Release | Test >
let Tag : Type = < Fast | Long | VeryLong | TearDown | Lint | Release | Test | Toolchain >

let toNatural: Tag -> Natural = \(tag: Tag) ->
merge {
Expand All @@ -16,6 +16,7 @@ let toNatural: Tag -> Natural = \(tag: Tag) ->
, Lint = 5
, Release = 6
, Test = 7
, Toolchain = 8
} tag

let equal: Tag -> Tag -> Bool = \(left: Tag) -> \(right: Tag) ->
Expand All @@ -36,7 +37,8 @@ let capitalName = \(tag : Tag) ->
, TearDown = "TearDown"
, Lint = "Lint"
, Release = "Release"
, Test = "Test"
, Test = "Test"
, Toolchain = "Toolchain"
} tag

let lowerName = \(tag : Tag) ->
Expand All @@ -48,6 +50,7 @@ let lowerName = \(tag : Tag) ->
, Lint = "lint"
, Release = "release"
, Test = "test"
, Toolchain = "toolchain"
} tag


Expand Down
34 changes: 34 additions & 0 deletions frontend/ci-build-me/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,40 @@ const handler = async (event, req) => {
];
}
}

else if (
// we are creating the comment
req.body.action == "created" &&
// and this is actually a pull request
req.body.issue.pull_request &&
req.body.issue.pull_request.url &&
// and the comment contents is exactly the slug we are looking for
req.body.comment.body == "!ci-toolchain-me"
) {
const orgData = await getRequest(req.body.sender.organizations_url);
// and the comment author is part of the core team
if (
orgData.data.filter((org) => org.login == "MinaProtocol").length > 0
) {
const prData = await getRequest(req.body.issue.pull_request.url);
const buildkite = await runBuild(
{
sender: req.body.sender,
pull_request: prData.data,
},
"mina-toolchains-build",
{}
);
return [buildkite];
} else {
// NB: Users that are 'privately' a member of the org will not be able to trigger CI jobs
return [
"comment author is not (publically) a member of the core team",
"comment author is not (publically) a member of the core team",
];
}
}

return null;
};

Expand Down

0 comments on commit aaaa5e7

Please sign in to comment.