Skip to content

Conversation

@jgowdyelastic
Copy link
Member

@jgowdyelastic jgowdyelastic commented May 23, 2023

Adds versioning to all of the file upload APIs.
Versions are added to the server side routes and to the client side functions which call the routes.
Updates API tests to add the API version to the request headers.

All of the APIs are internal and have been given the version '1'.

Also renames /internal/file_data_visualizer/analyze_file to /internal/file_upload/analyze_file
It appears this was a mistake from when the route was moved from the data visualiser plugin midway through development on this PR.

Internal APIs

/internal/file_upload/analyze_file
/internal/file_upload/has_import_permission
/internal/file_upload/index_exists
/internal/file_upload/time_field_range

@jgowdyelastic jgowdyelastic added release_note:enhancement non-issue Indicates to automation that a pull request should not appear in the release notes :ml Feature:File and Index Data Viz ML file and index data visualizer Feature:File Upload v8.9.0 labels May 23, 2023
@jgowdyelastic jgowdyelastic self-assigned this May 23, 2023
@jgowdyelastic jgowdyelastic requested a review from a team as a code owner May 23, 2023 13:03
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM
code review only

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM
code review only

)
.auth(IMPORTER_USER_NAME, IMPORT_USER_PASSWORD)
.set('kbn-xsrf', 'kibana')
.set('version', '1')
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ELASTIC_HTTP_VERSION_HEADER from import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; instead of version.

http.fetch converts version to ELASTIC_HTTP_VERSION_HEADER but this does not occur in integration tests.

Copy link
Member Author

@jgowdyelastic jgowdyelastic May 24, 2023

Choose a reason for hiding this comment

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

Good spot, thanks. This is correct in our previous versioning PRs, but I missed it here.
Updated in 957bbca

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

Use ELASTIC_HTTP_VERSION_HEADER from import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; instead of version in integration tests

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Tested and LGTM.

@kibana-ci
Copy link

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fileUpload 852.8KB 852.8KB +12.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fileUpload 7.2KB 7.3KB +39.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 399 403 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 479 483 +4
total +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @jgowdyelastic

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

LGTM ⚡

@jgowdyelastic jgowdyelastic merged commit e77b45f into elastic:main May 24, 2023
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label May 24, 2023
@peteharverson peteharverson added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:enhancement labels Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:File and Index Data Viz ML file and index data visualizer Feature:File Upload :ml non-issue Indicates to automation that a pull request should not appear in the release notes release_note:skip Skip the PR/issue when compiling release notes v8.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants