Compare commits

..

No commits in common. "0656784d4177ebeea6490b7434c79c1a30256d73" and "b89431b7798dec0ab80010d76327bef89b94eeb0" have entirely different histories.

9 changed files with 48 additions and 58 deletions

View file

@ -4,6 +4,8 @@ linker = "/usr/bin/clang-16"
rustflags = [ rustflags = [
"-C", "-C",
"link-arg=--ld-path=/usr/bin/mold", "link-arg=--ld-path=/usr/bin/mold",
"--cfg",
"tokio_unstable",
] ]
[profile.dev] [profile.dev]
@ -12,3 +14,4 @@ strip = "debuginfo"
[env] [env]
RUST_LOG = "hyper=warn,git_url_parse=warn,debug" RUST_LOG = "hyper=warn,git_url_parse=warn,debug"
RUSTFLAGS = "--cfg tokio_unstable"

View file

@ -2,23 +2,8 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.12.1] - 2024-07-29
### Bug Fixes
- Webhook secret doesn't need to be base64 encoded ([691a733](https://git.kemitix.net/kemitix/git-next/commit/691a733fc37cfba5d9be72b57e24c5b9d3c1218a))
- Remove requirement for RUSTFLAGS to be set ([e56d6a3](https://git.kemitix.net/kemitix/git-next/commit/e56d6a3ebbb4b4bfcaacc986269ba898ffbd1bc6))
- Make default server config example valid ([b7abe94](https://git.kemitix.net/kemitix/git-next/commit/b7abe949e2067e1c3663d45a520385d967f19af8))
### Miscellaneous Tasks
- Update create publishing command ([bf12712](https://git.kemitix.net/kemitix/git-next/commit/bf12712bcaaefe6ae7da113e03b739b42d860fcf))
- Remove deprecated crates ([5dc0de8](https://git.kemitix.net/kemitix/git-next/commit/5dc0de8a05d610c3a5b7be00aac1033763a76949))
## [0.12.0] - 2024-07-28 ## [0.12.0] - 2024-07-28
[656ec4a](https://git.kemitix.net/kemitix/git-next/commit/656ec4a534b5b55ddceb05eee6ed610207ac33d4)...[b89431b](https://git.kemitix.net/kemitix/git-next/commit/b89431b7798dec0ab80010d76327bef89b94eeb0)
### Bug Fixes ### Bug Fixes
- Don't log content of internal messages ([3ae1132](https://git.kemitix.net/kemitix/git-next/commit/3ae113212af3ee43f36383a22984e03e3f44f3f2)) - Don't log content of internal messages ([3ae1132](https://git.kemitix.net/kemitix/git-next/commit/3ae113212af3ee43f36383a22984e03e3f44f3f2))
@ -38,7 +23,6 @@ All notable changes to this project will be documented in this file.
- Remove deprecated crates ([5a595ec](https://git.kemitix.net/kemitix/git-next/commit/5a595ec9eed77cf961f01c671c69ca2bc7988092)) - Remove deprecated crates ([5a595ec](https://git.kemitix.net/kemitix/git-next/commit/5a595ec9eed77cf961f01c671c69ca2bc7988092))
- Bump gix from 0.63 to 0.64 ([b24675d](https://git.kemitix.net/kemitix/git-next/commit/b24675d48a3e35a9d780a7f7f8cbfb1477765a7b)) - Bump gix from 0.63 to 0.64 ([b24675d](https://git.kemitix.net/kemitix/git-next/commit/b24675d48a3e35a9d780a7f7f8cbfb1477765a7b))
- Bump mockall from 0.12 to 0.13 ([22faa85](https://git.kemitix.net/kemitix/git-next/commit/22faa851dcdd99451c736290bc17b17cbe6aa55c)) - Bump mockall from 0.12 to 0.13 ([22faa85](https://git.kemitix.net/kemitix/git-next/commit/22faa851dcdd99451c736290bc17b17cbe6aa55c))
- Release 0.12.0 ([b89431b](https://git.kemitix.net/kemitix/git-next/commit/b89431b7798dec0ab80010d76327bef89b94eeb0))
### Refactor ### Refactor

View file

@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/*"] members = ["crates/*"]
[workspace.package] [workspace.package]
version = "0.12.1" # Update git-next-* under workspace.dependencies version = "0.12.0" # Update git-next-* under workspace.dependencies
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
@ -26,10 +26,19 @@ git-next-core = { path = "crates/core", version = "0.12" }
git-next-forge-forgejo = { path = "crates/forge-forgejo", version = "0.12" } git-next-forge-forgejo = { path = "crates/forge-forgejo", version = "0.12" }
git-next-forge-github = { path = "crates/forge-github", version = "0.12" } git-next-forge-github = { path = "crates/forge-github", version = "0.12" }
# remove after 0.12.0
git-next-server = { path = "crates/server", version = "0.12" }
git-next-server-actor = { path = "crates/server-actor", version = "0.12" }
git-next-forge = { path = "crates/forge", version = "0.12" }
git-next-repo-actor = { path = "crates/repo-actor", version = "0.12" }
git-next-webhook-actor = { path = "crates/webhook-actor", version = "0.12" }
git-next-file-watcher-actor = { path = "crates/file-watcher-actor", version = "0.12" }
# CLI parsing # CLI parsing
clap = { version = "4.5", features = ["cargo", "derive"] } clap = { version = "4.5", features = ["cargo", "derive"] }
# logging # logging
console-subscriber = "0.3"
tracing = "0.1" tracing = "0.1"
tracing-subscriber = "0.3" tracing-subscriber = "0.3"

View file

@ -29,6 +29,7 @@ clap = { workspace = true }
kxio = { workspace = true } kxio = { workspace = true }
# logging # logging
console-subscriber = { workspace = true }
tracing = { workspace = true } tracing = { workspace = true }
tracing-subscriber = { workspace = true } tracing-subscriber = { workspace = true }

View file

@ -39,9 +39,7 @@ async fn send_webhook(
tracing::warn!("Invalid notification configuration (config) - can't sent notification"); tracing::warn!("Invalid notification configuration (config) - can't sent notification");
return; return;
}; };
let Ok(webhook) = let Ok(webhook) = Webhook::new(webhook_config.secret().expose_secret()) else {
Webhook::from_bytes(webhook_config.secret().expose_secret().as_bytes().into())
else {
tracing::warn!("Invalid notification configuration (signer) - can't sent notification"); tracing::warn!("Invalid notification configuration (signer) - can't sent notification");
return; return;
}; };

View file

@ -11,7 +11,7 @@ use actor::ServerActor;
use git_next_core::git::RepositoryFactory; use git_next_core::git::RepositoryFactory;
use kxio::{fs::FileSystem, network::Network}; use kxio::{fs::FileSystem, network::Network};
use tracing::info; use tracing::{info, level_filters::LevelFilter};
use std::path::PathBuf; use std::path::PathBuf;
@ -68,16 +68,20 @@ pub fn start(
} }
pub fn init_logging() { pub fn init_logging() {
use tracing::Level; use tracing_subscriber::prelude::*;
use tracing_subscriber::FmtSubscriber; use tracing_subscriber::EnvFilter;
let subscriber = FmtSubscriber::builder() let subscriber = tracing_subscriber::fmt::layer()
.with_target(false) .with_target(false)
.with_file(true) .with_file(true)
.with_line_number(true) .with_line_number(true)
.with_max_level(Level::INFO) .with_filter(
.finish(); EnvFilter::builder()
.with_default_directive(LevelFilter::INFO.into())
#[allow(clippy::expect_used)] .from_env_lossy(),
tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed"); );
tracing_subscriber::registry()
.with(console_subscriber::ConsoleLayer::builder().spawn())
.with(subscriber)
.init();
} }

View file

@ -1,26 +1,25 @@
[http] # where to listen for incoming updates from forges [http]
addr = "0.0.0.0" addr = "0.0.0.0"
port = 8080 port = 8080
[webhook] # where forge should send updates to - should be route to 'http.addr:http.port' above (e.g. using a reverse proxy) [webhook]
url = "https://localhost:8080" # don't include any query path or a trailing slash url = "https://localhost:8080" # don't include any query path or a trailing slash
[notification] # where updates from git-next should be sent to alert the user [storage]
type = "None"
# type = "Webhook"
# webhook = { url = "https//localhost:9090", secret = "secret-password" }
[storage] # where local copies of repositories will be cloned (bare) into
path = "./data" path = "./data"
[forge] # the forges to connect to [notifications]
type = "WebHook"
webhook = { url = "https://localhost:9090" }
# [forge.default] [forge]
# forge_type = "ForgeJo"
# hostname = "git.example.net" [forge.default]
# user = "bob" # the user to perform actions as forge_type = "ForgeJo"
# token = "API-Token" hostname = "git.example.net"
# user = "git-next" # the user to perform actions as
# [forge.default.repos] # the repos at the forge to manage token = "API-Token"
# hello = { repo = "bob/hello", branch = "main", gitdir = "/opt/git/projects/bob/hello.git" }
# world = { repo = "bob/world", branch = "master", main = "master", next = "upcoming", "dev" = "develop" } [forge.default.repos]
hello = { repo = "user/hello", branch = "main", gitdir = "/opt/git/projects/user/hello.git" } # maps to https://git.example.net/user/hello on the branch 'main'
world = { repo = "user/world", branch = "master", main = "master", next = "upcoming", "dev" = "develop" } # maps to the 'master' branch

View file

@ -13,6 +13,7 @@ github = []
[dependencies] [dependencies]
# logging # logging
console-subscriber = { workspace = true }
tracing = { workspace = true } tracing = { workspace = true }
tracing-subscriber = { workspace = true } tracing-subscriber = { workspace = true }

View file

@ -42,21 +42,12 @@ grcov-coverage:
publish version: publish version:
#!/usr/bin/bash -e #!/usr/bin/bash -e
echo "Publishing git-next v{{version}} to crates.io..." [[ -z $(git status --short) ]] || echo "Worktree is Dirty - aborting" ; exit
if [ -z $(git status --short) ]; then echo "Clean"
echo "Worktree is clean - proceeding"
else
echo "Worktree is Dirty - aborting" ; exit
fi
git co v{{version}} git co v{{version}}
ORDER=$(cargo publish-workspace --target-version {{version}} --crate-prefix git-next --show-order 2>/dev/null | cut -d\ -f2-) ORDER=$(cargo publish-workspace --target-version {{version}} --crate-prefix git-next --show-order 2>/dev/null | cut -d\ -f2-)
echo "Publishing crates in order: ${ORDER}"
# INFO: Why not use publish-workspace to publish? It doesn't support when crates-io registry is replaced # INFO: Why not use publish-workspace to publish? It doesn't support when crates-io registry is replaced
for P in ${ORDER} for P in ${ORDER}
do do
echo "Publishing ${P}..."
cargo publish --registry crates-io -p $P cargo publish --registry crates-io -p $P
echo "Done: ${P}"
echo "======================================"
done done
echo "All crates published"