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 = [
"-C",
"link-arg=--ld-path=/usr/bin/mold",
"--cfg",
"tokio_unstable",
]
[profile.dev]
@ -12,3 +14,4 @@ strip = "debuginfo"
[env]
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.
## [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
[656ec4a](https://git.kemitix.net/kemitix/git-next/commit/656ec4a534b5b55ddceb05eee6ed610207ac33d4)...[b89431b](https://git.kemitix.net/kemitix/git-next/commit/b89431b7798dec0ab80010d76327bef89b94eeb0)
### Bug Fixes
- 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))
- 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))
- Release 0.12.0 ([b89431b](https://git.kemitix.net/kemitix/git-next/commit/b89431b7798dec0ab80010d76327bef89b94eeb0))
### Refactor

View file

@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/*"]
[workspace.package]
version = "0.12.1" # Update git-next-* under workspace.dependencies
version = "0.12.0" # Update git-next-* under workspace.dependencies
edition = "2021"
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-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
clap = { version = "4.5", features = ["cargo", "derive"] }
# logging
console-subscriber = "0.3"
tracing = "0.1"
tracing-subscriber = "0.3"

View file

@ -29,6 +29,7 @@ clap = { workspace = true }
kxio = { workspace = true }
# logging
console-subscriber = { workspace = true }
tracing = { 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");
return;
};
let Ok(webhook) =
Webhook::from_bytes(webhook_config.secret().expose_secret().as_bytes().into())
else {
let Ok(webhook) = Webhook::new(webhook_config.secret().expose_secret()) else {
tracing::warn!("Invalid notification configuration (signer) - can't sent notification");
return;
};

View file

@ -11,7 +11,7 @@ use actor::ServerActor;
use git_next_core::git::RepositoryFactory;
use kxio::{fs::FileSystem, network::Network};
use tracing::info;
use tracing::{info, level_filters::LevelFilter};
use std::path::PathBuf;
@ -68,16 +68,20 @@ pub fn start(
}
pub fn init_logging() {
use tracing::Level;
use tracing_subscriber::FmtSubscriber;
use tracing_subscriber::prelude::*;
use tracing_subscriber::EnvFilter;
let subscriber = FmtSubscriber::builder()
let subscriber = tracing_subscriber::fmt::layer()
.with_target(false)
.with_file(true)
.with_line_number(true)
.with_max_level(Level::INFO)
.finish();
#[allow(clippy::expect_used)]
tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");
.with_filter(
EnvFilter::builder()
.with_default_directive(LevelFilter::INFO.into())
.from_env_lossy(),
);
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"
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
[notification] # where updates from git-next should be sent to alert the user
type = "None"
# type = "Webhook"
# webhook = { url = "https//localhost:9090", secret = "secret-password" }
[storage] # where local copies of repositories will be cloned (bare) into
[storage]
path = "./data"
[forge] # the forges to connect to
[notifications]
type = "WebHook"
webhook = { url = "https://localhost:9090" }
# [forge.default]
# forge_type = "ForgeJo"
# hostname = "git.example.net"
# user = "bob" # the user to perform actions as
# token = "API-Token"
#
# [forge.default.repos] # the repos at the forge to manage
# 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]
[forge.default]
forge_type = "ForgeJo"
hostname = "git.example.net"
user = "git-next" # the user to perform actions as
token = "API-Token"
[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]
# logging
console-subscriber = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }

View file

@ -42,21 +42,12 @@ grcov-coverage:
publish version:
#!/usr/bin/bash -e
echo "Publishing git-next v{{version}} to crates.io..."
if [ -z $(git status --short) ]; then
echo "Worktree is clean - proceeding"
else
echo "Worktree is Dirty - aborting" ; exit
fi
[[ -z $(git status --short) ]] || echo "Worktree is Dirty - aborting" ; exit
echo "Clean"
git co v{{version}}
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
for P in ${ORDER}
do
echo "Publishing ${P}..."
cargo publish --registry crates-io -p $P
echo "Done: ${P}"
echo "======================================"
done
echo "All crates published"