Commit graph

145 commits

Author SHA1 Message Date
Jiahao XU
cb9cb0e937
Fix binstalk_downloader::Download for data-verifier (#1313)
To make sure the `data_verifier` consumes the entire file and produces
the correct checksum.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-24 00:04:57 +00:00
Jiahao XU
c99b83b720
dep: Bump reqwest to v0.11.19 (#1308)
Fixed #1292

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-22 13:45:37 +00:00
Jiahao XU
dc77a1ab93
Refactor: Extract new crate simple-git (#1304)
`binstalk-downloader` contains stuff about http(s) before the
git code is moved into it and now it becomes http and git.

While git indeed uses http stuff, which is why I decided to put
it into binstalk-downloader, it is more than just downloading
since it is stateful (can be cached locally and updated)
where as http is stateless.

Also `binstalk-downloader`'s codegen time now increases
dramatically and it also creates extra dependencies for
binstalk-fetchers, delaying its execution.

The git code also don't use anything from `binstalk-downloader`
at all, it makes sense to be an independent crate.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-19 01:08:55 +00:00
Jiahao XU
146d3f8f43
Fix binstalk-downloader feature activation (#1297)
Fix use of `native-tls` and `git`, make sure that `gix` actually uses
`native-tls` in this scenario.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-16 22:34:03 +00:00
Jiahao XU
623f7ff4ed
Refactor: Extract new crate binstalk-registry (#1289)
To speedup codegen of `binstalk` and enable it to be reused.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-13 07:16:53 +00:00
Jiahao XU
fbed317df5
feat: git::Repository cancellation support (#1288)
feat: `git::Repository` support cancellation.

To make sure users can cancel git operation via signal, e.g. when the
git operation fail or users no longer want to install.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-12 14:18:02 +00:00
Jiahao XU
c57356e870
Refactor: Move mod git into binstalk-downloader (#1285)
To speedup codegen time for `binstalk`, also fixed the docs.rs build for
`binstalk-downloader`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-12 07:20:26 +00:00
github-actions[bot]
070537076d
release: binstalk-downloader v0.7.0 (#1272)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-08-09 21:00:48 +00:00
Jiahao XU
3e80b12748
feat: Verify cksum of crate tarball from cargo registry (#1260)
Fixed #1183

Since the crate tarball could be downloaded from a different set of
servers than where the cargo registry is hosted, verifying the checksum
is necessary to verify its integrity.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-09 10:57:47 +00:00
Jiahao XU
9c521d162a
Enable unstable feature reqwest/http3 in CI (#1261)
For dev and release build, so that pre-built binaries of
`cargo-binstall` can utilize http3 protocol.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-09 07:44:10 +00:00
Jiahao XU
ac012bdcb2
Remove dep futures-lite from binstalk-downloader (#1259)
I planned to replace `futures-util` with `futures-lite`, but it turns
out that `reqwest` actually depends on `futures-util`, so there is no
point removing it and introduce yet another dependency.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-08 10:48:12 +00:00
Jiahao XU
435df675b3
Fix too many 429 response (#1231)
Fixed #1229

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-08 00:53:15 +00:00
Jiahao XU
e4c776f403
feat: Support data verification in Download (#1248)
By accepting `&mut dyn DataVerifier` for users to pass any callback that
uses `digest::Digest`/`digest::Mac`, `sigstore` or whatever they want.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-06 05:56:02 +00:00
github-actions[bot]
65d01f3199
release: binstalk-downloader v0.6.1 (#1212)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-07-18 09:42:38 +00:00
Jiahao XU
d1fe5c7155
Fix clippy warning in binstalk_downloader (#1204)
Replace use of `PhantomData::default()` in `src/download.rs` with
`PhantomData` since it is a unit struct.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-16 13:50:04 +10:00
Jiahao XU
c4b6921314
fix binstalk_downloader::GhApiClient json deser error (#1193)
When installing `cargo-expand` v1.0.59, I got an error message:

```
Failed to parse http response body as Json: invalid type: null, expected a string at line
1 column 90
```

This is because `GraphQLPageInfo::end_cursor` can actually be `null`, so
I change its type to `Option<CompactString>`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-07-09 10:39:18 +00:00
Jiahao XU
01a87ac606
feat: Impl support for alternative registries (#1184)
Fixed #1168

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-30 03:52:40 +00:00
github-actions[bot]
583860fbc6
release: binstalk-downloader v0.6.0 (#1177)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-26 14:17:53 +00:00
github-actions[bot]
c816f33ac0
release: binstalk-types v0.5.0 (#1175)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-06-26 12:27:56 +00:00
Jiahao XU
40efe02e34
fix leon & binstalk-downloader bug relating to features (#1153)
- ci: Check feat powerset of leon & binstalk-downloader in `ci.yml`
 - fix leon feature `cli`: Enable dep `miette` in feature `cli`
 - fix binstalk-downloader when default feature is disabled and no other
   tls related feature is enabled (breaking change due to replace of
   `tls::Version` with newtype `TLSVersion`).

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-19 02:22:09 +00:00
Jiahao XU
6b5384608e
GhApiClient misc improvements (#1139)
- Increase `DEFAULT_RETRY_DURATION` to 5 minutes, since GitHub enforces
   rate limit on an hourly basis.
 - Refactor `check_for_status` & `fetch_release_artifacts_restful_api`
 - Optimize `percent_decode_http_url_path`: Avoid `percent_decode_str`
   if there is no `%` in the `input`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-07 01:02:29 +00:00
Jiahao XU
22b3419fce
feat: Add GraphQL support to GhApiClient (#1124)
Fixed #868

 - Add new fn `remote::Client::post`
 - Add new fn `remote::RequestBuilder::body`
 - Re-export `reqwest::Body` in `remote`
 - Add dep percent-encoding v2.2.0 to binstalk-downloader
 - Add dep serde-tuple-vec-map v1.0.1 to binstalk-downloader
 - Add GraphQL to `GhApiClient`, fallback to Restful API if token is not
   provided or authorization failed.
 - Fixed `GhReleaseArtifact::try_extract_artifact_from_str`: decode
   percent encoded http url path and add regression tests
 - Added variant `GhApiError::Context` & `GhApiContextError`
 - Added variant `GhApiError::GraphQLErrors` & `GhGraphQLErrors`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-04 14:09:49 +00:00
Jiahao XU
2acba14b41
GhApiClient: Fallback to unauthorized mode if auth token is invalid (#1121)
Fixed #850

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-06-04 02:29:42 +00:00
dependabot[bot]
b23598ed85
Bump tokio from 1.28.1 to 1.28.2 (#1100)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.28.1 to 1.28.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.28.1...tokio-1.28.2)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 03:02:20 +00:00
github-actions[bot]
39748ecadf
release: binstalk-downloader v0.5.1 (#1095)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-05-26 16:06:51 +00:00
Jiahao XU
f8255b1b81
dep: Downgrade tracing from v0.1.38 => v0.1.37 due to yanking (#1085)
Fixed #1019

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-05-24 14:27:05 +00:00
dependabot[bot]
d2abdf14e0
Bump digest from 0.10.6 to 0.10.7 (#1077)
Bumps [digest](https://github.com/RustCrypto/traits) from 0.10.6 to 0.10.7.
- [Commits](https://github.com/RustCrypto/traits/compare/digest-v0.10.6...digest-v0.10.7)

---
updated-dependencies:
- dependency-name: digest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-22 02:34:23 +00:00
Jiahao XU
1c3f5ff5e2
Switch binstalk-downloader license to "Apache-2.0 OR MIT" (#542)
Switch binstalk-downloader license to Apache-2.0 OR MIT




Signed-off-by: ryan kurte ryan+gh@kurte.nz

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Félix Saparelli <felix@passcod.name>
Signed-off-by: Ryo Yamashita <qryxip@gmail.com>
Signed-off-by: ryan kurte ryan+gh@kurte.nz
2023-05-19 03:07:58 +00:00
dependabot[bot]
71d864b4cc
Bump reqwest from 0.11.17 to 0.11.18 (#1062)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.17 to 0.11.18.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.17...v0.11.18)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-17 02:39:10 +00:00
dependabot[bot]
9a7445a88f
Bump serde from 1.0.162 to 1.0.163 (#1048)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.162 to 1.0.163.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.162...v1.0.163)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-12 03:55:08 +00:00
dependabot[bot]
10af9394c4
Bump async-compression from 0.3.15 to 0.4.0 (#1043)
Bumps [async-compression](https://github.com/Nullus157/async-compression) from 0.3.15 to 0.4.0.
- [Release notes](https://github.com/Nullus157/async-compression/releases)
- [Changelog](https://github.com/Nullus157/async-compression/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Nullus157/async-compression/compare/0.3.15...async-compression-v0.4.0)

---
updated-dependencies:
- dependency-name: async-compression
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-11 13:39:17 +10:00
dependabot[bot]
62c59beca6
Bump tokio from 1.28.0 to 1.28.1 (#1042)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.28.0 to 1.28.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.28.0...tokio-1.28.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-11 13:37:55 +10:00
dependabot[bot]
cb906ae0bf
Bump serde from 1.0.160 to 1.0.162 (#1032)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.160 to 1.0.162.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.160...1.0.162)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-05 15:05:53 +10:00
dependabot[bot]
763ddd0427
Bump async_zip from 0.0.13 to 0.0.15 (#1022)
* Bump async_zip from 0.0.13 to 0.0.15

Bumps [async_zip](https://github.com/Majored/rs-async-zip) from 0.0.13 to 0.0.15.
- [Release notes](https://github.com/Majored/rs-async-zip/releases)
- [Commits](https://github.com/Majored/rs-async-zip/commits)

---
updated-dependencies:
- dependency-name: async_zip
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix build error

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-05-01 21:23:43 +10:00
dependabot[bot]
52e2368e6c
Bump reqwest from 0.11.16 to 0.11.17 (#1021)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.16 to 0.11.17.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.16...v0.11.17)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-01 18:27:00 +10:00
dependabot[bot]
ac1808eef6
Bump flate2 from 1.0.25 to 1.0.26 (#1020)
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.25 to 1.0.26.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/commits)

---
updated-dependencies:
- dependency-name: flate2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-01 18:26:17 +10:00
github-actions[bot]
f683b4075d
release: binstalk-downloader v0.5.0 (#1011)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-04-26 18:44:23 +10:00
github-actions[bot]
5b0268c768
release: binstalk-types v0.4.0 (#1008)
chore: Release

Co-authored-by: github-actions <github-actions@github.com>
2023-04-26 17:31:21 +10:00
dependabot[bot]
7ca0edf004
Bump tokio-util from 0.7.7 to 0.7.8 (#1002) 2023-04-26 05:43:55 +00:00
dependabot[bot]
e4d88310ed
Bump tracing from 0.1.37 to 0.1.38 (#1005) 2023-04-26 04:39:51 +00:00
dependabot[bot]
a47ca44100
Bump tokio from 1.27.0 to 1.28.0 (#1001) 2023-04-26 04:09:29 +00:00
Jiahao XU
0261d12d9d
Support subcrate in repo (#991)
Fixed #838

 - Add new key `subcrate` for rendering `pkg-url`
 - Add new release paths in GitHub, GitLab & SourceForge using key `subcrate` for auto-detection
 - Add subcrate detection for GitHub and GitLab
 - Add `debug!` when using gh api token in `GhApiClient::new`
 - Add subcrate testing to `e2e-tests/subcrate.sh`
 - Bump cargo-release to 0.24.9 in e2e-tests/live.sh
   to fix test failure on MacOS without libssl installed in `/usr/local/`.
 - Optimize GhCrateMeta: Detect subcrate and repo-host in `Data::get_repo_info`
    to cache the result and avoid duplicate works, this also makes the code
    more ergonomic by removing the need to some `unwrap()` plus making it
    more efficient since we don't need to clone the url just to modify it.
 - Add instrument to `Data::get_repo_info`
 - Fix `shellcheck` err in `e2e-tests/*.sh`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-24 19:41:20 +10:00
Jiahao XU
5e269193c0
Add comment to src/binstalk-downloader/Cargo.toml (#996)
Add comment to binstalk-downloader/Cargo.toml

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-04-24 07:49:25 +00:00
dependabot[bot]
da59f0b707
Bump serde_json from 1.0.95 to 1.0.96 (#986)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.95 to 1.0.96.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.95...v1.0.96)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-13 13:17:30 +10:00
dependabot[bot]
067af4ea25
Bump serde from 1.0.159 to 1.0.160 (#985)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.159 to 1.0.160.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.159...v1.0.160)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-12 13:35:00 +10:00
dependabot[bot]
8ccb6c887a
Bump futures-lite from 1.12.0 to 1.13.0 (#983)
Bumps [futures-lite](https://github.com/smol-rs/futures-lite) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/smol-rs/futures-lite/releases)
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/futures-lite/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: futures-lite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-10 12:54:49 +10:00
dependabot[bot]
885da90e38
Bump futures-util from 0.3.27 to 0.3.28 (#968) 2023-03-31 02:24:28 +00:00
dependabot[bot]
f46b0eab18
Bump tempfile from 3.4.0 to 3.5.0 (#967) 2023-03-30 02:49:38 +00:00
dependabot[bot]
b645cc6286
Bump serde from 1.0.158 to 1.0.159 (#959) 2023-03-29 23:12:31 +11:00
Jiahao XU
3a29ecaa36
Support GitHub fine-grained personal access token (#957)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-03-28 20:20:11 +11:00