[ISSUE-86] Multi-module Gradle restructure — Refactor CFTunnels into :common, :cftunnels-service, :portainer-automation
#125
Labels
No Label
architect:complete
blocked-by:#139
blocks:#140
bug
CI/CD
complexity:low
complexity:medium
complexity:medium
config
depends-on:#124
docker
docs
effort:l
effort:s
effort:xs
epic/development
lead:complete
needs-decision
performance
priority:critical
priority:high
priority:low
priority:medium
security
spike
story-points:1
story-points:3
story-points:5
story-points:8
tech-debt
test
user-story
architect:complete
complexity:high
complexity:low
complexity:medium
cross-repo
cross-repo-dev
dev:in-progress
effort:l
effort:m
effort:s
effort:xl
effort:xs
epic
analytics
epic
development
epic
devops
epic
infra
epic
observability
epic
platform
epic
product
lead:complete
needs-decision
pipeline-complete
pipeline-error
pipeline-running
priority
later
priority
next
priority
now
start-pipeline
status
acceptance
status
blocked
status
done
status
in progress
status
in review
status
in testing
status
ready
status
refine
status
triage
subtask
type
analysis
type
bug
type
hygiene
type
mantainence
type
story
user-story
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Hithomelabs/CFTunnels#125
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Dave/CFTunnels:ISSUE-86"
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?
Summary
Restructured CFTunnels from a single-module Gradle project into a multi-module project with 3 modules:
:common— shared library withRestTemplateConfigextracted from the service:cftunnels-service— the existing Cloudflare Tunnel service (moved and package-renamed):portainer-automation— scaffolded placeholder Spring Boot app (port 8081)Changes Made
settings.gradle, rootbuild.gradle(coordinating subprojects),gradle.propertiessrc/→cftunnels-service/src/with package renamecom.hithomelabs.CFTunnels→com.hithomelabs.cftunnels:commonmodule: ExtractedRestTemplateConfigtocom.hithomelabs.common.configwith updated imports in service classes:portainer-automationscaffold: Minimal Spring Boot application on port 8081test_image_build_push.yml—bootBuildImage→:cftunnels-service:bootBuildImagecftunnels-service/Dockerfilethat builds the whole project and produces the service JARFiles Changed
settings.gradle,gradle.propertiescftunnels-service/(build.gradle, Dockerfile, all moved/renamed sources)common/(build.gradle, RestTemplateConfig)portainer-automation/(build.gradle, Application class, properties)build.gradle,.gitea/workflows/test_image_build_push.ymlDockerfile, oldsrc/directoryIssues
Testing
All 31 unit tests pass:
CfTunnelsApplicationTests (1) ✓
TunnelControllerTest (19) ✓
RequestRepositoryTest (2) ✓
CloudflareAPIServiceTest (9) ✓
./gradlew :cftunnels-service:build— compiles and passes all unit tests./gradlew :common:build— compiles./gradlew :portainer-automation:build— compiles./gradlew build— everything buildstest_build.ymlandintegration_test.yamlwere NOT modifiedOnly
test_image_build_push.ymlhas a 1-line change (bootBuildImage→:cftunnels-service:bootBuildImage)PR Review: [ISSUE-86] Multi-module Gradle restructure
Overview
Restructures CFTunnels from a single-module to a 3-module Gradle project (
:common,:cftunnels-service,:portainer-automation) with package rename fromcom.hithomelabs.CFTunnels→com.hithomelabs.cftunnels. 56 files changed (+266/-201).Code Quality ✅
build.gradle: Properly usesapply falseon plugins in root, common config viasubprojects {}, shared BOM management — clean multi-module setup.settings.gradle: Correctly includes all 3 subprojects.common/build.gradle: Minimal, correct dependencies for a library module (spring-context, spring-web, jackson-databind, httpclient5). No boot plugin — correct.cftunnels-service/build.gradle: Applies Spring Boot plugin, depends on:common, preserves all original dependencies and test configuration (ciprofile,integrationTestOnlytask, etc.).portainer-automation/build.gradle: Clean scaffold — Spring Boot on 8081 with validation support.Package Migration ✅
com.hithomelabs.CFTunnels→com.hithomelabs.cftunnelsCfTunnelsApplicationuses@SpringBootApplication(scanBasePackages = "com.hithomelabs")— this correctly picks up beans from the:commonmodule'scom.hithomelabs.common.configpackageExtract to
:common✅RestTemplateConfigwith Jackson customization (WRAP_ROOT_VALUE, NON_NULL) extracted tocom.hithomelabs.common.configRestTemplatevia injection — clean separationDockerfile ✅
Dockerfiledeleted, replaced with multi-stagecftunnels-service/Dockerfile:cftunnels-service:bootJaropenjdk:17-jdk-slim— best practiceCI Workflow Changes ✅
test_build.yml: Unchanged (verified same SHAae070cde)integration_test.yaml: Unchanged (verified same SHA4c4ee37f)test_image_build_push.yml: Only 1-line change —bootBuildImage→:cftunnels-service:bootBuildImage✓Observations & Minor Suggestions
portainer-automationcomponent scanning:PortainerAutomationApplicationdoes not setscanBasePackages. If it later needs beans from:common, it would needscanBasePackages = "com.hithomelabs"since its packagecom.hithomelabs.portaineris not a parent ofcom.hithomelabs.common.config. Not a blocker for the scaffold.build.gradlepinnedspring-boot-starter-oauth2-clientat3.5.5(higher than Boot BOM3.4.5). The new setup correctly lets the BOM manage this. Minor improvement, not a regression.httpclient5in:common: The dependency is declared but not directly used inRestTemplateConfig. It enables Apache HttpClient 5 as the underlying transport forRestTemplate. Consider adding a comment noting why it's included.Approval Status
APPROVED ✅ — Ready for human merge.
All constraints verified:
test_build.ymlandintegration_test.yamluntouchedtest_image_build_push.ymlhas the required 1-line changeThis is a well-executed multi-module restructuring. Good work.
Lead Agent Review Complete ✅
Decision: APPROVED — Ready for human merge.
Key Review Points
:common,:cftunnels-service,:portainer-automation)CFTunnels→cftunnelsapplied consistently across all files@SpringBootApplication(scanBasePackages = "com.hithomelabs")ensures cross-module bean discoverytest_build.ymlandintegration_test.yamluntouched (verified by SHA)test_image_build_push.ymlhas the required 1-line changeRestTemplateConfigproperly extracted to:commonLabels Added
Minor Suggestion
PortainerAutomationApplicationmay needscanBasePackages = "com.hithomelabs"when it starts consuming beans from:common(not needed for scaffold)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Reviewed by Linus (Lead Engineer Agent)
looks good to me