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

Fix upload_to_gist #20

Merged
merged 1 commit into from
Apr 5, 2023
Merged

Fix upload_to_gist #20

merged 1 commit into from
Apr 5, 2023

Conversation

cossio
Copy link
Contributor

@cossio cossio commented Mar 28, 2023

I was getting the following error:

julia> gist = ArtifactUtils.upload_to_gist(artifact_id)
- Creating gist...
✓ Created gist
Cloning into '.'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

with the stack trace:

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run
    @ ./process.jl:477 [inlined]
  [4] git
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:44 [inlined]
  [5] (::ArtifactUtils.var"#15#17"{ArtifactUtils.var"#11#12"{String}, String})(git_dir::String)
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:45
  [6] mktempdir(fn::ArtifactUtils.var"#15#17"{ArtifactUtils.var"#11#12"{String}, String}, parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:764
  [7] mktempdir (repeats 2 times)
    @ ./file.jl:760 [inlined]
  [8] macro expansion
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:43 [inlined]
  [9] macro expansion
    @ ./task.jl:454 [inlined]
 [10] with_new_gist(f::ArtifactUtils.var"#11#12"{String}; private::Bool)
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:39
 [11] gist_from_file(filepath::String; private::Bool)
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/gistutils.jl:10
 [12] upload_to_gist(artifact_id::Base.SHA1, tarball::String; private::Bool, archive_options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:172
 [13] upload_to_gist
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:163 [inlined]
 [14] #32
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:205 [inlined]
 [15] mktempdir(fn::ArtifactUtils.var"#32#33"{Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Base.SHA1, String}, parent::String; prefix::String)
    @ Base.Filesystem ./file.jl:764
 [16] mktempdir (repeats 2 times)
    @ ./file.jl:760 [inlined]
 [17] #upload_to_gist#31
    @ ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:204 [inlined]
 [18] upload_to_gist(artifact_id::Base.SHA1)
    @ ArtifactUtils ~/.julia/packages/ArtifactUtils/LygoX/src/ArtifactUtils.jl:183
 [19] top-level scope
    @ REPL[3]:1

When checking the repo URL that ArtifactUtils was using, I realised that it also did not work on the terminal. One needs to remove the username and .git in the end to actually get the gist repo url. This PR attempts to fix that. I'm actually not sure how ArtifactUtils was working before?

Related: https://discourse.julialang.org/t/permissions-error-in-artifactutils-upload-to-gist/96469

@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2023

Codecov Report

Merging #20 (d54c604) into main (810f735) will decrease coverage by 4.67%.
The diff coverage is 0.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
- Coverage   49.17%   44.50%   -4.67%     
==========================================
  Files           3        3              
  Lines         181      182       +1     
==========================================
- Hits           89       81       -8     
- Misses         92      101       +9     
Impacted Files Coverage Δ
src/gistutils.jl 22.80% <0.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@marcobonici
Copy link

I was having some issue with ArtifactUtils, since I was not being able to upload to GitHub Gist. This PR fixes it.

@StefanKarpinski
Copy link
Collaborator

Bump, @simeonschaub, if you're around...

@cossio cossio changed the title Fix error with upload_to_gist Fix upload_to_gist Apr 4, 2023
@simeonschaub simeonschaub merged commit 2b00e08 into JuliaPackaging:main Apr 5, 2023
@simeonschaub
Copy link
Member

Thanks @cossio!

@cossio
Copy link
Contributor Author

cossio commented Apr 5, 2023

Thanks for taking a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants