refactor: merge forgejo crate into cli crate
All checks were successful
Test / build (map[name:nightly]) (push) Successful in 14m5s
Test / build (map[name:stable]) (push) Successful in 17m12s
Release Please / Release-plz (push) Successful in 1m43s
Release Please / Docker image (push) Successful in 6m22s

This commit is contained in:
Paul Campbell 2025-01-23 08:23:37 +00:00
parent f71e28512d
commit 52de3ef86e
15 changed files with 24 additions and 80 deletions

19
Cargo.lock generated
View file

@ -1059,6 +1059,7 @@ version = "0.14.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"assert2", "assert2",
"async-trait",
"bon", "bon",
"bytes", "bytes",
"chrono", "chrono",
@ -1069,7 +1070,6 @@ dependencies = [
"directories", "directories",
"git-conventional", "git-conventional",
"git-next-core", "git-next-core",
"git-next-forge-forgejo",
"git-next-forge-github", "git-next-forge-github",
"kameo", "kameo",
"kxio", "kxio",
@ -1085,6 +1085,7 @@ dependencies = [
"rstest 0.24.0", "rstest 0.24.0",
"secrecy", "secrecy",
"sendmail", "sendmail",
"serde",
"serde_json", "serde_json",
"standardwebhooks", "standardwebhooks",
"test-log", "test-log",
@ -1127,22 +1128,6 @@ dependencies = [
"ulid", "ulid",
] ]
[[package]]
name = "git-next-forge-forgejo"
version = "0.14.1"
dependencies = [
"assert2",
"async-trait",
"git-next-core",
"kxio",
"rand",
"secrecy",
"serde",
"serde_json",
"tokio",
"tracing",
]
[[package]] [[package]]
name = "git-next-forge-github" name = "git-next-forge-github"
version = "0.14.1" version = "0.14.1"

View file

@ -23,7 +23,6 @@ categories = ["development-tools"]
[workspace.dependencies] [workspace.dependencies]
git-next-core = { path = "crates/core", version = "0.14" } git-next-core = { path = "crates/core", version = "0.14" }
git-next-forge-forgejo = { path = "crates/forge-forgejo", version = "0.14" }
git-next-forge-github = { path = "crates/forge-github", version = "0.14" } git-next-forge-github = { path = "crates/forge-github", version = "0.14" }
# TUI # TUI

View file

@ -14,7 +14,7 @@ categories = { workspace = true }
[features] [features]
# default = ["forgejo", "github"] # default = ["forgejo", "github"]
default = ["forgejo", "github", "tui"] default = ["forgejo", "github", "tui"]
forgejo = ["git-next-forge-forgejo"] forgejo = []
github = ["git-next-forge-github"] github = ["git-next-forge-github"]
tui = [ tui = [
"ratatui", "ratatui",
@ -27,7 +27,6 @@ tui = [
[dependencies] [dependencies]
git-next-core = { workspace = true } git-next-core = { workspace = true }
git-next-forge-forgejo = { workspace = true, optional = true }
git-next-forge-github = { workspace = true, optional = true } git-next-forge-github = { workspace = true, optional = true }
# TUI # TUI
@ -55,6 +54,7 @@ git-conventional = { workspace = true }
# TOML parsing # TOML parsing
toml = { workspace = true } toml = { workspace = true }
serde = { workspace = true }
# Actors # Actors
kameo = { workspace = true } kameo = { workspace = true }
@ -86,6 +86,9 @@ sendmail = { workspace = true }
# desktop notifications # desktop notifications
notifica = { workspace = true } notifica = { workspace = true }
# git
async-trait = { workspace = true }
[dev-dependencies] [dev-dependencies]
# Testing # Testing
assert2 = { workspace = true } assert2 = { workspace = true }

View file

@ -2,7 +2,7 @@
use git_next_core::git::{ForgeLike, RepoDetails}; use git_next_core::git::{ForgeLike, RepoDetails};
#[cfg(feature = "forgejo")] #[cfg(feature = "forgejo")]
use git_next_forge_forgejo::ForgeJo; use crate::forges::forgejo::ForgeJo;
#[cfg(feature = "github")] #[cfg(feature = "github")]
use git_next_forge_github::Github; use git_next_forge_github::Github;

View file

@ -1,7 +1,8 @@
// //
#![allow(clippy::expect_used)] // used with mock net #![allow(clippy::expect_used)] // used with mock net
use crate::ForgeJo; use crate::forges::forgejo::ForgeJo;
use git_next_core::{ use git_next_core::{
git::{self, forge::commit::Status, ForgeLike as _}, git::{self, forge::commit::Status, ForgeLike as _},
server::{ListenUrl, RepoListenUrl}, server::{ListenUrl, RepoListenUrl},

View file

@ -2,7 +2,7 @@
use git_next_core::{git, server::RepoListenUrl, WebhookId}; use git_next_core::{git, server::RepoListenUrl, WebhookId};
use kxio::net::Net; use kxio::net::Net;
use crate::webhook::Hook; use crate::forges::forgejo::webhook::Hook;
pub async fn list( pub async fn list(
repo_details: &git::RepoDetails, repo_details: &git::RepoDetails,

View file

@ -1,5 +1,5 @@
// //
use crate as forgejo; use crate::forges::forgejo;
use git_next_core::{git, webhook}; use git_next_core::{git, webhook};

View file

@ -1,14 +1,17 @@
use git_next_core::git::forge::webhook::Error;
// //
use git_next_core::{git, server::RepoListenUrl, RegisteredWebhook, WebhookAuth, WebhookId}; use git_next_core::{
git::{self, forge::webhook::Error},
server::RepoListenUrl,
RegisteredWebhook, WebhookAuth, WebhookId,
};
use kxio::net::Net; use kxio::net::Net;
use secrecy::ExposeSecret as _; use secrecy::ExposeSecret as _;
use serde_json::json; use serde_json::json;
use tracing::{info, instrument, warn}; use tracing::{info, instrument, warn};
use crate::webhook; use crate::forges::forgejo::webhook;
use crate::webhook::Hook; use crate::forges::forgejo::webhook::Hook;
#[instrument(skip_all, fields(forge = %repo_details.forge.forge_alias(), repo = %repo_details.repo_alias))] #[instrument(skip_all, fields(forge = %repo_details.forge.forge_alias(), repo = %repo_details.repo_alias))]
pub async fn register( pub async fn register(

View file

@ -0,0 +1,3 @@
//
#[cfg(feature = "forgejo")]
pub mod forgejo;

View file

@ -11,6 +11,8 @@ mod repo;
mod root; mod root;
mod server; mod server;
mod forges;
#[cfg(feature = "tui")] #[cfg(feature = "tui")]
mod tui; mod tui;

View file

@ -1,43 +0,0 @@
[package]
name = "git-next-forge-forgejo"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
description = "Forgejo support for git-next, the trunk-based development manager"
[lints.clippy]
nursery = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
unwrap_used = "warn"
expect_used = "warn"
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
[dependencies]
git-next-core = { workspace = true }
# logging
tracing = { workspace = true }
# git
async-trait = { workspace = true }
# fs/network
kxio = { workspace = true }
# TOML parsing
serde = { workspace = true }
serde_json = { workspace = true }
# Secrets and Password
secrecy = { workspace = true }
# # Actors
tokio = { workspace = true }
[dev-dependencies]
# Testing
assert2 = { workspace = true }
rand = { workspace = true }

View file

@ -1,9 +0,0 @@
# git-next
## Trunk-based developement manager.
`git-next` is a combined server and command-line tool that enables trunk-based
development workflows where each commit must pass CI before being included in
the main branch.
See [git-next](https://crates.io/crates/git-next) for more information.