Host and operating system assets can be exported again.#5111
Host and operating system assets can be exported again.#5111
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5111 +/- ##
=======================================
Coverage 77.05% 77.06%
=======================================
Files 1170 1170
Lines 30514 30519 +5
Branches 9124 9089 -35
=======================================
+ Hits 23514 23519 +5
Misses 6260 6260
Partials 740 740 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Could you please split the tests for the HostCommand and the HostsCommand into two distinct test.ts files?
There was a problem hiding this comment.
Same for os. Would be best to have two distinct test files operatingsystem.test.ts and operatingsystems.test.ts.
| data: { | ||
| cmd: 'bulk_export', | ||
| resource_type: this.name, | ||
| asset_type: this.getParams().asset_type, |
There was a problem hiding this comment.
This is not correct. The getParams method is for getting the params of a GET request and this is a POST request. I am not completely sure how to fix this issue best. Either the export needs to call httpPostWithTransform or you need to allow to pass additional parameters to the export method and override it for operating and host commands. I am not sure why httpRequestWithRejectionTransform is called here instead of httpPostWithTransform. Maye httpPostWithTransform has some unwanted side effects for the export method and adds some unwanted extra parameters. Having the tests now should allow for getting this right now.
What
Fixed the problem with the export of hosts and operating systems and added some Tests.
Why
This was a bug.
References
GEA-1564
Checklist
Tested manually on my local development system.