enrichment schema 2

This commit is contained in:
2026-06-13 07:33:30 +02:00
parent 8641c7266f
commit f85a68d9fc
12 changed files with 675 additions and 67 deletions

View File

@@ -38,21 +38,30 @@ public class AppProps {
2. Index their fields with the prefix (e.g., `app.messaging.queueName`).
3. When these beans are injected into a service, link the service's usage to the resolved property value.
## 3. Property Resolver (The "Config Scanner")
A component dedicated to building a global map of available properties.
## 3. Profile-Aware Property Resolver
A component dedicated to building a multi-dimensional map of available properties.
1. **File Scanning**: Parse `application.properties`, `application.yml`, and `bootstrap.yml`.
2. **Profile Support**: Handle `application-{profile}.yml` if a profile is active.
3. **Property Map**: Create a `Map<String, String>` of all key-value pairs.
1. **File Scanning**: Parse `application.properties`, `application.yml`, and `bootstrap.yml`.
2. **Profile Identification**:
- From filenames: `application-{profile}.properties`.
- From YAML documents: `spring.config.activate.on-profile` (Spring Boot 2.4+).
3. **The Multi-Profile Map**:
- Instead of one map, we store: `Map<ProfileName, Map<Key, Value>>`.
- The "default" profile is the base.
## 4. Value Propagation (Data Flow)
Once a value is resolved or its placeholder is identified, we track its usage.
## 4. Smart Value Propagation
When a trigger uses a property, we want to know it's profile-dependent.
**Example Trace**:
1. `application.yml` -> `app.queue: "orders"`
2. `OrderService` -> `@Value("${app.queue}") String q;` -> `this.queue = q;`
3. `OrderService.send()` -> `sm.sendEvent(this.queue);`
4. **Resolution**: The "Event" for this trigger is "orders".
1. `application.yml` -> `app.queue: "orders"`
2. `application-prod.yml` -> `app.queue: "orders-prod"`
3. `TriggerPoint` stores:
- `placeholder: "${app.queue}"`
- `defaultResolvedValue: "orders"`
4. **Rendering Strategy**: The renderer can show "orders" by default, but provide a "Profile Toggle" to switch to "prod" and see the labels update to "orders-prod".
## 5. Metadata Retention
We should never "squash" profiles during analysis. The `CodebaseMetadata` will carry the full profile matrix to the exporter.
## 5. SpEL (Spring Expression Language) Lite
Full SpEL support is hard for static analysis, but we can support "Common Patterns":