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

Full index bundling #45

Merged
merged 8 commits into from
Nov 3, 2015
Merged

Full index bundling #45

merged 8 commits into from
Nov 3, 2015

Conversation

smellsblue
Copy link
Contributor

This fixes #15 and fixes #16.

Bundling with --full-index involves implementing /private/specs.4.8.gz and /private/quick/Marshal.4.8/<gem>-<version>.gemspec.rz. Upstreams already work, though perhaps we want to cache some results? Maybe that's unnecessary though.

@smellsblue
Copy link
Contributor Author

I may need to also implement prerelease_specs after looking at Bundler source a bit.

spec = gem.spec
spec = Marshal.dump(spec)
spec = Zlib::Deflate.deflate(spec)
spec_storage.resource(full_name).save(spec)
end

Copy link
Contributor

Choose a reason for hiding this comment

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

Heh, are we reaching the same concerns in 2 different branches? => https://github.com/bundler/gemstash/blob/pull-all-the-gems/lib/gemstash/preload.rb#L64-L85

Should we extract something that knows how to read/write gemspecs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite on this particular block of code. This block is about storing the Gem::Specification instance so it can be retrieved when /quick/Marshal.4.8/gemname-0.1.0.gemspec.rz is called. There is a different class that I am using that is similar concern to yours, and that would be Gemstash::SpecsBuilder which I put in lib/gemstash/secs_builder.rb. The difference is that the specs.4.8.gz is a Marshalled and Gzipped array of arrays, where each array has [String, Gem::Version, String], this is storing a Marshalled Zlib::Deflated instance of the Gem::Specification.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, you are right, that other one seems to be a bit more common, but I still cannot point at anything that can be extracted. Let's move forward for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 I think we can take a more careful look at refactoring once both our branches are in :-)

Invalidate cached specs.4.8.gz when a gem is pushed/yanked/unyanked
Logging#log_error for consistent backtrace logging (include indentation in backtrace)
This finishes bundling with --full-index for private gems
Update speaker gem to have a prerelease version that behaves differently
Update SimpleServer to allow mounting prerelease specs endpoint
Build example gem with a prerelease version
Refactor common bundling specs as shared_examples
smellsblue added a commit that referenced this pull request Nov 3, 2015
@smellsblue smellsblue merged commit 366ec18 into master Nov 3, 2015
@smellsblue smellsblue deleted the full-index-bundling branch November 3, 2015 22:38
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.

Bundle with full index against private gems Bundle with full index against upstreams
2 participants