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

Add retry support to sparse registries #11069

Merged
merged 1 commit into from Oct 7, 2022
Merged

Add retry support to sparse registries #11069

merged 1 commit into from Oct 7, 2022

Conversation

arlosi
Copy link
Contributor

@arlosi arlosi commented Sep 9, 2022

Sparse (HTTP) registries currently do not respect Cargo's retry policy for http requests.

This change makes sparse registries use the same retry system as package downloads.

@rust-highfive
Copy link

r? @epage

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 9, 2022
Copy link
Contributor

@epage epage left a comment

Choose a reason for hiding this comment

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

I've taken a look and it seems good but I would want @Eh2406 to take a look as I assume they have more recently reviewed this area of code.

src/cargo/sources/registry/http_remote.rs Outdated Show resolved Hide resolved
@epage
Copy link
Contributor

epage commented Sep 9, 2022

r? @Eh2406

@rust-highfive rust-highfive assigned Eh2406 and unassigned epage Sep 9, 2022
@bors
Copy link
Collaborator

bors commented Sep 9, 2022

☔ The latest upstream changes (presumably #11068) made this pull request unmergeable. Please resolve the merge conflicts.

@Eh2406
Copy link
Contributor

Eh2406 commented Sep 11, 2022

Had some time to look this over and it looks good to me. Ed has some good questions about nomenclature. Is there some way we can add tests? Perhaps a setup like #11062 where the server takes a few tries to give a 200.

@weihanglo weihanglo added the A-sparse-registry Area: http sparse registries label Sep 13, 2022
@ehuss ehuss added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 25, 2022
@arlosi
Copy link
Contributor Author

arlosi commented Oct 7, 2022

I pulled in the test framework changes from #11062 and added a test.

pub fn truncate_with_ellipsis(s: &str, max_width: usize) -> String {
// We should truncate at grapheme-boundary and compute character-widths,
// yet the dependencies on unicode-segmentation and unicode-width are
// not worth it.
Copy link
Contributor

Choose a reason for hiding this comment

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

unicode-width is already a dependency, maybe we should open an issue asking for this function to be updated to use it.

@Eh2406
Copy link
Contributor

Eh2406 commented Oct 7, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 7, 2022

📌 Commit dcc512b has been approved by Eh2406

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels Oct 7, 2022
@bors
Copy link
Collaborator

bors commented Oct 7, 2022

⌛ Testing commit dcc512b with merge d1a2592...

@bors
Copy link
Collaborator

bors commented Oct 7, 2022

☀️ Test successful - checks-actions
Approved by: Eh2406
Pushing d1a2592 to master...

@bors bors merged commit d1a2592 into rust-lang:master Oct 7, 2022
weihanglo added a commit to weihanglo/rust that referenced this pull request Oct 11, 2022
9 commits in 3cdf1ab25dc4fe56f890e8c7330d53a23ad905d3..b8f30cb23c4e5f20854a4f683325782b7cff9837
2022-10-07 17:34:03 +0000 to 2022-10-10 19:16:06 +0000

- Add more doc comments for three modules (rust-lang/cargo#11207)
- docs: fix (rust-lang/cargo#11208)
- Add completions for `cargo remove` (rust-lang/cargo#11204)
- Config file loaded via CLI takes priority over env vars (rust-lang/cargo#11077)
- Use `#[default]` when possible (rust-lang/cargo#11197)
- Implement RFC 3289: source replacement ambiguity (rust-lang/cargo#10907)
- Use correct version of cargo in test (rust-lang/cargo#11193)
- Check empty input for login (rust-lang/cargo#11145)
- Add retry support to sparse registries (rust-lang/cargo#11069)
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 12, 2022
Update cargo

9 commits in 3cdf1ab25dc4fe56f890e8c7330d53a23ad905d3..b8f30cb23c4e5f20854a4f683325782b7cff9837 2022-10-07 17:34:03 +0000 to 2022-10-10 19:16:06 +0000

- Add more doc comments for three modules (rust-lang/cargo#11207)
- docs: fix (rust-lang/cargo#11208)
- Add completions for `cargo remove` (rust-lang/cargo#11204)
- Config file loaded via CLI takes priority over env vars (rust-lang/cargo#11077)
- Use `#[default]` when possible (rust-lang/cargo#11197)
- Implement RFC 3289: source replacement ambiguity (rust-lang/cargo#10907)
- Use correct version of cargo in test (rust-lang/cargo#11193)
- Check empty input for login (rust-lang/cargo#11145)
- Add retry support to sparse registries (rust-lang/cargo#11069)
@ehuss ehuss added this to the 1.66.0 milestone Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sparse-registry Area: http sparse registries S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants