Skip to content

Command to update all repos#10

Open
aavetis wants to merge 4 commits intovercel-labs:mainfrom
aavetis:update-command
Open

Command to update all repos#10
aavetis wants to merge 4 commits intovercel-labs:mainfrom
aavetis:update-command

Conversation

@aavetis
Copy link

@aavetis aavetis commented Feb 1, 2026

If you’ve fetched many packages/repos over time, you currently have to re-run opensrc <pkg> or opensrc <owner/repo> for each one. opensrc update refreshes everything in one command while keeping pinned repo refs stable.

Concept

  • Add opensrc update to refresh all previously fetched sources listed in opensrc/sources.json, matching the existing CLI style (list, remove, clean).
  • Preserve repo refs when updating, including refs encoded as URL hashes.

Expected usage

  # Update everything already fetched
  opensrc update

  # Update only repos or specific registries
  opensrc update --repos
  opensrc update --pypi
  opensrc update --crates

Behavior

  • Packages: re-run with registry + name (resolves to installed/latest versions, same as re-running opensrc <package>).
  • Repos: re-run with stored ref (branch/tag/commit) to avoid drifting.

Methodology

  • New update command builds specs from sources.json and reuses fetchCommand for consistent logging/permissions.
  • Repo parser now reads URL hash refs (https://host/owner/repo#ref) to preserve stored refs.

Coverage

  • Added unit tests for update spec building and URL hash ref parsing.
  • Ran npm test, npm run type-check, and npm run format:check.

@vercel
Copy link

vercel bot commented Feb 1, 2026

@aavetis is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

URLs from non-standard git hosts (e.g., https://example.com/foo/bar) are incorrectly detected as packages instead of repos because isRepoSpec only recognizes hardcoded hosts (github.com, gitlab.com, bitbucket.org).

Fix on Vercel

@ctate
Copy link
Collaborator

ctate commented Feb 2, 2026

Thanks for adding the update command - the core functionality looks good and the tests are solid

Before merging, please scope down the isRepoSpec change. Treating any HTTPS URL with 2+ path segments as a repo is too broad and will cause false positives (e.g., https://cdn.example.com/assets/bundle would be misclassified)

@aavetis
Copy link
Author

aavetis commented Feb 2, 2026

thanks. happy to adjust

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