New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bors: require that Buildkite passes on Julia nightly #181
Closed
Conversation
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
For posterity, here is how I generated this list: (click to expand)Step 1: Save the following code in a file named import GitHub
const BRANCH_OR_COMMIT = Union{GitHub.Branch, GitHub.Commit}
struct AlwaysAssertionError
msg::String
end
function always_assert(condition::Bool, msg::String)
if !condition
throw(AlwaysAssertionError(msg))
end
return nothing
end
function _get_branch(repo;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization,
branch)
return GitHub.branch(api, repo, branch; auth = auth)
end
function _get_commit(repo;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization,
commit)
return GitHub.commit(api, repo, commit; auth = auth)
end
function _get_commit_or_branch(repo;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization,
branch = nothing,
commit = nothing)
if (branch isa Nothing) && (commit isa Nothing)
msg = string(
"You must provide either ",
"the branch or the commit",
)
throw(ArgumentError(msg))
elseif (!(branch isa Nothing)) && (!(commit isa Nothing))
msg = string(
"You cannot provide both ",
"a branch and a commit. ",
"You must provide exactly one.",
)
throw(ArgumentError(msg))
elseif (!(branch isa Nothing))
return _get_branch(repo; api=api, auth=auth, branch=branch)
else
always_assert(!(commit isa Nothing), "!(commit isa Nothing)")
return _get_commit(repo; api = api, auth = auth, commit = commit)
end
end
function get_statuses(repo;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization,
branch,
commit)
branch_or_commit = _get_commit_or_branch(
repo;
api = api,
auth = auth,
branch = branch,
commit = commit,
)
return get_statuses(repo, branch_or_commit; api, auth)
end
function get_statuses(repo,
branch_or_commit::BRANCH_OR_COMMIT;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization)
combined_status = GitHub.status(
api,
repo,
branch_or_commit;
auth = auth,
)
combined_status_statuses = combined_status.statuses
statuses, _ = GitHub.statuses(
api,
repo,
branch_or_commit;
auth = auth,
)
status_contexts = vcat(
[x.context for x in combined_status_statuses],
[x.context for x in statuses],
)
unique!(status_contexts)
sort!(status_contexts)
return status_contexts
end
function _convert_to_commit(repo,
branch::GitHub.Branch;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization)
commit = GitHub.commit(api, repo, branch; auth = auth)
return commit
end
function _convert_to_commit(repo,
commit::GitHub.Commit;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization)
return commit
end
function _get_commit_sha_from_commit(commit::GitHub.Commit)
return commit.sha
end
function get_check_runs(repo;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization,
branch,
commit)
return nothing
end
function get_check_runs(repo,
branch_or_commit::BRANCH_OR_COMMIT;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization)
commit = _convert_to_commit(
repo,
branch_or_commit;
api = api,
auth = auth,
)
commit_sha = _get_commit_sha_from_commit(commit)
endpoint = "/repos/$(repo.full_name)/commits/$(commit_sha)/check-runs"
check_runs = GitHub.gh_get_json(
api,
endpoint;
auth = auth,
)
check_run_names = [x["name"] for x in check_runs["check_runs"]]
unique!(check_run_names)
sort!(check_run_names)
return check_run_names
end
function get_statuses_and_check_runs(repo;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization,
branch,
commit)
status_contexts_and_check_run_names = get_statuses_and_check_runs(
repo,
branch_or_commit;
api = api,
auth = auth)
unique!(status_contexts_and_check_run_names)
sort!(status_contexts_and_check_run_names)
return status_contexts_and_check_run_names
end
function get_statuses_and_check_runs(repo,
branch_or_commit::BRANCH_OR_COMMIT;
api::GitHub.GitHubAPI,
auth::GitHub.Authorization)
status_contexts = get_statuses(
repo,
branch_or_commit;
api = api,
auth = auth,
)
check_run_names = get_check_runs(
repo,
branch_or_commit;
api = api,
auth = auth,
)
status_contexts_and_check_run_names = vcat(
status_contexts,
check_run_names,
)
unique!(status_contexts_and_check_run_names)
sort!(status_contexts_and_check_run_names)
return status_contexts_and_check_run_names
end Step 2: Open a Julia REPL and run the following: (change include("get-github-status-list.jl")
import GitHub
api = GitHub.DEFAULT_API
auth = GitHub.AnonymousAuth()
repo = GitHub.repo(api, "JuliaGPU/KernelAbstractions.jl"; auth = auth);
branch_name = "master"
branch = _get_commit_or_branch(repo; api = api, auth = auth, branch = branch_name);
@show get_statuses_and_check_runs(repo, branch; api = api, auth = auth) Here is the output that I receive: (change julia> include("get-github-status-list.jl")
get_statuses_and_check_runs (generic function with 2 methods)
julia> import GitHub
julia> api = GitHub.DEFAULT_API
GitHub.GitHubWebAPI(URI("https://api.github.com"))
julia> auth = GitHub.AnonymousAuth()
GitHub.AnonymousAuth()
julia> auth = GitHub.authenticate(ENV["GITHUB_TOKEN"])
GitHub.OAuth2(475be0**********************************)
julia> repo = GitHub.repo(api, "JuliaGPU/KernelAbstractions.jl"; auth = auth);
julia> branch_name = "master"
"master"
julia> branch = _get_commit_or_branch(repo; api = api, auth = auth, branch = branch_name);
julia> @show get_statuses_and_check_runs(repo, branch; api = api, auth = auth)
get_statuses_and_check_runs(repo, branch; api = api, auth = auth) = ["CI (1, macOS-latest, x64)", "CI (1, ubuntu-latest, x64)", "CI (1, windows-latest, x64)", "CI (1.3, macOS-latest, x64)", "CI (1.3, ubuntu-latest, x64)", "CI (1.3, windows-latest, x64)", "CI (1.4, macOS-latest, x64)", "CI (1.4, ubuntu-latest, x64)", "CI (1.4, windows-latest, x64)", "CI (1.5, macOS-latest, x64)", "CI (1.5, ubuntu-latest, x64)", "CI (1.5, windows-latest, x64)", "CI-julia-nightly (nightly, macOS-latest, x64)", "CI-julia-nightly (nightly, ubuntu-latest, x64)", "CI-julia-nightly (nightly, windows-latest, x64)", "Doctests", "Documentation", "buildkite/kernelabstractions-dot-jl", "buildkite/kernelabstractions-dot-jl/julia-1-dot-5", "buildkite/kernelabstractions-dot-jl/julia-nightly", "buildkite/kernelabstractions-dot-jl/pipeline", "documenter/deploy"]
22-element Vector{String}:
"CI (1, macOS-latest, x64)"
"CI (1, ubuntu-latest, x64)"
"CI (1, windows-latest, x64)"
"CI (1.3, macOS-latest, x64)"
"CI (1.3, ubuntu-latest, x64)"
"CI (1.3, windows-latest, x64)"
"CI (1.4, macOS-latest, x64)"
"CI (1.4, ubuntu-latest, x64)"
"CI (1.4, windows-latest, x64)"
"CI (1.5, macOS-latest, x64)"
"CI (1.5, ubuntu-latest, x64)"
"CI (1.5, windows-latest, x64)"
"CI-julia-nightly (nightly, macOS-latest, x64)"
"CI-julia-nightly (nightly, ubuntu-latest, x64)"
"CI-julia-nightly (nightly, windows-latest, x64)"
"Doctests"
"Documentation"
"buildkite/kernelabstractions-dot-jl"
"buildkite/kernelabstractions-dot-jl/julia-1-dot-5"
"buildkite/kernelabstractions-dot-jl/julia-nightly"
"buildkite/kernelabstractions-dot-jl/pipeline"
"documenter/deploy" |
DilumAluthge
force-pushed
the
dpa/bors-statuses-buildkite-github-actions
branch
from
January 8, 2021 05:46
a257100
to
8a22b41
Compare
DilumAluthge
force-pushed
the
dpa/bors-statuses-buildkite-github-actions
branch
2 times, most recently
from
January 8, 2021 08:44
f16fa22
to
9515e22
Compare
DilumAluthge
changed the title
Bors: require that GHA and Buildkite pass on Julia nightly
Bors: require that Buildkite passes on Julia nightly
Jan 8, 2021
DilumAluthge
force-pushed
the
dpa/bors-statuses-buildkite-github-actions
branch
from
January 8, 2021 09:31
9515e22
to
35e44c1
Compare
bors try |
tryBuild failed: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.