Skip to content
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

Remove the pr_title_suffix keyword argument #18

Merged
merged 1 commit into from
Nov 30, 2020
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
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