* Add new option `--disable-quick-install-stats`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Send quickinstall stats in parallel
This commit also make sure'the stats is always sent for
each fetcher, regardless of whether it is picked or not,
to make sure that the quick-install stats collection gets
the full infomration of possible targets.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Rename option to `--disable-telemetry`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Update args.rs
Co-authored-by: Félix Saparelli <felix@passcod.name>
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* Update args.rs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
Co-authored-by: Félix Saparelli <felix@passcod.name>
* fix: normalize GitHub URLs ending in .git to not ending in .git
* Refactor `Data::get_repo_info`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix `get_repo_info` for repo with `.git` suffix
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add e2e-tests to cover it
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Always try geting the redirected url
This would help:
- redirect public gh repo `.git` to its canonical form
- redirect public gh repo, which has been recently renamed
- cases where redirection is needed to get the real repo
This commit make it fallbacks to the previou surl, if getting
the redirected url fail, in case the repository is private.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add more e2e-tests
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Optimize: Do not try redirect if gh_get_repo_info fail
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Minor refactor
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
* Perform artifact discovery in sequential
Run different `fetcher.find()` in sequential
* FuturesResolver: Fallback to other future if one error
* Fix typo
* Apply cargo fmt
* Parallelise `<QuickInstall as Fetcher>::find`
Check for signature in parallel to the package
* Download signature in `<QuickInstall as Fetcher>::find`
So that the signature download can be done in parallel.
* Bump msrv for binstalk-fetchers to 1.70
* Update crates/binstalk-fetchers/src/futures_resolver.rs
Co-authored-by: Félix Saparelli <felix@passcod.name>
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
* cargo fmt
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Félix Saparelli <felix@passcod.name>
* Add new dep zeroize
* Use Zeroizing to avoid leaking the token
* Optimize gh-auth-token
Spawn it as a task, and only await it
when using GhApiClient
* Fix binstalk-git-repo-api unit tests
* Bump msrv of binstalk-downloader, binstalk and cargo-binstall to 1.79
* Update From<io::Error> for DownloadError
to use io::Error::downcast
* Update From<io::Error> for BinstallError
* fix dmt
* Use binary name when searching for artifacts
When there is a single binary declared in the manifest and
it differs from the package name, add it to the list of handles
used for pre-built artifact fetching.
* Simplify `binary_name` assignment with a `match`
* Add e2e test
* Only attempt to use the binary name with `GhCrateMeta` fetcher
* Avoid too much over-allocating.
Technically it should also check if gh-crate-meta resolver is enabled, but it is unlikely for it to be disabled and overallocating for extra n-target should be fine, it is an improvement over doubling the space allocated if the binary_name is Some.
* Fix fmt in crates/binstalk/src/ops/resolve.rs
---------
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
* Log the gh-auth token retrieval failure on debug level
Fixed#1733
* Make gh_token::get an async function
* Improve returned err msg in gh_token::get
* Update use of gh_token::get() in entry.rs
* Fix typos
* Fix unclosed ()
* Fix unclosed ()
* Fix gh_token.rs
* Fix entry.rs
* Fix fmt in entry.rs
* Fix fmt in gh_token.rs
* Fix fmt in gh_token.rs
* Fix fmt in gh_token.rs
* Fix fmt in entry.rs
* Share `remote::Client` between tests when in cargo-test
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Run rate-limited binstalk-git-repo-api test in serial
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Update client-side rate limit to 1 request per 300ms
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Reduce test cases in `rate_limited_test_has_release_artifact_and_download_artifacts`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Add `cargo-nextest` that I forgot
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix unit testing: Pass auth-token to restful API
to avoid rate limit
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix unit test for `GhApiClient`
Set client-side rate limit to 1 request per 200 ms
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Only run `detect-targets` test if changed
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Only run unit tests for crates that are changed
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix job `changed-files`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix job `changed-files`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix shell error in job `changed-files`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* FIx separator for `changed-files`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix passning of craetes to run
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix passing of `CARGO_NEXTEST_ADDITIONAL_ARGS`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix deciding which crates to test on windows
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Fix just recipe `unit-tests`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
* Split test into two jobs
so that they will have they own cache (since different feature flags are used).
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
---------
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>