Jinal-Sarvaiya opened a new pull request, #172:
URL: https://github.com/apache/camel-kit/pull/172
# Support Adding Capabilities to Existing Camel 4 Projects
## Summary
Enables Camel Kit to enhance existing Apache Camel 4 applications by adding
new capabilities through the design → plan → execute → validate workflow, with
full version preservation, scope enforcement, and regression prevention.
**Closes:** #164
**Addresses:** #169 (Discovery, versions and compatibility) - 100% complete
**Addresses:** #170 (Feature-scoped design, execution and validation) - 100%
complete
**Coordinates with:** #168 (File preservation - @matheusandre1), #111
(Interface contract analysis), #52 (Broader Java DSL support), #167
(Documentation)
---
## Acceptance Criteria Coverage
### Issue #169: Existing projects - discover runtime, versions and
compatibility
#### AC1: Discovery records actual runtime, versions, DSL,
modules/routes/contracts and baseline
**Implementation:**
- **Runtime detection:** Spring Boot, Quarkus, Karaf, Camel Main via
`RuntimeDetector`
- **Version detection:** Camel version from `camel.version` property or
dependency resolution; platform BOM versions (Spring Boot, Quarkus)
- **DSL detection:** YAML, XML, Java, Groovy from route file extensions and
source paths
- **Module detection:** Maven multi-module projects via pom.xml scanning
- **Route discovery:** Route IDs and file paths recorded separately
- **Bean detection:** Annotations + YAML `beans:` blocks
- **Configuration:** `application*.properties/yml/yaml` via ConfigParser
- **Contract files:** OpenAPI, Swagger, AsyncAPI, WSDL, XSD, protobuf, Avro
inventory
- **Test baseline:** Test file inventory + optional test results via
`--record-baseline`
**Baseline files created:**
- `.camel-kit/baseline-routes.txt` - route file paths (scope protection)
- `.camel-kit/baseline-tests.txt` - test file names
- `.camel-kit/baseline-test-results.json` - passed/failed/timeout status
(regression detection)
- `.camel-kit/baseline-contracts.txt` - interface contract file paths (scope
protection)
**Evidence:** `ProjectDiscovery.java:25-48`, `InitService.java` (baseline
recording), tests in `ProjectDiscoveryTest` (29 tests), `InitServiceTest` (60
tests)
#### AC2: Missing or ambiguous information produces actionable results, not
guessed defaults
**Implementation:**
- **Undetectable Camel version:** `IllegalStateException` with remediation
hint ("Set camel.version property or add explicit org.apache.camel dependency
version")
- **Unsupported version:** `project.unsupportedVersion=true` for Camel 3.x
(detected but not supported)
- **Unsupported combinations:** `project.unsupportedCombination` records
actionable reasons:
- "Runtime 'karaf' (camel-blueprint) is not supported. Existing-project
features support Camel Main, Spring Boot and Quarkus."
- "No YAML routes were found; detected DSL: [XML, Java]. Existing-project
features currently support YAML routes only, and the DSL is never converted."
- **Discovery gaps:** `project.discoveryGaps` records incomplete coverage:
- "No routes were found in the project graph. Inspect the existing route
sources before changing them."
- "Routes in more than one DSL were found (JAVA, YAML). New routes use
YAML; do not convert the others."
**Evidence:**
`ProjectDiscovery.DiscoveryResult.unsupportedCombinationReasons():222-235`,
`coverageGaps():241-253`,
`InitServiceTest.existingProjectWithUndetectableVersionThrowsError()`,
`existingProjectWithUnsupportedCamelVersionIsDetected()`
#### AC3: Preserve existing setup - versions and DSL unchanged, checks use
discovered constraints
**Implementation:**
- **No pom.xml modification:** `pom.xml` never touched during init
- **Version preservation:** Detected versions recorded as LOCKED constraints
in `config.properties`
- **DSL preservation:** Primary DSL detected and enforced; no conversion
- **Skill constraint loading:** All workflow skills (`camel-plan`,
`camel-execute`, `camel-validate`) load discovered constraints from
`config.properties` and baseline files
- **Scope enforcement:** `camel-execute` verifies new routes use
`project.primaryDsl`, protects baseline routes/tests/contracts unless in
approved scope
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]