Skip to content

refactor: migrate to ceres application/transport paths and centralize HTTP errors#2139

Merged
genedna merged 4 commits into
gitmono-dev:mainfrom
benjamin-747:main
Jun 30, 2026
Merged

refactor: migrate to ceres application/transport paths and centralize HTTP errors#2139
genedna merged 4 commits into
gitmono-dev:mainfrom
benjamin-747:main

Conversation

@benjamin-747

Copy link
Copy Markdown
Collaborator

No description provided.

…er builds

Move mono HTTP DTOs into ceres/model (admin, webhook, bot, note, group) and
route label/group logic through MonoApiService facades so mono no longer
imports jupiter::model. Add CI guard for the DTO boundary, document the
three-layer model rules in ceres/README, and relocate ProtocolError HTTP
mapping to mono.

Extract SeaORM migrations into jupiter-migrate with optional jupiter/migrate
feature gating, fold context into mono/bootstrap, and slim common by
removing axum. Update mono routers, storage init, and workspace deps
accordingly.
…main modules

Introduce MonoAppServices and TransportContext so mono routers stop calling
storage directly, and split MonoApiService into domain modules (user, issue,
conversation, code review, gpg, note, reviewer, cl_list, etc.). Move
notification dispatch/triggers and webhook admin/delivery into ceres
application, relocate pack helpers to infra, and extend CI guards for
callisto, jupiter::service, transport/application, and router storage access.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce12185a4f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 66 to 67
let tag_info = api
.create_tag(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate tag names before dispatching to imported repos

When req.path_context selects an imported repository, this now forwards req.name directly to ImportApiService::create_tag; the router-level validate_tag_name(&req.name)? was removed, and only the monorepo implementation validates internally. That lets imported-repo requests create tags such as bad tag, foo..bar, or .lock names and persist invalid refs/tags/... rows, whereas the same inputs were previously rejected before dispatch.

Useful? React with 👍 / 👎.

Comment thread common/src/errors.rs
// Preserve HTTP semantics across crates: ApiError can parse [code:404].
MegaError::NotFound(msg) => GitError::CustomError(format!("[code:404] {msg}")),
MegaError::NotFound(msg) => GitError::CustomError(msg),
MegaError::BadRequest(msg) => GitError::CustomError(msg),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve client status when converting MegaError to GitError

When a typed client error crosses an ApiHandler boundary that returns GitError (for example create_tag_impl uses ? on tag-name validation and duplicate-tag errors), this branch strips the 400/409 semantics and leaves only a free-form CustomError string. The later ApiError mapping does not recognize messages like Tag name must not be empty or Tag 'x' already exists, so these user errors become generic 500 responses instead of the documented client errors.

Useful? React with 👍 / 👎.

… HTTP errors

Deprecate ceres legacy re-exports (api_service, pack, protocol, build_trigger,
code_edit) and switch mono/ceres call sites to application::* and transport::*.
Add typed MegaError variants with shared HTTP status mapping in common, simplify
mono ApiError, and improve Git SSH protocol error handling.

Further thin group/tag/artifacts routers via MonoApiService facades and extend
CI guards to block legacy ceres import paths in mono.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c4108a202

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread mono/src/api/mod.rs

fn note_stg(&self) -> NoteStorage {
self.storage.note_storage()
pub(crate) fn lfs_service(&self) -> jupiter::service::lfs_service::LfsService {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep jupiter service types out of mono

The new boundary step in .github/workflows/base.yml runs rg -q 'jupiter::service::' mono/src/ and exits 1 on any match; I checked that exact command and it matches this helper. As a result, the clippy job fails before clippy runs on every PR until this type is hidden behind a facade/type alias outside mono/src or the workflow rule is adjusted.

Useful? React with 👍 / 👎.

Comment on lines +21 to +22
validate_webhook_target_url(&payload.target_url)
.map_err(|e| MegaError::Other(e.to_string()))?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return bad request for invalid webhook input

For create-webhook requests with an invalid target URL, this now maps validate_webhook_target_url failures to MegaError::Other; ApiError treats Other without a legacy code as a 500 and hides the message. Before the refactor the router used ApiError::bad_request, so invalid URLs (and similarly empty secrets/invalid event types in this method) regress from client-visible 400s to generic 500s.

Useful? React with 👍 / 👎.

Comment thread jupiter/src/tests.rs
Comment on lines +100 to 101
#[cfg(feature = "migrate")]
apply_migrations(&connection, true).await.unwrap();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Run test migrations for default jupiter tests

Because jupiter now has empty default features, the #[cfg(feature = "migrate")] gate means cargo test --manifest-path jupiter/Cargo.toml builds test_storage without creating any schema, while many jupiter tests call test_storage and immediately access migrated tables. Before the migration extraction this helper always applied migrations, so default local test runs now fail with missing-table database errors unless callers remember --all-features.

Useful? React with 👍 / 👎.

@benjamin-747 benjamin-747 requested a review from genedna June 30, 2026 12:12
@genedna genedna added this pull request to the merge queue Jun 30, 2026
Merged via the queue into gitmono-dev:main with commit 41ca003 Jun 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants