Skip to content

Improve admin::render_readmes #4095

Open
Feature Request
@nipunn1313

Description

@nipunn1313

From @Turbo87 in discord:

I would do it in roughly these steps:

  1. Add a vcs_info JSONB column to the versions table and populate it with the file content from new publishes
  2. Create script or temporary crates-admin command to backfill vcs_info and readme columns on versions that don't have them yet
  3. Adjust render-readmes to use readme column instead of downloading the crate file
  4. Adjust render-readmes to use the vcs_info column to render relative paths correctly for crates in subdirectories

In this strategy

Ideally admin::render_readmes does not download the crate at all.

Requires a one-off script to backfill columns to the versions and crates table from the downloaded crate.

If we want to support rerunning admin::render_readmes on older versions of crates - we would need to move the readme column to the versions table (currently it's in crates table - only the latest version of readme is persisted - overwritten every time a new version is uploaded - never used).

Alternate strategy

Opted against this strategy in the discussion so far, but putting it here for completeness. If we considered going with this - which would enable things like #3971 and #3972

Don't use the readme column of crates (I've just confirmed that it's completely unused currently in the codebase afaict)
Download old crates from crates.io to recalculate/find the readme again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-backend ⚙️C-enhancement ✨Category: Adding new behavior or a change to the way an existing feature works

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions