Skip to content

Commit

Permalink
Remove the pr_title_suffix keyword argument
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge committed Nov 30, 2020
1 parent bdb95aa commit 5fc71ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
16 changes: 6 additions & 10 deletions src/bump-stdlibs.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
"""
bump_stdlibs(julia_repo;
auth = get_auth_from_environment(),
julia_repo_default_branch::Union{AbstractString, Nothing} = nothing,
pr_title_suffix::AbstractString = "",
pr_branch_suffix::AbstractString = "",
stdlibs_to_include::Union{AbstractString, AbstractVector{<:AbstractString}} = get_stdlibs_to_include_from_environment())
auth = get_auth_from_environment(),
julia_repo_default_branch::Union{AbstractString, Nothing} = nothing,
pr_branch_suffix::AbstractString = "",
stdlibs_to_include::Union{AbstractString, AbstractVector{<:AbstractString}} = get_stdlibs_to_include_from_environment())
"""
function bump_stdlibs(julia_repo;
auth = get_auth_from_environment(),
julia_repo_default_branch::Union{AbstractString, Nothing} = nothing,
pr_title_suffix::AbstractString = "",
pr_branch_suffix::AbstractString = "",
stdlibs_to_include::Union{AbstractString, AbstractVector{<:AbstractString}} = get_stdlibs_to_include_from_environment())
repo_regex = r"^([\w\-\_]*?)\/([\w]*?)$"
Expand Down Expand Up @@ -50,7 +48,6 @@ function bump_stdlibs(julia_repo;
stdlib;
auth,
fork_julia_repo_gh,
pr_title_suffix,
pr_branch_suffix,
upstream_julia_repo_default_branch,
upstream_julia_repo_gh,
Expand All @@ -63,7 +60,6 @@ end
function _bump_single_stdlib(stdlib::StdlibInfo;
auth,
fork_julia_repo_gh,
pr_title_suffix,
pr_branch_suffix,
upstream_julia_repo_default_branch,
upstream_julia_repo_gh)
Expand Down Expand Up @@ -95,8 +91,8 @@ function _bump_single_stdlib(stdlib::StdlibInfo;
cd("FORK")
run(`git checkout $(upstream_julia_repo_default_branch)`)
assert_current_branch_is(upstream_julia_repo_default_branch)
pr_title = "🤖 Bump the $(name) stdlib to $(stdlib_latest_commit_short)$(pr_title_suffix)"
commit_message = "🤖 Bump the $(name) stdlib to $(stdlib_latest_commit)$(pr_title_suffix)"
pr_title = "🤖 Bump the $(name) stdlib to $(stdlib_latest_commit_short)"
commit_message = "🤖 Bump the $(name) stdlib to $(stdlib_latest_commit)"
pr_branch = "BumpStdlibs/$(name)-$(stdlib_latest_commit_short)$(pr_branch_suffix)"
pr_body = string(
"```\n",
Expand Down
13 changes: 4 additions & 9 deletions test/integration-tests.jl
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
@testset "integration tests" begin
julia_repo = "bcbi-test/julia"
auth = BumpStdlibs.get_auth_from_environment("BUMPSTDLIBS_TOKEN_FOR_TESTS")
suffix = Random.randstring(16)
pr_title_suffix = " $(suffix)"
pr_branch_suffix = "-$(suffix)"
pr_branch_suffix = "-$(Random.randstring(16))"

@testset "all stdlibs" begin
@testset "all stdlibs" begin
stdlibs_to_include = "all"
result = bump_stdlibs(
julia_repo;
auth = auth,
pr_branch_suffix = pr_branch_suffix,
pr_title_suffix = pr_title_suffix,
stdlibs_to_include = stdlibs_to_include,
)
@test result isa Nothing
end

@testset "only specified stdlibs" begin
@testset "only specified stdlibs" begin
stdlibs_to_include = "Pkg"
result = bump_stdlibs(
julia_repo;
auth = auth,
pr_branch_suffix = pr_branch_suffix,
pr_title_suffix = pr_title_suffix,
stdlibs_to_include = stdlibs_to_include,
)
@test result isa Nothing
end

@testset "Override the default branch" begin
@testset "Override the default branch" begin
julia_repo_default_branch = "master"
stdlibs_to_include = "Pkg"
result = bump_stdlibs(
julia_repo;
auth = auth,
pr_branch_suffix = pr_branch_suffix,
pr_title_suffix = pr_title_suffix,
stdlibs_to_include = stdlibs_to_include,
)
@test result isa Nothing
Expand Down

0 comments on commit 5fc71ae

Please sign in to comment.