Repository navigation
feat(core): add stage-level runAlways support - #978
Open
osantana85 wants to merge 2 commits into
Open
osantana85 wants to merge 2 commits into
osantana85 wants to merge 2 commits into
Conversation
- Add StageMode.STANDARD and StageMode.RUN_ALWAYS to native stages and YAML pipelines. - Derive runAlways for native code and template changes from the stage mode. - Preserve Mongock ChangeUnit and ChangeSet runAlways metadata in the LEGACY stage. - Reapply the stage policy after metadata merge and support changes from nested packages. - Update Community and Cloud planning so runAlways changes are executed again after prior application. - Reject user-defined StageType values in YAML and keep SYSTEM and LEGACY stages internal. - Add planner, processor, metadata, Cloud, and legacy compatibility tests.
There was a problem hiding this comment.
🟡 Changes recommended
Stage replanning, stale metadata flags, and snapshot dependency resolution remain blockers; a clean build was not run.
2 open issues
What changed in this PR
Adds stage-level repeatability to Flamingock’s change execution pipeline across Community and Cloud, while preserving legacy Mongock behavior.
Changes:
- Propagates stage modes through configuration, metadata, validation, and planning.
- Preserves legacy repeatability flags and reserves stage types for internal use.
- Adds regression coverage, updates fixtures, and adjusts SQL test setup.
| File | Description |
|---|---|
| utils/test-util/src/main/java/io/flamingock/common/test/pipeline/PipelineTestHelper.java | Sets standard stage mode. |
| utils/test-util/src/main/java/io/flamingock/common/test/cloud/prototype/PrototypeChange.java | Updates request construction. |
| utils/test-util/src/main/java/io/flamingock/common/test/cloud/deprecated/MockRunnerServerOld.java | Updates mock requests. |
| legacy/mongock-support/src/test/java/io/flamingock/support/mongock/internal/preview/builder/MongockCodePreviewChangeHelperTest.java | Tests legacy repeatability metadata. |
| legacy/mongock-support/src/main/java/io/flamingock/support/mongock/internal/preview/builder/MongockCodePreviewChangeHelper.java | Accepts legacy runAlways flags. |
| core/target-systems/flamingock-sql-targetsystem/src/test/java/io/flamingock/targetsystem/sql/PipelineTestHelper.java | Updates stage fixtures. |
| core/target-systems/flamingock-mongodb-sync-targetsystem/src/test/java/io/flamingock/targetsystem/mongodb/sync/PipelineTestHelper.java | Updates stage fixtures. |
| core/target-systems/flamingock-mongodb-springdata-targetsystem/src/test/java/io/flamingock/targetsystem/mongodb/springdata/PipelineTestHelper.java | Updates stage fixtures. |
| core/target-systems/flamingock-mongodb-springdata-reactive-targetsystem/src/test/java/io/flamingock/targetsystem/mongodb/springdata/reactive/PipelineTestHelper.java | Updates stage fixtures. |
| core/target-systems/flamingock-mongodb-reactive-targetsystem/src/test/java/io/flamingock/targetsystem/mongodb/reactive/PipelineTestHelper.java | Updates stage fixtures. |
| core/target-systems/flamingock-dynamodb-targetsystem/src/test/java/io/flamingock/targetsystem/dynamodb/PipelineTestHelper.java | Updates stage fixtures. |
| core/target-systems/flamingock-couchbase-targetsystem/src/test/java/io/flamingock/targetsystem/couchbase/PipelineTestHelper.java | Updates stage fixtures. |
| core/flamingock-processor/src/test/java/io/flamingock/core/processor/util/FlamingockMetadataStoreTest.java | Tests repeatability persistence. |
| core/flamingock-processor/src/test/java/io/flamingock/core/processor/util/FlamingockMetadataMergerTest.java | Tests repeatability after routing and merging. |
| core/flamingock-processor/src/test/java/io/flamingock/core/processor/PipelinePreProcessorTest.java | Tests stage modes and YAML restrictions. |
| core/flamingock-processor/src/test/java/io/flamingock/core/processor/MultiModuleProcessingIT.java | Updates legacy stage fixtures. |
| core/flamingock-processor/src/main/java/io/flamingock/core/processor/util/PipelineStructureBuilder.java | Parses modes and restricts YAML types. |
| core/flamingock-processor/src/main/java/io/flamingock/core/processor/util/FlamingockMetadataMerger.java | Applies repeatability after routing. |
| core/flamingock-processor/src/main/java/io/flamingock/core/processor/FlamingockAnnotationProcessor.java | Clarifies stage documentation. |
| core/flamingock-core/src/test/java/io/flamingock/internal/core/plan/community/CommunityExecutionPlannerTest.java | Tests planning previously applied repeatable changes. |
| core/flamingock-core/src/test/java/io/flamingock/internal/core/plan/community/CommunityChangeActionBuilderTest.java | Tests repeatable action selection. |
| core/flamingock-core/src/test/java/io/flamingock/internal/core/pipeline/run/PipelineRunOfLoadedPipelineTest.java | Updates loaded-stage fixtures. |
| core/flamingock-core/src/test/java/io/flamingock/internal/core/pipeline/loaded/stage/DefaultLoadedStageTest.java | Tests stage repeatability validation. |
| core/flamingock-core/src/main/java/io/flamingock/internal/core/plan/community/CommunityExecutionPlanner.java | Avoids stamping repeatable changes as already applied. |
| core/flamingock-core/src/main/java/io/flamingock/internal/core/plan/community/CommunityChangeActionBuilder.java | Reapplies successful repeatable changes. |
| core/flamingock-core/src/main/java/io/flamingock/internal/core/pipeline/loaded/stage/SystemLoadedStage.java | Sets mode and implements stage copying. |
| core/flamingock-core/src/main/java/io/flamingock/internal/core/pipeline/loaded/stage/LegacyLoadedStage.java | Sets mode and implements stage copying. |
| core/flamingock-core/src/main/java/io/flamingock/internal/core/pipeline/loaded/stage/DefaultLoadedStage.java | Preserves and validates stage mode. |
| core/flamingock-core/src/main/java/io/flamingock/internal/core/pipeline/loaded/stage/AbstractLoadedStage.java | Carries mode through loading and copying. |
| core/flamingock-core/src/main/java/io/flamingock/internal/core/change/loaded/CodeLoadedChangeBuilder.java | Defaults native runAlways to false. |
| core/flamingock-core-commons/src/test/java/io/flamingock/internal/common/core/preview/PreviewStageTest.java | Tests preview stage policies. |
| core/flamingock-core-commons/src/test/java/io/flamingock/internal/common/core/preview/builder/TemplatePreviewChangeBuilderTest.java | Tests template repeatability defaults. |
| core/flamingock-core-commons/src/main/java/io/flamingock/internal/common/core/preview/SystemPreviewStage.java | Sets standard system-stage mode. |
| core/flamingock-core-commons/src/main/java/io/flamingock/internal/common/core/preview/PreviewStage.java | Stores mode and marks repeatable changes. |
| core/flamingock-core-commons/src/main/java/io/flamingock/internal/common/core/preview/builder/CodePreviewChangeBuilder.java | Removes an obsolete TODO comment. |
| core/flamingock-core-commons/src/main/java/io/flamingock/internal/common/core/metadata/MetadataLoader.java | Preserves mode when merging legacy stages. |
| community/flamingock-sql-auditstore/src/test/java/io/flamingock/store/sql/SqlAuditCompactionConformanceTest.java | Creates tables during test setup. |
| community/flamingock-sql-auditstore/build.gradle.kts | Serializes SQL test forks. |
| community/flamingock-dynamodb-auditstore/src/test/java/io/flamingock/store/dynamodb/PipelineTestHelper.java | Updates stage fixtures. |
| community/flamingock-couchbase-auditstore/src/test/java/io/flamingock/store/couchbase/PipelineTestHelper.java | Updates stage fixtures. |
| cloud/flamingock-cloud/src/test/java/io/flamingock/cloud/planner/CloudExecutionPlannerTest.java | Updates typed stage fixtures. |
| cloud/flamingock-cloud/src/test/java/io/flamingock/cloud/planner/CloudExecutionPlanMapperTest.java | Tests repeatable Cloud requests and actions. |
| cloud/flamingock-cloud/src/main/java/io/flamingock/cloud/planner/CloudExecutionPlanMapper.java | Transmits repeatability and adjusts actions. |
| cloud/flamingock-cloud-api/src/test/java/io/flamingock/cloud/api/request/ClientSubmissionRequestSerializationTest.java | Tests runAlways serialization. |
| cloud/flamingock-cloud-api/src/main/java/io/flamingock/cloud/api/request/ChangeRequest.java | Adds runAlways to requests. |
| cloud/flamingock-cloud-api/build.gradle.kts | Adds Jackson annotations dependency. |
| build.gradle.kts | Updates the core API dependency. |
Review effort: Balanced
Comment on lines
+62
to
+65
| } else if (change.isRunAlways() && isSuccessfullyApplied(auditEntry)) { | ||
| log.debug("Change[{}] action={} | Reason: runAlways change with previous successful audit entry", | ||
| change.getId(), ChangeAction.APPLY); | ||
| actionMap.put(change.getId(), ChangeAction.APPLY); |
Comment on lines
+399
to
+403
| if (stage.getType() == StageType.DEFAULT | ||
| && stage.getMode() == StageMode.RUN_ALWAYS | ||
| && stage.getChanges() != null) { | ||
| for (AbstractPreviewChange change : stage.getChanges()) { | ||
| change.setRunAlways(true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

and YAML pipelines.
stage mode.
the LEGACY stage.
from nested packages.
executed again after prior application.
LEGACY stages internal.
tests.