Skip to content

Commit 04c4943

Browse files
authored
refactor: renamed ChangeUnit to Change (#390)
1 parent 7fd0a73 commit 04c4943

File tree

139 files changed

+958
-972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+958
-972
lines changed

CLAUDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ This is a multi-module Gradle project using Kotlin DSL.
112112
- **Critical**: Hierarchical context MUST be built before driver initialization
113113

114114
**Pipeline Architecture**: Change execution organized in stages:
115-
- `LoadedPipeline` - Executable pipeline with stages and change units
115+
- `LoadedPipeline` - Executable pipeline with stages and changes
116116
- `pipeline.yaml` - Declarative pipeline definition in `src/test/resources/flamingock/`
117-
- Stages contain change units which are atomic migration operations
117+
- Stages contain changes which are atomic migration operations
118118

119119
**AuditStore System**: Database/system-specific implementations:
120120
- `AuditStore` interface provides `ConnectionEngine` for specific technologies
@@ -130,7 +130,7 @@ This is a multi-module Gradle project using Kotlin DSL.
130130

131131
**Core Modules** (`core/`):
132132
- `flamingock-core` - Core engine and orchestration logic
133-
- `flamingock-core-api` - Public API annotations (`@ChangeUnit`, `@Execution`)
133+
- `flamingock-core-api` - Public API annotations (`@Change`, `@Execution`)
134134
- `flamingock-core-commons` - Shared internal utilities
135135
- `flamingock-processor` - Annotation processor for pipeline generation
136136
- `flamingock-graalvm` - GraalVM native image support
@@ -155,7 +155,7 @@ This is a multi-module Gradle project using Kotlin DSL.
155155

156156
### Key Patterns
157157

158-
**Change Units**: Atomic migration operations annotated with `@ChangeUnit`:
158+
**Changes**: Atomic migration operations annotated with `@Change`:
159159
- `id` - Unique identifier for tracking
160160
- `order` - Execution sequence (can be auto-generated)
161161
- `author` - Change author

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ No more fragile scripts or untracked console changes. With CaC:
8282
- **Change-as-Code (CaC)**: Treat changes to databases, queues, APIs, or configs as code — versioned, executable, and auditable.
8383
- **Unified system evolution**: Orchestrate changes across your full stack: event schemas, feature flags, databases, S3, SaaS APIs, and more.
8484
- **Programmatic or declarative**: Write changes in Java/Kotlin or define them in YAML using official or custom templates.
85-
- **Startup-Time synchronization**: Apply versioned ChangeUnits when your app starts — keeping deployments consistent and safe.
86-
- **Audit logging & rollback**: Every change is recorded externally; rollback logic is built into each ChangeUnit.
85+
- **Startup-Time synchronization**: Apply versioned Changes when your app starts — keeping deployments consistent and safe.
86+
- **Audit logging & rollback**: Every change is recorded externally; rollback logic is built into each Change.
8787
- **Multi-stage workflows**: Organize and execute your changes in coordinated, stage-based flows across instances.
8888
- **Native GraalVM support**: Compatible with native image builds for fast startup and low memory usage.
8989
- **Cloud-ready, OSS-Core**: Use locally, self-host, or plug into our managed Cloud — all powered by the same open source core.

RECOVERY_EXAMPLE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Recovery Feature Usage Examples
22

3-
## Code-Based ChangeUnit with Recovery
3+
## Code-Based Change with Recovery
44

55
```java
6-
@ChangeUnit(id = "example-change-with-retry", order = "001", author = "developer")
6+
@Change(id = "example-change-with-retry", order = "001", author = "developer")
77
@Recovery(strategy = RecoveryStrategy.ALWAYS_RETRY)
88
public class ExampleChangeWithRetry {
99

@@ -21,7 +21,7 @@ public class ExampleChangeWithRetry {
2121
```
2222

2323
```java
24-
@ChangeUnit(id = "example-change-manual", order = "002", author = "developer")
24+
@Change(id = "example-change-manual", order = "002", author = "developer")
2525
@Recovery(strategy = RecoveryStrategy.MANUAL_INTERVENTION) // This is the default
2626
public class ExampleChangeWithManualIntervention {
2727

@@ -34,7 +34,7 @@ public class ExampleChangeWithManualIntervention {
3434
```
3535

3636
```java
37-
@ChangeUnit(id = "example-change-default", order = "003", author = "developer")
37+
@Change(id = "example-change-default", order = "003", author = "developer")
3838
// No @Recovery annotation = defaults to MANUAL_INTERVENTION
3939
public class ExampleChangeWithDefaultRecovery {
4040

@@ -46,14 +46,14 @@ public class ExampleChangeWithDefaultRecovery {
4646
}
4747
```
4848

49-
## Template-Based ChangeUnit with Recovery
49+
## Template-Based Change with Recovery
5050

5151
Create a YAML file `src/test/resources/flamingock/pipeline.yaml`:
5252

5353
```yaml
5454
stages:
5555
- name: "example-stage"
56-
changeUnits:
56+
changes:
5757
- id: "template-change-retry"
5858
order: "001"
5959
template: "io.flamingock.template.mongodb.MongoChangeTemplate"

cli/flamingock-cli/CLI-README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ A lightweight command-line interface for Flamingock audit operations in communit
2424
# List conflicted audit entries
2525
./flamingock-cli-dist/flamingock audit list
2626

27-
# Mark change unit as applied
27+
# Mark change as applied
2828
./flamingock-cli-dist/flamingock audit mark --change-id ch1 --state APPLIED
2929

30-
# Mark change unit as rolled back
30+
# Mark change as rolled back
3131
./flamingock-cli-dist/flamingock audit mark --change-id ch2 --state ROLLED_BACK
3232

3333
# Use custom configuration file
@@ -156,16 +156,16 @@ client.markAsRolledBack(changeId);
156156

157157
### `flamingock audit list`
158158
Lists all conflicted audit entries showing:
159-
- Change unit ID, execution ID, stage ID
159+
- Change ID, execution ID, stage ID
160160
- Author, state, type, class, method
161161
- Execution time, hostname, timestamps
162162
- Error traces (if any)
163163

164164
### `flamingock audit mark`
165-
Marks a change unit with a specific state:
165+
Marks a change with a specific state:
166166
- **`--state APPLIED`** - Marks as successfully applied
167167
- **`--state ROLLED_BACK`** - Marks as rolled back
168-
- **`--change-id <id>`** - Required change unit identifier
168+
- **`--change-id <id>`** - Required change identifier
169169

170170
## Error Handling
171171
- **Configuration errors**: Missing files, invalid YAML, multiple databases

cli/flamingock-cli/CLI_SPECIFICATION.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ flamingock [command] [operation] [options]
1414
- The CLI only parses input, calls `OpsClient`, and formats output.
1515

1616
- Default behavior:
17-
- `flamingock audit list` (with no flags) → shows the **current snapshot** (latest state per changeUnit).
17+
- `flamingock audit list` (with no flags) → shows the **current snapshot** (latest state per change).
1818
- Flags modify or filter the behavior.
1919

2020
---
@@ -50,15 +50,15 @@ flamingock audit list --limit 50 --page 2
5050

5151
### 2. `audit mark`
5252

53-
Forcefully mark a given **changeUnit** with a new state.
53+
Forcefully mark a given **change** with a new state.
5454

5555
**Base command:**
5656
```
5757
flamingock audit mark --change-unit <id> --state <state>
5858
```
5959

6060
**Options:**
61-
- `--change-unit <id>` / `-c <id>` → the changeUnitId (required)
61+
- `--change-unit <id>` / `-c <id>` → the changeId (required)
6262
- `--state <state>` / `-s <state>` → the state to mark (`APPLIED` or `ROLLED_BACK`) (required)
6363

6464
**Examples:**
@@ -82,14 +82,14 @@ flamingock audit mark -c CU123 -s ROLLED_BACK
8282
- Command structure: `flamingock [command] [operation] [options]`
8383
- For now, only the `audit` command is implemented with:
8484
- `list` (default snapshot, optional filters `--issues`, `--history`, `--since`, pagination)
85-
- `mark` (force a state for a changeUnit)
85+
- `mark` (force a state for a change)
8686
- The CLI is a thin layer: config → build OpsClient → call → format result.
8787

8888
---
8989

9090
## Implementation Notes
9191

92-
- **Default behavior change**: The `audit list` command now shows a **snapshot view** (latest state per changeUnit) by default, not just conflicted entries.
92+
- **Default behavior change**: The `audit list` command now shows a **snapshot view** (latest state per change) by default, not just conflicted entries.
9393
- **History flag**: Use `--history` to get the full chronological audit history.
9494
- **Issues flag**: Use `--issues` to filter for only entries with problems.
9595
- **Since flag**: Use `--since` with ISO-8601 format to filter by date.

cli/flamingock-cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ flamingock audit fix -c <change-id>
143143
# View all audit entries
144144
flamingock audit list
145145

146-
# Check specific change unit
146+
# Check specific change
147147
flamingock audit get -c user-migration-v2
148148

149149
# Export as JSON for processing

cli/flamingock-cli/src/main/java/io/flamingock/cli/command/audit/FixCommand.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
@Command(
3030
name = "fix",
31-
description = "Fix audit state for a change unit with inconsistent audit"
31+
description = "Fix audit state for a change with inconsistent audit"
3232
)
3333
public class FixCommand implements Runnable {
3434

@@ -37,7 +37,7 @@ public class FixCommand implements Runnable {
3737
@ParentCommand
3838
private AuditCommand parent;
3939

40-
@Option(names = {"-c", "--change-id"}, required = true, description = "ChangeUnit ID to fix")
40+
@Option(names = {"-c", "--change-id"}, required = true, description = "Change ID to fix")
4141
private String changeId;
4242

4343
@Option(names = {"-r", "--resolution"}, required = true, description = "Resolution state: APPLIED or ROLLED_BACK")
@@ -62,7 +62,7 @@ public void run() {
6262
// Handle different results with appropriate messaging
6363
switch (result) {
6464
case APPLIED:
65-
System.out.println("✅ Successfully fixed audit state for change unit '" + changeId + "'");
65+
System.out.println("✅ Successfully fixed audit state for change '" + changeId + "'");
6666
System.out.println(" Resolution applied: " + resolution);
6767

6868
if (resolution == Resolution.ROLLED_BACK) {
@@ -71,9 +71,9 @@ public void run() {
7171
break;
7272

7373
case NO_ISSUE_FOUND:
74-
System.out.println("⚠️ Fix not applied for change unit '" + changeId + "'");
74+
System.out.println("⚠️ Fix not applied for change '" + changeId + "'");
7575
System.out.println(" Reason: The audit state is already consistent and healthy.");
76-
System.out.println(" No action required - change unit has no issues to fix.");
76+
System.out.println(" No action required - change has no issues to fix.");
7777
break;
7878

7979
default:

cli/flamingock-cli/src/main/java/io/flamingock/cli/command/audit/ListCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public void run() {
9292
entries = auditService.listAuditEntriesSince(sinceDate);
9393
listType = "Audit Entries since " + since;
9494
} else {
95-
// Default: snapshot view (latest per changeUnit)
95+
// Default: snapshot view (latest per change)
9696
entries = auditService.listAuditEntriesSnapshot();
97-
listType = "Audit Entries Snapshot (Latest per Change Unit)";
97+
listType = "Audit Entries Snapshot (Latest per Change)";
9898
}
9999

100100

cli/flamingock-cli/src/main/java/io/flamingock/cli/command/issue/GetIssueCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class GetIssueCommand implements Runnable {
4444
@ParentCommand
4545
private IssueCommand parent;
4646

47-
@Option(names = {"-c", "--change-id"}, required = false, description = "ChangeUnit ID to inspect (optional - shows next issue if not specified)")
47+
@Option(names = {"-c", "--change-id"}, required = false, description = "Change ID to inspect (optional - shows next issue if not specified)")
4848
private String changeId;
4949

5050
@Option(names = {"-j", "--json"}, description = "Output results in JSON format")
@@ -76,7 +76,7 @@ public void run() {
7676
if (auditEntryIssueOpt.isPresent()) {
7777
issueToShow = auditEntryIssueOpt.get();
7878
} else {
79-
System.err.println("Error: There is no issue with changeUnit: " + changeId);
79+
System.err.println("Error: There is no issue with change: " + changeId);
8080
return;
8181
}
8282
} else {
@@ -85,7 +85,7 @@ public void run() {
8585
List<AuditEntryIssue> issues = auditService.listAuditEntriesWithIssues();
8686

8787
if (issues.isEmpty()) {
88-
System.out.println("\n✅ No issues found! All change units are in consistent state.\n");
88+
System.out.println("\n✅ No issues found! All changes are in consistent state.\n");
8989
return;
9090
} else {
9191
issueToShow = issues.get(0); // Get the first issue

cli/flamingock-cli/src/main/java/io/flamingock/cli/command/issue/IssueCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
@Command(
2323
name = "issue",
24-
description = "Issue operations for problematic change units",
24+
description = "Issue operations for problematic changes",
2525
subcommands = {
2626
ListIssueCommand.class,
2727
GetIssueCommand.class

0 commit comments

Comments
 (0)