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

Bump runtime image to bookworm, update pre-commit #156

Merged
merged 6 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-byte-order-marker
- id: check-case-conflict
Expand All @@ -13,11 +13,11 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: [email protected]:famedly/backend-pre-commit-templates.git
rev: main
rev: 548bf6ae934623c72e2e5f90e095b45259b6f4ba
hooks:
- id: fmt
- id: clippy
- repo: https://github.com/crate-ci/typos
rev: v1.16.3
rev: typos-v0.10.26
hooks:
- id: typos
142 changes: 17 additions & 125 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ opentelemetry = { version = "0.21.0", features = ["metrics"] }
opentelemetry_sdk = { version = "0.21.1", features = ["metrics", "rt-tokio"] }
opentelemetry-prometheus = "0.14.1"
rand = "0.8.5"
reqwest = { version = "0.11", features = ["json"] }
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
tokio = { version = "1.32.0", features = ["full"] }
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY . /app
WORKDIR /app
RUN cargo auditable build --release

FROM debian:bullseye-slim
FROM debian:bookworm-slim

RUN apt-get update -qq -o Acquire::Languages=none && \
env DEBIAN_FRONTEND=noninteractive apt-get install \
Expand All @@ -39,4 +39,4 @@ ARG service_port_number=7022
EXPOSE ${service_port_number}/tcp
ENV SERVICE_PORT=${service_port_number}
HEALTHCHECK --interval=3s --timeout=3s --retries=2 --start-period=5s \
CMD curl -fSs http://localhost:$SERVICE_PORT/health || exit 1
CMD curl -fSs http://localhost:$SERVICE_PORT/health || exit 1
9 changes: 4 additions & 5 deletions tests/pusher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ async fn run_request(
http::Request::post("/_matrix/push/v1/notify")
.header(CONTENT_TYPE, "application/json")
.header(CONTENT_LENGTH, body.as_bytes().len())
.body(axum::body::Body::from(body))?,
.body(Body::from(body))?,
)
.await?;

Expand All @@ -201,8 +201,7 @@ async fn check_prom(
service: &mut Router<(), Body>,
filename: &str,
) -> Result<(), Box<dyn std::error::Error>> {
let resp =
service.call(http::Request::get("/metrics").body(axum::body::Body::empty())?).await?;
let resp = service.call(http::Request::get("/metrics").body(Body::empty())?).await?;
let data = response_to_string(resp).await?;

let re = Regex::new(r"} [0-9]\.[0-9]+")?;
Expand Down Expand Up @@ -245,7 +244,7 @@ async fn bad_json() -> Result<(), Box<dyn std::error::Error>> {
http::Request::post("/_matrix/push/v1/notify")
.header(CONTENT_TYPE, "application/json")
.header(CONTENT_LENGTH, body.as_bytes().len())
.body(axum::body::Body::from(body))?,
.body(Body::from(body))?,
)
.await?;
let data = response_to_string(resp).await?;
Expand Down Expand Up @@ -275,7 +274,7 @@ async fn push_body_limit() -> Result<(), Box<dyn std::error::Error>> {
http::Request::post("/_matrix/push/v1/notify")
.header(CONTENT_TYPE, "application/json")
.header(CONTENT_LENGTH, body.as_bytes().len())
.body(axum::body::Body::from(body))?,
.body(Body::from(body))?,
)
.await?;

Expand Down
Loading