Skip to content

Commit 5fc8d37

Browse files
authored
Merge branch 'main' into dependabot/github_actions/julia-actions/julia-format-4
2 parents 50dda0f + 9a8b2d3 commit 5fc8d37

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## Version [v0.1.13] - 2025-04-28
6+
7+
### Fixed
8+
9+
* Setting `JULIAHUB_PROJECT_UUID` to an empty (or whitespace-only) string is now treated the same as unsetting it. ([#92])
10+
511
## Version [v0.1.12] - 2025-04-25
612

713
### Added
@@ -135,6 +141,7 @@ Initial package release.
135141
[v0.1.10]: https://github.com/JuliaComputing/JuliaHub.jl/releases/tag/v0.1.10
136142
[v0.1.11]: https://github.com/JuliaComputing/JuliaHub.jl/releases/tag/v0.1.11
137143
[v0.1.12]: https://github.com/JuliaComputing/JuliaHub.jl/releases/tag/v0.1.12
144+
[v0.1.13]: https://github.com/JuliaComputing/JuliaHub.jl/releases/tag/v0.1.13
138145
[#1]: https://github.com/JuliaComputing/JuliaHub.jl/issues/1
139146
[#2]: https://github.com/JuliaComputing/JuliaHub.jl/issues/2
140147
[#3]: https://github.com/JuliaComputing/JuliaHub.jl/issues/3
@@ -165,3 +172,4 @@ Initial package release.
165172
[#83]: https://github.com/JuliaComputing/JuliaHub.jl/issues/83
166173
[#84]: https://github.com/JuliaComputing/JuliaHub.jl/issues/84
167174
[#86]: https://github.com/JuliaComputing/JuliaHub.jl/issues/86
175+
[#92]: https://github.com/JuliaComputing/JuliaHub.jl/issues/92

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "JuliaHub"
22
uuid = "bc7fa6ce-b75e-4d60-89ad-56c957190b6e"
33
authors = ["JuliaHub Inc."]
4-
version = "0.1.12"
4+
version = "0.1.13"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

src/authentication.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,10 +506,12 @@ _authentication(server::AbstractString; kwargs...) = _authentication(URIs.URI(se
506506
function _juliahub_project(
507507
project::Union{AbstractString, UUIDs.UUID, Nothing, Missing}
508508
)::Union{UUID, Nothing}
509-
project = coalesce(
510-
project,
511-
get(ENV, "JULIAHUB_PROJECT_UUID", nothing),
512-
)
509+
project_env = strip(get(ENV, "JULIAHUB_PROJECT_UUID", ""))
510+
if isempty(project_env)
511+
project_env = nothing
512+
end
513+
project = coalesce(project, project_env)
514+
513515
if isnothing(project)
514516
return nothing
515517
elseif isa(project, UUIDs.UUID)

test/authentication.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,25 @@
77
@test JuliaHub._juliahub_project(nothing) === nothing
88
@test JuliaHub._juliahub_project(missing) === nothing
99
end
10+
withenv("JULIAHUB_PROJECT_UUID" => "") do
11+
@test JuliaHub._juliahub_project(uuid1) == UUIDs.UUID(uuid1)
12+
@test_throws ArgumentError JuliaHub._juliahub_project("invalid")
13+
@test_throws ArgumentError JuliaHub._juliahub_project("")
14+
@test JuliaHub._juliahub_project(nothing) === nothing
15+
@test JuliaHub._juliahub_project(missing) === nothing
16+
end
17+
withenv("JULIAHUB_PROJECT_UUID" => " ") do
18+
@test JuliaHub._juliahub_project(missing) === nothing
19+
end
1020
withenv("JULIAHUB_PROJECT_UUID" => uuid1) do
1121
@test JuliaHub._juliahub_project(uuid2) == UUIDs.UUID(uuid2)
1222
@test_throws ArgumentError JuliaHub._juliahub_project("invalid")
1323
@test JuliaHub._juliahub_project(nothing) === nothing
1424
@test JuliaHub._juliahub_project(missing) === UUIDs.UUID(uuid1)
1525
end
26+
withenv("JULIAHUB_PROJECT_UUID" => " $(uuid1) ") do
27+
@test JuliaHub._juliahub_project(missing) == UUIDs.UUID(uuid1)
28+
end
1629
end
1730

1831
@testset "JuliaHub.authenticate()" begin

0 commit comments

Comments
 (0)