Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions scripts/release/finish.jl
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ function finish(repo::AbstractString; managers::AbstractString, act::Symbol=:ste
requester = main = nothing
r = f.pr.state == "OPEN" ? ready(repo, f.pr.number) : nothing
end
run = haskey(ENV, "GITHUB_RUN_ID") ?
"$(get(ENV, "GITHUB_SERVER_URL", "https://github.com"))/$repo/actions/runs/$(ENV["GITHUB_RUN_ID"])" : ""
run = run_url(repo)
# the bot refused the comment: the stop shows it, for a person to post
handover = if p.phase == 7 && p.state === :blocked && get(f, :bot_error, nothing) !== nothing && live_mentions(f) == 0
body, target = registration_comment(repo, f, f.main_sha != f.pr.merge)
Expand Down
9 changes: 8 additions & 1 deletion scripts/release/start.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ function review_table(r)
join(("| `$(x["id"])`: $(replace(get(x, "what", ""), "|" => "\\|")) | $(x["verdict"]) | $(replace(get(x, "note", ""), "|" => "\\|")) |" for x in rows), '\n')
end

"The URL of the workflow run this process is in (`GITHUB_RUN_ID`), `\"\"` outside a run: where a person approves."
run_url(repo::AbstractString) = haskey(ENV, "GITHUB_RUN_ID") ?
"$(get(ENV, "GITHUB_SERVER_URL", "https://github.com"))/$repo/actions/runs/$(ENV["GITHUB_RUN_ID"])" : ""

"""
open_issue(repo, dir, version; actor, managers, tries=12, pause=5) -> (Bool, String)

Expand Down Expand Up @@ -139,12 +143,15 @@ function open_issue(repo::AbstractString, dir, version; actor, managers::Abstrac
f = facts(repo; version=v)
end
f.issue === nothing && return (true, "opened #$n; GitHub does not list it yet: the next run posts the proposal")
run = run_url(repo)
approval = mode === :supervised ?
", after an approval of the environment `release`" * (isempty(run) ? "" : " ([this run]($run), *Review deployments*)") : ""
comment = """
**Phase 2 — Tracking issue.**
Done: the tracking issue, from the request.
Decisions: $(f.kind) `$v`, $mode, validated by `$(rel["requested_by"])`; started by `$actor`. Versions applied: ct-agents `$(r["versions"]["ct_agents"])`, ct-conventions `$(r["versions"]["ct_conventions"])`, CTActions `$(r["versions"]["ctactions"])`.
Check: `release.jl request` → the request is complete (expected version, a verdict for every candidate).
Next: the release PR, once the CI of `main` is green on `$(rel["base"])`$(mode === :supervised ? ", after an approval of the environment `release`" : "").
Next: the release PR, once the CI of `main` is green on `$(rel["base"])`$approval.

<details><summary>The proposal</summary>

Expand Down
9 changes: 9 additions & 0 deletions scripts/release/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,15 @@ failures(results) = [r.message for r in results if r.status === :fail]
end
end

@testset "the run to approve on (run_url)" begin
withenv("GITHUB_RUN_ID" => nothing) do
@test run_url("o/P") == ""
end
withenv("GITHUB_RUN_ID" => "42", "GITHUB_SERVER_URL" => nothing) do
@test run_url("o/P") == "https://github.com/o/P/actions/runs/42"
end
end

@testset "the release commit and the CI of main (phase 3)" begin
dir = mktempdir()
write(joinpath(dir, "Project.toml"), "name = \"P\"\nversion = \"0.8.17-beta\"\n\n[compat]\nversion = \"1\"\n")
Expand Down
Loading