New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes PhaseAfterStep to take the name of the previous phase #30756
Changes PhaseAfterStep to take the name of the previous phase #30756
Conversation
Pinging @elastic/es-core-infra |
@@ -203,7 +207,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws | |||
} | |||
|
|||
if (phase != null) { | |||
Step.StepKey afterStepKey = new Step.StepKey(phase.getName(), "pre-" + lastStepKey.getAction(), "after"); | |||
// The very first after step is in a phase before the hot phase so call this "new" | |||
Step.StepKey afterStepKey = new Step.StepKey("new", PhaseAfterStep.NAME, PhaseAfterStep.NAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, for documentation purposes, our phases are now
- new
- hot (optional)
- warm (optional)
- cold (optional)
- delete (optional)
- completed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, although we should be clear in the docs that new
and completed
are not real phases in the fact that you cannot add actions to them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are some assertions made in rest tests expecting the pre-pre-readonly step
this needs to be updated for tests to pass
@talevy thanks for pointing that out. I've pushed a fix so hopefully the CI build will pass now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging latest index-lifecycle should fix CI on this PR
This changes the way the phase after step is built so its key has the phase name of the phase that preceeds it rather than the phase that follows it. This is more intuitive to the user since the index is in the warm phase until the after condition for the cold phase is met.
x-pack/plugin/src/test/resources/rest-api-spec/test/index_lifecycle/20_m ove_to_step.yml x-pack/plugin/src/test/resources/rest-api-spec/test/index_lifecycle/20_m ove_to_step.yml
* Changes PhaseAfterStep to take the name of the previous phase This changes the way the phase after step is built so its key has the phase name of the phase that preceeds it rather than the phase that follows it. This is more intuitive to the user since the index is in the warm phase until the after condition for the cold phase is met. * Fixes REST tests x-pack/plugin/src/test/resources/rest-api-spec/test/index_lifecycle/20_m ove_to_step.yml x-pack/plugin/src/test/resources/rest-api-spec/test/index_lifecycle/20_m ove_to_step.yml
This changes the way the phase after step is built so its key has the
phase name of the phase that preceeds it rather than the phase that
follows it. This is more intuitive to the user since the index is in
the warm phase until the after condition for the cold phase is met.