This repository has been archived by the owner on Sep 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
fix: hide IntegrationPackage.ID from JSON #1211
Merged
Merged
Conversation
This file contains 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
This way, the requests to Kibana won't contain that field, honouring Kibana's contract about fleet schema
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
mergify bot
pushed a commit
that referenced
this pull request
Jun 1, 2021
* fix: hide IntegrationPackage.ID from JSON This way, the requests to Kibana won't contain that field, honouring Kibana's contract about fleet schema * fix: run tests when changing internal (cherry picked from commit 9430a9a)
mergify bot
pushed a commit
that referenced
this pull request
Jun 1, 2021
* fix: hide IntegrationPackage.ID from JSON This way, the requests to Kibana won't contain that field, honouring Kibana's contract about fleet schema * fix: run tests when changing internal (cherry picked from commit 9430a9a)
mdelapenya
added a commit
that referenced
this pull request
Jun 1, 2021
* fix: hide IntegrationPackage.ID from JSON This way, the requests to Kibana won't contain that field, honouring Kibana's contract about fleet schema * fix: run tests when changing internal (cherry picked from commit 9430a9a) Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya
added a commit
that referenced
this pull request
Jun 1, 2021
* fix: hide IntegrationPackage.ID from JSON This way, the requests to Kibana won't contain that field, honouring Kibana's contract about fleet schema * fix: run tests when changing internal (cherry picked from commit 9430a9a) Co-authored-by: Manuel de la Peña <[email protected]>
8 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What does this PR do?
It uses JSON tags to hide the field from JSON marshall/unmarshall operations.
Why is it important?
This way, the requests to Kibana won't contain that field, honouring Kibana's contract about fleet schema.
We are receiving a payload when getting integrations from Kibana, and that payload contains the ID, that's why we added the field to the struct. When sending POST requests to kibana to add an integration package to a policy, this struct is converted to JSON and sent as payload. But Kibana spec does not allow the ID field in its schema, and after elastic/kibana#99886 Kibana is stricter than before, as it fails with a HTTP 400 error code:
In the past, before that Kibana PR, it simply ignored the field, which makes me think about a third party dependency in Kibana adding the new strictness.
Checklist
make unit-test
), and they are passing locallymake notice
in the proper directory)Author's Checklist
How to test this PR locally
$ TAGS="linux_integration" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOT=false DEVELOPER_MODE=true make -C e2e/_suites/fleet functional-test
Related issues