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

Nix Integration #226

Merged
merged 33 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ced01de
Remove generation commands
mara-schulke Feb 20, 2024
0cb2be0
Implement lockfile commands
mara-schulke Feb 20, 2024
6b8fe4c
Update docs
mara-schulke Feb 20, 2024
baaf84e
Update docs
mara-schulke Feb 20, 2024
92442ff
Document version options
mara-schulke Feb 20, 2024
c31a270
Cherypick nix diffs
mara-schulke Feb 20, 2024
f5edcee
Update cli
mara-schulke Feb 20, 2024
e41a364
Finish the caching implementation
mara-schulke Feb 21, 2024
8728253
Use the cache in the resolver
mara-schulke Feb 21, 2024
b500127
Cleanup various parts of the code base
mara-schulke Feb 21, 2024
fb22ad9
Bump buffrs version
mara-schulke Feb 21, 2024
4d66288
Revamp the nix cache impl
mara-schulke Feb 21, 2024
2f3e67b
Update the cache pattern
mara-schulke Feb 21, 2024
505f102
Use the old naming
mara-schulke Feb 21, 2024
28d7023
Repair clippy issues
mara-schulke Feb 21, 2024
a19369a
Repair e2e tests
mara-schulke Feb 21, 2024
fdbe367
Fix typos
mara-schulke Feb 21, 2024
24ef0e4
Repair the registry build.rs
mara-schulke Feb 21, 2024
a8d2184
Inline cwd fix
mara-schulke Feb 21, 2024
c343f3b
Reformat cache.nix
mara-schulke Feb 21, 2024
e7145da
Update build.rs again
mara-schulke Feb 21, 2024
9869715
Finally repair build.rs
mara-schulke Feb 21, 2024
17444fb
Fmt flake.nix
mara-schulke Feb 21, 2024
7be7a71
Update github actions
mara-schulke Feb 22, 2024
e23b2d3
Sort authors
mara-schulke Feb 22, 2024
284b0cd
Drop unused psql stuff
mara-schulke Feb 22, 2024
d204efd
Simplify CI for Nix
mara-schulke Feb 22, 2024
4b7bf54
Merge coverage and test ci steps
mara-schulke Feb 22, 2024
64292ff
Repair cache.nix
mara-schulke Feb 22, 2024
653a1e9
Rewrite the cache nix again
mara-schulke Feb 22, 2024
d613a4a
Fix bug in flake
mara-schulke Feb 22, 2024
78786db
Fix env var naming
mara-schulke Feb 22, 2024
bc256f6
Merge branch 'main' into mara/nix
mara-schulke Feb 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 8 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Buffrs CLI
name: Buffrs CI

on:
push:
Expand All @@ -16,36 +16,20 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: rustup update && rustup component add rustfmt
- run: cargo install buffrs && cd registry && buffrs install
- run: cargo fmt --check --all

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update && rustup component add clippy
- run: cargo install buffrs && cd registry && buffrs install
- name: Install Protoc
uses: arduino/setup-protoc@v2
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --workspace -- -D warnings -D clippy::all

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: "true"
- run: rustup update
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Setup registry
uses: isbang/[email protected]
with:
compose-file: "./registry/docker-compose.yml"
- run: cargo test --workspace
env:
RUST_BACKTRACE: 1

deny:
runs-on: ubuntu-latest
steps:
Expand All @@ -55,7 +39,7 @@ jobs:
- run: cargo install cargo-deny || true
- run: cargo deny --workspace check

coverage:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -64,14 +48,14 @@ jobs:
- run: rustup update
- run: rustup component add llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- run: cargo install buffrs && cd registry && buffrs install
- run: cargo install cargo-llvm-cov || true
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Setup registry
uses: isbang/[email protected]
with:
compose-file: "./registry/docker-compose.yml"
- run: cargo install buffrs && cd registry && buffrs install
- run: cargo llvm-cov --workspace --fail-under-lines "$MINIMUM_LINE_COVERAGE_PERCENT"
env:
RUST_BACKTRACE: 1

typos:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nix on Ubuntu Buffers CI
name: Nix

on:
push:
Expand All @@ -8,8 +8,11 @@ on:
workflow_dispatch:

jobs:
check_flake_w_nix_on_ubuntu:
runs-on: ubuntu-latest
check:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/nix_ci_mac.yml

This file was deleted.

32 changes: 11 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "buffrs"
version = "0.7.6"
version = "0.8.0"
edition = "2021"
description = "Modern protobuf package management"
authors = [
"Mara Schulke <[email protected]>",
"André Sá De Mello <[email protected]>",
"James Baker <[email protected]>",
"Mara Schulke <[email protected]>",
"Patrick Elsen <[email protected]>",
"Tom Karwowski <[email protected]>",
"Quentin Santos <[email protected]>",
"Thomas Pellissier-Tanon <[email protected]>",
"Robert Fink <[email protected]>",
"James Baker <[email protected]>",
"Thomas Pellissier-Tanon <[email protected]>",
"Tom Karwowski <[email protected]>",
]
repository = "https://github.com/helsing-ai/buffrs"
documentation = "https://docs.rs/buffrs"
Expand All @@ -27,16 +27,15 @@ members = ["registry"]
[[bin]]
name = "buffrs"
path = "src/main.rs"
required-features = ["build", "git", "validation"]
required-features = ["git", "validation"]

[[test]]
name = "e2e"
path = "tests/lib.rs"
test = true

[features]
default = ["build", "git", "validation"]
build = ["dep:tonic-build", "dep:protoc"]
default = ["git", "validation"]
validation = ["dep:anyhow", "dep:protobuf", "dep:protobuf-parse", "dep:diff-struct"]
git = []

Expand All @@ -53,16 +52,15 @@ human-panic = "1"
miette = { version = "5.10.0", features = ["fancy"] }
protobuf = { version = "3.3.0", optional = true }
protobuf-parse = { version = "3.3.0", optional = true }
protoc = { version = "2.28.0", optional = true }
reqwest = { version = "0.11", features = ["rustls-tls-native-roots"], default-features = false }
semver = { version = "1", features = ["serde"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_typename = "0.1"
tar = "0.4"
thiserror = "1.0.49"
tokio = { version = "^1.26", features = ["fs", "rt", "macros", "process", "io-std", "tracing"] }
toml = "0.8.0"
tonic-build = { version = "0.10.0", optional = true }
tracing = "0.1"
tracing-subscriber = "0.3"
url = { version = "2.4", features = ["serde"] }
Expand All @@ -74,7 +72,7 @@ assert_cmd = "2.0"
assert_fs = "1.0"
axum = { version = "0.7.2", default-features = false, features = ["tokio", "http1"] }
fs_extra = "1.3"
gix = { version = "0.58.0", default-features = false}
gix = { version = "0.58.0", default-features = false }
hex = "0.4.3"
paste = "1.0.14"
predicates = "3.0"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* [Manifest vs Lockfile](guide/manifest-vs-lockfile.md)
* [Buffrs Home](guide/buffrs-home.md)

* [Buffrs Integrations](integrations/index.md)
* [Cargo](integrations/cargo.md)
* [Buffrs Integrations]()
* [Cargo]()
* [Poetry]()
* [Npm]()

Expand Down
14 changes: 0 additions & 14 deletions docs/src/commands/buffrs-generate.md

This file was deleted.

4 changes: 1 addition & 3 deletions docs/src/commands/buffrs-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ Lists all protobuf files (`.proto`) managed by Buffrs to standard out.

This command lists all protobuf files managed by Buffrs. This way the
output can be fed dynamically into external code generation tools like
`protoc` to do customize the behavior of the generator beyond the capabilities
that Buffrs provides out of the box through [`buffrs
generate`](./buffrs-generate.md).
`protoc`.

### Example

Expand Down
40 changes: 40 additions & 0 deletions docs/src/commands/buffrs-lock-print-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## buffrs lock print-files

Prints the locked files as JSON to stdout.

### Synopsis

`buffrs lock print-files`

### Description

> Note: This command is designed for consumption through other scripts and
> programs.

Using this command you can retrieve a list of files that buffrs downloads
according to the lockfile. For correct behavior please make sure your
`Proto.lock` is up to date when using this command!

### Example

Given a project that depends on a `physics` package at version `1.0.0` and a
populated `Proto.lock`:

```

```

Running `buffrs lock print-files` will print the following output derived from
the lockfile:

```
[
{
"url": "https://your.internal.registry/artifactory/your-repository/physics/physics-1.0.0.tgz",
"digest": "sha256:61ecdcd949c7b234160dc5aacb4546a21512de4ff8ea85f2fdd7d5fff2bf92b5"
}
]
```

This way you can programmatically consume this (e.g. in nix, bash, etc) and
download the files if your project while maintaining integrity.
Loading
Loading