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

Update linkset homepage from gemspec only after version gets indexed #5249

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

segiddins
Copy link
Member

In current implementation, version.reload.indexed? is always false, so gems that only use spec.homepage to specify a homepage will never have a linkset created/updated

Signed-off-by: Samuel Giddins [email protected]

In current implementation, version.reload.indexed? is always false, so gems that only use spec.homepage to specify a homepage will never have a linkset created/updated

Signed-off-by: Samuel Giddins <[email protected]>
@segiddins segiddins force-pushed the segiddins/update-linkset-homepage-from-gemspec-only-after-version-gets-indexed branch from f22029d to 1952277 Compare November 18, 2024 21:15
Copy link
Member

@martinemde martinemde left a comment

Choose a reason for hiding this comment

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

Nothing blocking, but curious about a few things.

def update_attributes_from_gem_specification!(version, spec)
Rubygem.transaction do
save!
update_versions! version, spec
update_dependencies! version, spec
update_linkset! spec if version.reload.latest?
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we never update the linkset now. Is that expected?

def perform(version:)
return unless version.latest? && version.indexed?

gem = RubygemFs.instance.get("gems/#{version.gem_file_name}")
Copy link
Member

Choose a reason for hiding this comment

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

This is the only job that redownloads the gem besides the content storage job. Could it just grab this info on push?

Copy link
Member Author

Choose a reason for hiding this comment

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

right now we don't pass anything besides the version itself to the "after write" set of jobs, so I kept in keeping with that

homepage = package.spec.homepage

version.rubygem.linkset ||= Linkset.new
version.rubygem.linkset.update!(home: homepage)
Copy link
Member Author

Choose a reason for hiding this comment

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

@martinemde this is where we update the linkset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants