chore: migrate repo/release/user/actions into fj-core ops (FJ-11) #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/migrate-medium-areas-fj-11"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
FJ-11: Phase 4b - migrate medium areas (repo, release, user, actions)
Subtask of FJ-8 (Phase 4 umbrella), part of FJ-3. Applies the Phase 4 migration pattern established in FJ-10 (batch 4a) to the four medium-sized command areas.
What changed
Every
forgejo-apicall incrates/fj/src/{repo,release,user,actions}.rsnow lives in anfj-coreoperation that returnsforgejo-apistructs (or a small owned value). Each binaryrun()/helper is reduced to: map args to typed params, call thefj-coreop, render the result with the existingSpecialRender/markdown/render_label*helpers.crates/fj-core/src/{actions,release,user}.rs.crates/fj-core/src/repo.rsgains operation fns alongside its existingRepoName/RepoArgtypes; the module is promoted frommod repotopub mod repo(the flatfj_core::RepoArg/...re-exports are unchanged).gpgsubprocess, SSH key-file discovery, and the git clone/push inrepo create.ForgejoErrorso the binary keeps its existingCONFLICT/--forcecreate-or-update handling.No new fj-core dependencies
To avoid widening
fj-core's dependency surface, the release lookup uses.all()instead of afuturesstream, and byte payloads (repo_get_raw_file,repo_get_archive,download_release_attachment) returnVec<u8>instead of pulling inbytes.Cargo.lockis unchanged andcargo build --lockedpasses.Note on the acceptance-criteria wording (comrak)
The issue lists
comrakamong the crates thefj-coretree must stay free of.comrakis already a directfj-coredependency (added in FJ-7/FJ-10) and is explicitly allowed by thefj-corelib.rsdoc comment ("Markdown parsing via comrak is allowed"). This migration adds no new dependencies, so the tree is unchanged:clap,crossterm, andfluentare absent;comrakremains as before. Flagging in case the AC text should be reconciled with the merged 4a state.Verification
cargo build --locked(workspace): pass.cargo tree -p fj-core -e normal | grep -E 'clap|crossterm|fluent': prints nothing.just check(fmt + clippy-D warnings+ build + builder-stage docker compile): pass.cargo test: pass.forgejo-apicalls remain in the four binary modules.Done when
fj-coreoperations returningforgejo-apistructs.run()only parses args and renders; no directforgejo-apicalls remain in these modules.fj-coredependency tree stays free of clap / crossterm / fluent (comrak unchanged, see note above).just checkgreen; no user-visible behavior change.Refs FJ-11.