Skip to content

Commit

Permalink
Correctly create statuses on the pull request (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Oct 19, 2019
1 parent 4de1927 commit 2077cca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/AutoMerge/new-package.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +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")))
my_retry(() -> GitHub.create_status(registry, 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 @@ -54,7 +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(() -> GitHub.create_status(registry, 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 @@ -63,7 +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")))
my_retry(() -> GitHub.create_status(registry, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "failure", "context" => "automerge/new-package")))
return nothing
end
else
Expand All @@ -74,7 +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")))
my_retry(() -> GitHub.create_status(registry, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "failure", "context" => "automerge/new-package")))
return nothing
end
else
Expand Down
10 changes: 5 additions & 5 deletions src/AutoMerge/new-version.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function travis_pull_request_build(::NewVersion,
whoami::String)
# first check if authorized author - if not, then quit
# then check rules 1-3. if fail, post comment.
# then check rules 4-5. if fail, post commnet.
# then check rules 4-5. if fail, post comment.
# if everything passed, merge the pull request now
# 1. Sequential version number - if the last version was 1.2.3 then the next can be 1.2.4, 1.3.0 or 2.0.0
# 2. Compat for all dependencies - all [deps] should also have [compat] entries (and Julia itself) - [compat] entries should have upper bounds
Expand All @@ -23,7 +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")))
my_retry(() -> GitHub.create_status(registry, 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 @@ -57,7 +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(() -> GitHub.create_status(registry, 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 @@ -66,7 +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")))
my_retry(() -> GitHub.create_status(registry, current_pr_head_commit_sha; auth=auth, params=Dict("state" => "failure", "context" => "automerge/new-version")))
return nothing
end
else
Expand All @@ -77,7 +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")))
my_retry(() -> GitHub.create_status(registry, 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 2077cca

@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>" 2077cca215f22c6f457f84180421399616484bb3
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>" 2077cca215f22c6f457f84180421399616484bb3
git push origin v0.1.0

Please sign in to comment.