JuliaLang / PkgDev.jl

Tools for Julia package developers
Other
71 stars 34 forks source link

Missing credentials #170

Open cstjean opened 4 years ago

cstjean commented 4 years ago

When tagging, I'm hitting ERROR: MethodError: no method matching read(::Nothing, ::Type{String}) on this line. The comment is explicit: # TODO Check for creds===nothing if there are no credentials stored however I have no idea how to fix it. Should I configure my system differently? We do authentication with SSH to private github repos. Is that the issue?

davidanthoff commented 4 years ago

Yes, this only works if you have https credentials stored in a credential store. I'm also using that credential to access the github API.

cstjean commented 4 years ago

Ok. So from my cursory look and experiments, it looks like SSH support would require significant effort? We might be able to help.

davidanthoff commented 4 years ago

Any help would be great! Right now the whole code is this one endless function, really not well structured...

I think roughly the strategy should probably be to a) use git command line for anything that interacts with remote git repos, that way it should automatically work with SSH, and then b) provide an option to manually somehow specify credentials that are used in the code for the calls to the Github API.

davidanthoff commented 4 years ago

Actually, I just looked through the code, I think a) is already how it is done right now. So it might be enough to just have an alternative for https://github.com/JuliaLang/PkgDev.jl/blob/master/src/tag.jl#L46 line here to get everything to work.

davidanthoff commented 4 years ago

https://github.com/JuliaLang/PkgDev.jl/pull/171

cstjean commented 4 years ago

If ssh is properly configured, ssh -T git@github.com tells you so, so perhaps we just need to skip getting/passing around the credentials? I'll look into it.

cstjean commented 4 years ago

NVM, I misunderstood; you're right, we need github credentials of course.

oxinabox commented 3 years ago

Even after #171 There are still a number of places in the code where it assumes creditials are available, and gives a bad error message

For example

julia> PkgDev.enable_pkgbutler("ProjectManagement")
ERROR: MethodError: no method matching read(::Nothing, ::Type{String})
Closest candidates are:
  read(::FilePathsBase.AbstractPath, ::Type{T}) where T at /Users/oxinabox/.julia/packages/FilePathsBase/YFK4h/src/path.jl:757
  read(::Base.AbstractCmd, ::Type{String}) at process.jl:421
  read(::AbstractString, ::Type{T}) where T at io.jl:434
  ...
Stacktrace:
 [1] configure_deploykey(repo::String, force::Bool)
   @ PkgDev ~/.julia/packages/PkgDev/utsVc/src/pkgbutler.jl:110
 [2] enable_pkgbutler(package_name::String; channel::Symbol, template::Symbol, force::Bool)
   @ PkgDev ~/.julia/packages/PkgDev/utsVc/src/pkgbutler.jl:51
 [3] enable_pkgbutler(package_name::String)
   @ PkgDev ~/.julia/packages/PkgDev/utsVc/src/pkgbutler.jl:26
 [4] top-level scope
   @ REPL[3]:1