Skip to content

Commit

Permalink
Merge pull request #35 from JuliaRegistries/da/status
Browse files Browse the repository at this point in the history
Post GitHub Statuses
  • Loading branch information
DilumAluthge authored Oct 19, 2019
2 parents 2911643 + 5b90f45 commit 4de1927
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AutoMerge/new-package.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function travis_pull_request_build(::NewPackage,
if is_open(pr)
if pr_author_login in authorized_authors
my_retry(() -> delete_all_of_my_reviews!(registry, pr; auth = auth, whoami = whoami))
my_retry(() -> GitHub.create_status(repo, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "pending", "context" => "automerge/new-package")))
g0, m0 = pr_only_changes_allowed_files(NewPackage(), registry, pr, pkg; auth = auth)
newp_g1, newp_m1 = meets_normal_capitalization(pkg)
newp_g2, newp_m2 = meets_name_length(pkg)
Expand Down Expand Up @@ -53,6 +54,7 @@ function travis_pull_request_build(::NewPackage,
version)
my_retry(() -> delete_all_of_my_reviews!(registry, pr; auth = auth, whoami = whoami))
my_retry(() -> approve!(registry, pr, current_pr_head_commit_sha; auth = auth))
my_retry(() -> GitHub.create_status(repo, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "success", "context" => "automerge/new-package")))
my_retry(() -> post_comment!(registry, pr, newp_commenttextpass; auth = auth))
return nothing
else
Expand All @@ -61,6 +63,7 @@ function travis_pull_request_build(::NewPackage,
suggest_onepointzero,
version)
my_retry(() -> post_comment!(registry, pr, newp_commenttext6and7; auth = auth))
my_retry(() -> GitHub.create_status(repo, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "failure", "context" => "automerge/new-package")))
return nothing
end
else
Expand All @@ -71,6 +74,7 @@ function travis_pull_request_build(::NewPackage,
suggest_onepointzero,
version)
my_retry(() -> post_comment!(registry, pr, newp_commenttext0through5; auth = auth))
my_retry(() -> GitHub.create_status(repo, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "failure", "context" => "automerge/new-package")))
return nothing
end
else
Expand Down
4 changes: 4 additions & 0 deletions src/AutoMerge/new-version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function travis_pull_request_build(::NewVersion,
if is_open(pr)
if pr_author_login in authorized_authors
my_retry(() -> delete_all_of_my_reviews!(registry, pr; auth = auth, whoami = whoami))
my_retry(() -> GitHub.create_status(repo, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "pending", "context" => "automerge/new-version")))
g0, m0 = pr_only_changes_allowed_files(NewVersion(), registry, pr, pkg; auth = auth)
newv_g1, newv_m1, release_type = meets_sequential_version_number(pkg,
version;
Expand Down Expand Up @@ -56,6 +57,7 @@ function travis_pull_request_build(::NewVersion,
version)
my_retry(() -> delete_all_of_my_reviews!(registry, pr; auth = auth, whoami = whoami))
my_retry(() -> approve!(registry, pr, current_pr_head_commit_sha; auth = auth))
my_retry(() -> GitHub.create_status(repo, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "success", "context" => "automerge/new-version")))
my_retry(() -> post_comment!(registry, pr, newv_commenttextpass; auth = auth))
return nothing
else
Expand All @@ -64,6 +66,7 @@ function travis_pull_request_build(::NewVersion,
suggest_onepointzero,
version)
my_retry(() -> post_comment!(registry, pr, newv_commenttext4and5; auth = auth))
my_retry(() -> GitHub.create_status(repo, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "failure", "context" => "automerge/new-version")))
return nothing
end
else
Expand All @@ -74,6 +77,7 @@ function travis_pull_request_build(::NewVersion,
suggest_onepointzero,
version)
my_retry(() -> post_comment!(registry, pr, newv_commenttext1through3; auth = auth))
my_retry(() -> GitHub.create_status(repo, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "failure", "context" => "automerge/new-version")))
return nothing
end
else
Expand Down

4 comments on commit 4de1927

@DilumAluthge
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/4441

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 4de19276514d81e36c221b110268b270689c3031
git push origin v0.1.0

@DilumAluthge
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/4441

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 4de19276514d81e36c221b110268b270689c3031
git push origin v0.1.0

Please sign in to comment.