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

api/v1/versions endpoint #277

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

micheelengronne
Copy link
Collaborator

Create the api/v1/versions endpoint.

Description:

This endpoint is needed to integrate gemstash in automated systems.


Tasks:

  • This endpoint is needed to integrate gemstash in automated systems.
  • Write tests

I will abide by the code of conduct.

@micheelengronne micheelengronne changed the title WIP: api/v1/versions endpoint api/v1/versions endpoint Nov 23, 2020
results.group_by {|r| r[:name] }.each do |gem, rows|
requirements = rows.group_by {|r| [r[:number], r[:platform]] }

value = requirements.map do |version, r|
Copy link
Member

@olleolleolle olleolleolle Nov 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this do the right thing?

Suggested change
value = requirements.map do |version, r|
value = requirements.map do |(version_number, platform), r|

Well, version_number is perhaps a too-long name, could call it version, too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. I changed it in the following commit. eb619cd

@micheelengronne
Copy link
Collaborator Author

The CI is broken for months in the master branch. Is this project still alive ? I would like to contribute on it as I use it internally but if it is not maintained, do you know any opensource alternatives (and not a all-in-one solution like artifactory) ?

Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look at the test output now, and managed to get to a place where the tests are failing, not erroring.

context "from the default upstream" do
let(:current_env) { Gemstash::Env.current }
let(:upstream) { Gemstash::Upstream.new(current_env.config[:rubygems_url]) }
let(:storage) { Gemstash::LocalStorage.for("gem_cache").for(upstream.host_id) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can become

Suggested change
let(:storage) { Gemstash::LocalStorage.for("gem_cache").for(upstream.host_id) }
let(:storage) { Gemstash::Storage.for("gem_cache").for(upstream.host_id) }


context "from private gems" do
let(:gem_source) { Gemstash::GemSource::PrivateSource }
let(:storage) { Gemstash::LocalStorage.for("private").for("gems") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let(:storage) { Gemstash::LocalStorage.for("private").for("gems") }
let(:storage) { Gemstash::Storage.for("private").for("gems") }

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.

2 participants