forked from rubygems/rubygems.org
-
Notifications
You must be signed in to change notification settings - Fork 3
Content addressable prototype compact index #775
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
Draft
jenshenny
wants to merge
5
commits into
content-addressable-prototype
Choose a base branch
from
content-addressable-prototype-compact-index
base: content-addressable-prototype
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fa4b155
Add info_checksum_v3 and yanked_info_checksum_v3 to versions
jenshenny 0d721a5
Add v3 content-addressable compact index format
jenshenny 96d8d02
Generate and upload v3 compact index files on push
jenshenny 4c2e9fd
Add v3 compact index backfill task and baseline versions file rake
jenshenny ddf72b7
Serve the content-addressable compact index at /v2
jenshenny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| class Maintenance::BackfillCompactIndexV3Task < MaintenanceTasks::Task | ||
| attribute :min_rubygem_id, :integer | ||
| attribute :max_rubygem_id, :integer | ||
| attribute :force_upload_info_file_job, :boolean, default: false | ||
|
|
||
| def collection | ||
| scope = Rubygem.with_versions | ||
| scope = scope.where(rubygems: { id: min_rubygem_id.. }) if min_rubygem_id.present? | ||
| scope = scope.where(rubygems: { id: ..max_rubygem_id }) if max_rubygem_id.present? | ||
| scope | ||
| end | ||
|
|
||
| def process(rubygem) | ||
| last_version = rubygem.versions | ||
| .order(Arel.sql("COALESCE(yanked_at, created_at) DESC, number DESC, platform DESC")) | ||
| .first | ||
|
|
||
| return unless last_version | ||
| return if !force_upload_info_file_job && (last_version.info_checksum_v3.present? || last_version.yanked_info_checksum_v3.present?) | ||
|
|
||
| UploadInfoFileJob.perform_later(rubygem_name: rubygem.name, backfill_only_version: 3) | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
db/migrate/20260605120000_add_info_checksum_v3_and_yanked_info_checksum_v3_to_versions.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| class AddInfoChecksumV3AndYankedInfoChecksumV3ToVersions < ActiveRecord::Migration[8.1] | ||
| def change | ||
| safety_assured do | ||
| change_table :versions, bulk: true do |t| | ||
| t.string :info_checksum_v3 | ||
| t.string :yanked_info_checksum_v3 | ||
| end | ||
| end | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting here that we probably want to look at the V3 + /v2/ naming for CA vs the v2 naming for cooldown - can we do anything to make this less of a minefield for any future contributor?