Skip to content
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

Fix xpack.usage ILM actions #3265

Merged
merged 2 commits into from
Jan 23, 2025
Merged

Fix xpack.usage ILM actions #3265

merged 2 commits into from
Jan 23, 2025

Conversation

pquentin
Copy link
Member

@pquentin pquentin commented Dec 9, 2024

I've been trying to understand today why sometimes 2 responses for xpack.usage validate, and sometimes only one. I don't understand it yet, but I have fixed the Type 'string[]' has no properties in common with type 'IlmActions'. issue. Before/after:

$ make validate api=xpack.usage branch=main | rg --fixed-strings "Type 'string[]' has no properties in common with type 'IlmActions'." | wc -l
    3468
$ git checkout xpack-usage-ilm-action
Switched to branch 'xpack-usage-ilm-action'
$ make validate api=xpack.usage branch=main | rg --fixed-strings "Type 'string[]' has no properties in common with type 'IlmActions'." | wc -l
       0

(Plenty of other issues remain, like configurations is totally missing even though it encodes a lot of information since Elasticsearch 7.15.

They're list of strings, not full actions.
Copy link
Contributor

github-actions bot commented Dec 9, 2024

Following you can find the validation results for the APIs you have changed.

API Status Request Response
ilm.delete_lifecycle 🟢 2/2 2/2
ilm.explain_lifecycle 🟢 5/5 5/5
ilm.get_lifecycle 🟢 8/8 8/8
ilm.get_status 🟢 4/4 4/4
ilm.migrate_to_data_tiers Missing test Missing test
ilm.move_to_step Missing test Missing test
ilm.put_lifecycle 🟢 6/6 6/6
ilm.remove_policy 🟢 5/5 5/5
ilm.retry Missing test Missing test
ilm.start Missing test Missing test
ilm.stop 🟢 4/4 4/4
xpack.usage 🔴 40/40 2/36

You can validate these APIs yourself by using the make validate target.

/**
* @es_quirk output as a millis number in XPack usage stats, which cannot roundtrip with a Duration as it requires a unit.
*/
min_age?: Duration | long
min_age?: Duration
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out ILM and Xpack usage output different representations for min_age. It's always a TimeValue, but:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forgot to actually add the DurationValue part to the type union or is the diff bugged? I only see a removal of the long variant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DurationValue is in here: https://github.com/elastic/elasticsearch-specification/pull/3265/files#diff-3e3867651e09e047ca056bb1dbcc10583b2128b45b03cd87233d6dda1a2e6e3fR156. I duplicated the Phase class in the XPack spec since they're actually different.

@@ -152,6 +151,19 @@ export class HealthStatistics extends Base {
invocations: Invocations
}

export class Phase {
actions: string[]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about the configuration field just below?

Copy link
Member Author

@pquentin pquentin Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Following you can find the validation results for the APIs you have changed.

API Status Request Response
ilm.delete_lifecycle 🟢 2/2 2/2
ilm.explain_lifecycle 🟢 5/5 5/5
ilm.get_lifecycle 🟢 8/8 8/8
ilm.get_status 🟢 4/4 4/4
ilm.migrate_to_data_tiers Missing test Missing test
ilm.move_to_step Missing test Missing test
ilm.put_lifecycle 🟢 6/6 6/6
ilm.remove_policy 🟢 5/5 5/5
ilm.retry Missing test Missing test
ilm.start Missing test Missing test
ilm.stop 🟢 4/4 4/4
xpack.usage 🔴 40/40 2/36

You can validate these APIs yourself by using the make validate target.

@pquentin pquentin merged commit cf8e0b8 into main Jan 23, 2025
8 checks passed
@pquentin pquentin deleted the xpack-usage-ilm-action branch January 23, 2025 08:11
github-actions bot pushed a commit that referenced this pull request Jan 23, 2025
(cherry picked from commit cf8e0b8)
github-actions bot pushed a commit that referenced this pull request Jan 23, 2025
(cherry picked from commit cf8e0b8)
pquentin added a commit that referenced this pull request Jan 23, 2025
(cherry picked from commit cf8e0b8)

Co-authored-by: Quentin Pradet <[email protected]>
pquentin added a commit that referenced this pull request Jan 23, 2025
(cherry picked from commit cf8e0b8)

Co-authored-by: Quentin Pradet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants