[Fleet] Ensure top-level package vars are parsed when reading archive#147040
Merged
kpollich merged 1 commit intoelastic:mainfrom Dec 5, 2022
Merged
[Fleet] Ensure top-level package vars are parsed when reading archive#147040kpollich merged 1 commit intoelastic:mainfrom
kpollich merged 1 commit intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
jen-huang
approved these changes
Dec 5, 2022
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
To update your PR or re-run it, just comment with: cc @kpollich |
Member
Author
I didn't find one, so I created #147050 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Dec 5, 2022
…elastic#147040) ## Summary Closes elastic#147028 ## Testing instructions See steps to reproduce in linked issue. Verify AWS credential variables appear on this branch.  I took a pass at adding tests for our `parseAndVeryArchive` method but it's sort of a recursive chain of mocked `Buffer` -> `yaml.safeLoad` operations and got pretty involved to set up from scratch. The other option would be to add an FTR API test that catches this case, but we'd need a package with top-level variables loaded into the test registry, which we may not have readily available if elastic#146809 lands. I would love some alternative ideas on adding test coverage for this fix, but if it's going to involved I don't want to block this fix from landing in 8.6 on tests. (cherry picked from commit b6696ef)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Dec 5, 2022
…rchive (#147040) (#147051) # Backport This will backport the following commits from `main` to `8.6`: - [[Fleet] Ensure top-level package vars are parsed when reading archive (#147040)](#147040) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kyle Pollich","email":"kyle.pollich@elastic.co"},"sourceCommit":{"committedDate":"2022-12-05T20:13:19Z","message":"[Fleet] Ensure top-level package vars are parsed when reading archive (#147040)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/147028\r\n\r\n## Testing instructions\r\n\r\nSee steps to reproduce in linked issue. Verify AWS credential variables\r\nappear on this branch.\r\n\r\n\r\n\r\n\r\nI took a pass at adding tests for our `parseAndVeryArchive` method but\r\nit's sort of a recursive chain of mocked `Buffer` -> `yaml.safeLoad`\r\noperations and got pretty involved to set up from scratch. The other\r\noption would be to add an FTR API test that catches this case, but we'd\r\nneed a package with top-level variables loaded into the test registry,\r\nwhich we may not have readily available if\r\nhttps://github.com//pull/146809 lands.\r\n\r\nI would love some alternative ideas on adding test coverage for this\r\nfix, but if it's going to involved I don't want to block this fix from\r\nlanding in 8.6 on tests.","sha":"b6696ef6c7da83c0ef396d24f471cb6589e5413a","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","v8.7.0"],"number":147040,"url":"https://github.com/elastic/kibana/pull/147040","mergeCommit":{"message":"[Fleet] Ensure top-level package vars are parsed when reading archive (#147040)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/147028\r\n\r\n## Testing instructions\r\n\r\nSee steps to reproduce in linked issue. Verify AWS credential variables\r\nappear on this branch.\r\n\r\n\r\n\r\n\r\nI took a pass at adding tests for our `parseAndVeryArchive` method but\r\nit's sort of a recursive chain of mocked `Buffer` -> `yaml.safeLoad`\r\noperations and got pretty involved to set up from scratch. The other\r\noption would be to add an FTR API test that catches this case, but we'd\r\nneed a package with top-level variables loaded into the test registry,\r\nwhich we may not have readily available if\r\nhttps://github.com//pull/146809 lands.\r\n\r\nI would love some alternative ideas on adding test coverage for this\r\nfix, but if it's going to involved I don't want to block this fix from\r\nlanding in 8.6 on tests.","sha":"b6696ef6c7da83c0ef396d24f471cb6589e5413a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/147040","number":147040,"mergeCommit":{"message":"[Fleet] Ensure top-level package vars are parsed when reading archive (#147040)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/147028\r\n\r\n## Testing instructions\r\n\r\nSee steps to reproduce in linked issue. Verify AWS credential variables\r\nappear on this branch.\r\n\r\n\r\n\r\n\r\nI took a pass at adding tests for our `parseAndVeryArchive` method but\r\nit's sort of a recursive chain of mocked `Buffer` -> `yaml.safeLoad`\r\noperations and got pretty involved to set up from scratch. The other\r\noption would be to add an FTR API test that catches this case, but we'd\r\nneed a package with top-level variables loaded into the test registry,\r\nwhich we may not have readily available if\r\nhttps://github.com//pull/146809 lands.\r\n\r\nI would love some alternative ideas on adding test coverage for this\r\nfix, but if it's going to involved I don't want to block this fix from\r\nlanding in 8.6 on tests.","sha":"b6696ef6c7da83c0ef396d24f471cb6589e5413a"}}]}] BACKPORT--> Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
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.
Summary
Closes #147028
Testing instructions
See steps to reproduce in linked issue. Verify AWS credential variables appear on this branch.
I took a pass at adding tests for our
parseAndVeryArchivemethod but it's sort of a recursive chain of mockedBuffer->yaml.safeLoadoperations and got pretty involved to set up from scratch. The other option would be to add an FTR API test that catches this case, but we'd need a package with top-level variables loaded into the test registry, which we may not have readily available if #146809 lands.I would love some alternative ideas on adding test coverage for this fix, but if it's going to involved I don't want to block this fix from landing in 8.6 on tests.