Skip to content

Why Loopback? #362

@cadojo

Description

@cadojo

I have recently moved a bunch of Julia packages into monorepo-like projects, and I've consequently had to submit PRs to the General registry to change the project repository locations, specify subdirectories, etc. I realized that all of the published versions for a given package are listed in the Versions.toml file in the registry, and I wondered why TagBot.jl uses a loop-back mechanism when all of the version hashes are available in the file?

For example, user @yakir12 on Discourse posted code which only depends on Pkg.jl which reads available package versions. With minimal modification I think this function does what we would need!

function available_versions(pkgname::AbstractString)
   registry = only(filter(r -> r.name == "General", Pkg.Registry.reachable_registries()))
   pkg = only(filter(pkg -> pkg.name == pkgname, collect(values(registry.pkgs))))
   vs = [ 
      pair.first => pair.second.git_tree_sha1 
      for pair in Pkg.Registry.registry_info(pkg).version_info 
   ]
   
   sort!(vs, by=x->x.first)
   
   return vs
end

I apologize if this is the wrong place to ask this question. If folks agree that reading Versions.toml would be more convenient, I would be interested in helping to contribute this feature / change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions