Use new format in calls to policy API#3307
Conversation
|
test integrations |
|
test integrations |
|
Created or updated PR in integrations repository to test this version. Check elastic/integrations#17571 |
|
test integrations |
|
Created or updated PR in integrations repository to test this version. Check elastic/integrations#17571 |
|
test integrations |
|
Created or updated PR in integrations repository to test this version. Check elastic/integrations#17571 |
|
test integrations |
|
Created or updated PR in integrations repository to test this version. Check elastic/integrations#17571 |
a528d7e to
9082f51
Compare
|
test integrations |
|
Triggered serverless pipeline: https://buildkite.com/elastic/elastic-package-test-serverless/builds/750 |
mrodm
left a comment
There was a problem hiding this comment.
Thanks for adding those tests! This will help for sure to ensure that everything works as expected
Just added a few questions
| common.MapStr(packagePolicy.Vars), | ||
| !packagePolicy.Disabled, | ||
| ) | ||
| pp.OutputID = policy.DataOutputID |
There was a problem hiding this comment.
I was wondering if it would be helpful to add this assignment into the BuildInputPackagePolicy and BuildIntegrationPackagePolicy methods.
In system tests, this variable is filled for the policy:
https://github.com/elastic/elastic-package/pull/3307/changes#diff-0bdd696fb9abd5e4aa12a3bab634cbac31ec1a1349b3a61e8a784a6bdeb6e7d8R1375-R1380
But it was not set in the package policies , so would this addition be missing too there? If it was required, it was not done in the current logic in main.
There was a problem hiding this comment.
I think I would prefer to keep this separated, and let the callers of BuildInputPackagePolicy and BuildIntegrationPackagePolicy methods decide the output to use.
|
test integrations |
|
Created or updated PR in integrations repository to test this version. Check elastic/integrations#17571 |
d68cd7c to
2f6bc37
Compare
There was a problem hiding this comment.
I am going to remove the policy tests from this PR, as they are stricter than system tests and I cannot use policy_api_format till elastic/package-spec#1103 is released.
There was a problem hiding this comment.
Removed in fdf61a9
I will set a reminder to myself to add them back when package-spec is released :)
|
test integrations |
|
Created or updated PR in integrations repository to test this version. Check elastic/integrations#17571 |
test/packages/parallel/zipkin_input_otel/_dev/test/policy/test-default-use-apm.yml
Show resolved
Hide resolved
💛 Build succeeded, but was flaky
Failed CI StepsHistory
cc @jsoriano |
mrodm
left a comment
There was a problem hiding this comment.
Tested locally these changes and they worked successfully in different packages. Great coverage added to ensure correctness too!
Thanks!
Fixes #3038.
Use the recommended "simplified" format of the Fleet API to create policies. This format is based on objects instead of lists for variables, and automatically manages defaults.
To keep supporting old versions of the stack that don't support this API, a conversion layer is added. This conversion layer will need to be maintained while we support 8.5.0.
A new setting is added to system tests to allow forcing the use of an specific format,
policy_api_format. This is added as a escape hatch for cases that cannot be solved with the simplified API, as seen for example in elastic/kibana#255976. Definition to package spec to be added in elastic/package-spec#1103.The new "simplified" API enables all data streams for the configured inputs by default, so some new code is needed to disable the data streams that are not relevant for each test case.
Refactor the code related to policy creation so it is reused in the different places where the functionality is needed. Two main methods are created for that,
BuildIntegrationPackagePolicyfor integration packages, andBuildInputPackagePolicyfor input packages.A couple of additional enhancements:
use_apm, co-authored by @mrodm, mostly copied from Add support to inject use_apm variable in input packages #3312.New tests are added for the methods used to create package policies.
Change assisted by Copilot/Claude