probcomp / Gen.jl

A general-purpose probabilistic programming system with programmable inference
https://gen.dev
Apache License 2.0
1.79k stars 160 forks source link

Documentation Github job is skipping deployment to gh-pages on merge to master #489

Closed fsaad closed 1 year ago

fsaad commented 1 year ago

https://github.com/probcomp/Gen.jl/actions/runs/3447094686/jobs/5752744282

 > running doctests.
 > checking footnote links.
Documenter: populating indices.
Documenter: rendering document.
 !! Invalid local link: unresolved path
    '@ref' in ref/gfi.md
 !! Invalid local link: unresolved path
    '@ref' in ref/modeling.md
 !! Invalid local link: unresolved path
    '@ref' in ref/modeling.md
 !! Invalid local link: unresolved path
    '@ref' in ref/modeling.md
 !! Invalid local link: unresolved path
    '@ref' in ref/modeling.md
 !! Invalid local link: unresolved path
    '@ref' in ref/modeling.md
 !! Invalid local link: unresolved path
    '@ref' in ref/modeling.md
 !! Invalid local link: unresolved path
    '@ref' in ref/trace_translators.md
 !! Invalid local link: unresolved path
    '@ref' in ref/trace_translators.md
 !! Invalid local link: unresolved path
    '@ref' in ref/trace_translators.md
 !! Invalid local link: unresolved path
    '@ref' in ref/trace_translators.md
 !! Invalid local link: unresolved path
    '@ref' in ref/mcmc.md
 !! Invalid local link: unresolved path
    '@ref' in ref/mcmc.md
 !! Invalid local link: unresolved path
    '@ref' in ref/learning.md
 !! Invalid local link: unresolved path
    '@ref' in ref/learning.md
 !! Invalid local link: unresolved path
    '@ref' in ref/internals/language_implementation.md
Documenter: skipping docs deployment.
Documenter: You can set DOCUMENTER_DEBUG to "true" in Travis to see more information.
fsaad commented 1 year ago

With longer debug log https://github.com/probcomp/Gen.jl/actions/runs/3447242347/jobs/5753048106

 ??   deploying if branch equal to "master" (kwarg: devbranch) or tag is set
 ?? git commit SHA         = 6fe74f8
 ?? DOCUMENTER_KEY exists  = false
 ?? should_deploy          = false
Documenter: skipping docs deployment.
ztangent commented 1 year ago

I think the solution here might be to remove the following line, so that it uses the Github secret instead?

https://github.com/probcomp/Gen.jl/blob/6fe74f8429cbaafb2a0a04f0c54043120204ac01/.github/workflows/Documentation.yml#L28

That's what I did when I set up the Documenter action for PDDL.jl anyway.

ztangent commented 1 year ago

Separately, we should fix whatever is causing this error in index.md:

Failed to parse expression.

ERROR: Base.Meta.ParseError("missing separator in array expression")
fsaad commented 1 year ago

Both setting the DOCUMENTER_KEY (through a Github SSH secret) and removing the DOCUMENTER_KEY line give

 ?? should_deploy          = false
fsaad commented 1 year ago

@ztangent Did you configure any keys or secrets in: https://github.com/JuliaPlanners/PDDL.jl/settings/pages https://github.com/JuliaPlanners/PDDL.jl/settings/keys https://github.com/JuliaPlanners/PDDL.jl/settings/secrets

ztangent commented 1 year ago

Weird! And no I didn't -- as far as I can tell, the GITHUB_TOKEN secret is automatically created: https://docs.github.com/en/actions/security-guides/automatic-token-authentication

ztangent commented 1 year ago

So here's what I suspect is happening based on the log files mentioning Travis environment variabless -- somehow Documenter.jl is still thinking we're using Travis based on some environment variable during its auto-detection step:

https://github.com/JuliaDocs/Documenter.jl/blob/e02594f6d03dd86f7545c05ca6574987c92e18e0/src/deployconfig.jl#L1064-L1083

function auto_detect_deploy_system()
    if haskey(ENV, "TRAVIS_REPO_SLUG")
        return Travis()
    elseif haskey(ENV, "GITHUB_REPOSITORY")
        return GitHubActions()
    elseif haskey(ENV, "GITLAB_CI")
        return GitLab()
    elseif haskey(ENV, "BUILDKITE")
        return Buildkite()
    elseif get(ENV, "CI", nothing) in ["drone", "woodpecker"]
        if ENV["CI"] == "drone"
            @warn """Woodpecker is backward compatible to Drone 
            but *there will be breaking changes in the future*"""
        end
        return Woodpecker()
    else
        return nothing
    end
end
ztangent commented 1 year ago

Alternatively, we may be using a version of Documenter.jl that's too old to support Github Actions?

ztangent commented 1 year ago

Yes -- it looks like the version of Documenter.jl is the issue. If you look at docs/Project.toml, we're requiring Documenter.jl v0.20, but the docs for Documenter.jl v0.20 don't mention anything about Github Actions, nor does the code:

https://documenter.juliadocs.org/v0.20/man/hosting/

fsaad commented 1 year ago

Alternatively, we may be using a version of Documenter.jl that's too old to support Github Actions?

Right I also suspected that might be the case and pushed a commit to use 0.27, based on your config for PPDL.jl. Hopefully it will work now.

ztangent commented 1 year ago

Looks like we have to fix the call to makedocs to fit the new 0.27 format!

fsaad commented 1 year ago

I am testing it locally and hope to have a fix momentarily.

fsaad commented 1 year ago

It seems that Documenter 0.27 calls doctest automatically, which we did not invoke before, revealing a flurry of new problems.

[ Info: Doctest: running doctests.
┌ Error: doctest failure in ~/Gen/src/choice_map.jl:929-946
│ 
│ ```jldoctest
│ julia> using Gen
│ julia> c = choicemap((:a, 1),
│                      (:b => :c, 2));
│ julia> cv = nested_view(c);
│ julia> c[:a] == cv[:a]
│ true
│ julia> c[:b => :c] == cv[:b][:c]
│ true
│ julia> length(cv)
│ 2
│ julia> length(cv[:b])
│ 1
│ julia> sort(collect(keys(cv)))
│ [:a, :b]
│ julia> sort(collect(keys(cv[:b])))
│ [:c]
│ ```
│ 
│ Subexpression:
│ 
│ c[:a] == cv[:a]
│ 
│ Evaluated output:
│ 
│ ERROR: UndefVarError: c not defined
│ Stacktrace:
│  [1] top-level scope
│    @ none:1
│ 
│ Expected output:
│ 
│ using Gen
│ 
│   diff =
│    using GenERROR: UndefVarError: c not defined
│    Stacktrace:
│     [1] top-level scope
│       @ none:1
└ @ Documenter.DocTests ~/Gen/src/choice_map.jl:929
┌ Error: doctest failure in ~/Gen/src/choice_map.jl:929-946
│ 
│ ```jldoctest
│ julia> using Gen
│ julia> c = choicemap((:a, 1),
│                      (:b => :c, 2));
│ julia> cv = nested_view(c);
│ julia> c[:a] == cv[:a]
│ true
│ julia> c[:b => :c] == cv[:b][:c]
│ true
│ julia> length(cv)
│ 2
│ julia> length(cv[:b])
│ 1
│ julia> sort(collect(keys(cv)))
│ [:a, :b]
│ julia> sort(collect(keys(cv[:b])))
│ [:c]
│ ```
│ 
│ Subexpression:
│ 
│ c[:b => :c] == cv[:b][:c]
│ 
│ Evaluated output:
│ 
│ ERROR: UndefVarError: c not defined
│ Stacktrace:
│  [1] top-level scope
│    @ none:1
│ 
│ Expected output:
│ 
│ c = choicemap((:a, 1),
│               (:b => :c, 2));
│ 
│   diff =
│    ERROR: UndefVarError: c = choicemap((:a, 1),
│                  (:b => :c, 2));not defined
│    Stacktrace:
│     [1] top-level scope
│       @ none:1
└ @ Documenter.DocTests ~/Gen/src/choice_map.jl:929
┌ Error: doctest failure in ~/Gen/src/choice_map.jl:929-946
│ 
│ ```jldoctest
│ julia> using Gen
│ julia> c = choicemap((:a, 1),
│                      (:b => :c, 2));
│ julia> cv = nested_view(c);
│ julia> c[:a] == cv[:a]
│ true
│ julia> c[:b => :c] == cv[:b][:c]
│ true
│ julia> length(cv)
│ 2
│ julia> length(cv[:b])
│ 1
│ julia> sort(collect(keys(cv)))
│ [:a, :b]
│ julia> sort(collect(keys(cv[:b])))
│ [:c]
│ ```
│ 
│ Subexpression:
│ 
│ length(cv)
│ 
│ Evaluated output:
│ 
│ ERROR: UndefVarError: cv not defined
│ Stacktrace:
│  [1] top-level scope
│    @ none:1
│ 
│ Expected output:
│ 
│ cv = nested_view(c);
│ 
│   diff =
│    ERROR: UndefVarError: cv = nested_view(c);not defined
│    Stacktrace:
│     [1] top-level scope
│       @ none:1
└ @ Documenter.DocTests ~/Gen/src/choice_map.jl:929
┌ Error: doctest failure in ~/Gen/src/choice_map.jl:929-946
│ 
│ ```jldoctest
│ julia> using Gen
│ julia> c = choicemap((:a, 1),
│                      (:b => :c, 2));
│ julia> cv = nested_view(c);
│ julia> c[:a] == cv[:a]
│ true
│ julia> c[:b => :c] == cv[:b][:c]
│ true
│ julia> length(cv)
│ 2
│ julia> length(cv[:b])
│ 1
│ julia> sort(collect(keys(cv)))
│ [:a, :b]
│ julia> sort(collect(keys(cv[:b])))
│ [:c]
│ ```
│ 
│ Subexpression:
│ 
│ length(cv[:b])
│ 
│ Evaluated output:
│ 
│ ERROR: UndefVarError: cv not defined
│ Stacktrace:
│  [1] top-level scope
│    @ none:1
│ 
│ Expected output:
│ 
│ true
│ 
│   diff =
│    trueERROR: UndefVarError: cv not defined
│    Stacktrace:
│     [1] top-level scope
│       @ none:1
└ @ Documenter.DocTests ~/Gen/src/choice_map.jl:929
┌ Error: doctest failure in ~/Gen/src/choice_map.jl:929-946
│ 
│ ```jldoctest
│ julia> using Gen
│ julia> c = choicemap((:a, 1),
│                      (:b => :c, 2));
│ julia> cv = nested_view(c);
│ julia> c[:a] == cv[:a]
│ true
│ julia> c[:b => :c] == cv[:b][:c]
│ true
│ julia> length(cv)
│ 2
│ julia> length(cv[:b])
│ 1
│ julia> sort(collect(keys(cv)))
│ [:a, :b]
│ julia> sort(collect(keys(cv[:b])))
│ [:c]
│ ```
│ 
│ Subexpression:
│ 
│ sort(collect(keys(cv)))
│ 
│ Evaluated output:
│ 
│ ERROR: UndefVarError: cv not defined
│ Stacktrace:
│  [1] top-level scope
│    @ none:1
│ 
│ Expected output:
│ 
│ true
│ 
│   diff =
│    trueERROR: UndefVarError: cv not defined
│    Stacktrace:
│     [1] top-level scope
│       @ none:1
└ @ Documenter.DocTests ~/Gen/src/choice_map.jl:929
┌ Error: doctest failure in ~/Gen/src/choice_map.jl:929-946
│ 
│ ```jldoctest
│ julia> using Gen
│ julia> c = choicemap((:a, 1),
│                      (:b => :c, 2));
│ julia> cv = nested_view(c);
│ julia> c[:a] == cv[:a]
│ true
│ julia> c[:b => :c] == cv[:b][:c]
│ true
│ julia> length(cv)
│ 2
│ julia> length(cv[:b])
│ 1
│ julia> sort(collect(keys(cv)))
│ [:a, :b]
│ julia> sort(collect(keys(cv[:b])))
│ [:c]
│ ```
│ 
│ Subexpression:
│ 
│ sort(collect(keys(cv[:b])))
│ 
│ Evaluated output:
│ 
│ ERROR: UndefVarError: cv not defined
│ Stacktrace:
│  [1] top-level scope
│    @ none:1
│ 
│ Expected output:
│ 
│ 2
│ 
│   diff =
│    2ERROR: UndefVarError: cv not defined
│    Stacktrace:
│     [1] top-level scope
│       @ none:1
└ @ Documenter.DocTests ~/Gen/src/choice_map.jl:929
┌ Error: doctest failure in ~/Gen/src/modeling_library/distributions/normal.jl:46-52
│ 
│ ```jldoctest
│ julia> typeof(ones())
│ Array{Float64,0}
│ 
│ julia> typeof(ones() .* ones())
│ Float64
│ ```
│ 
│ Subexpression:
│ 
│ typeof(ones())
│ 
│ Evaluated output:
│ 
│ Array{Float64, 0}
│ 
│ Expected output:
│ 
│ Array{Float64,0}
│ 
│   diff = Array{Float64,0}Array{Float64, 0}
└ @ Documenter.DocTests ~/Gen/src/modeling_library/distributions/normal.jl:46
fsaad commented 1 year ago

It seems we are in business now https://github.com/probcomp/Gen.jl/actions/runs/3447627001/jobs/5753831370

I will create a new issue for fixing the doctests.