Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ingest Manager] Allow prerelease in package version #74452

Merged
merged 6 commits into from
Aug 10, 2020

Conversation

jonathan-buttner
Copy link
Contributor

@jonathan-buttner jonathan-buttner commented Aug 5, 2020

This PR switches the parsing of package keys (e.g. endpoint-0.13.0) to not use split() but instead look for the first occurrence of the dash delimiter.

Working prerelease

image

Package key failures

image

image

@jonathan-buttner jonathan-buttner added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.10.0 Team:Fleet Team label for Observability Data Collection Fleet team labels Aug 5, 2020
const pkgName = pkgkey.substr(0, pkgkey.indexOf('-'));
// this will return the entire string if `indexOf` return -1
const pkgVersion = pkgkey.substr(pkgkey.indexOf('-') + 1);
return { pkgName, pkgVersion };
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it should accept an empty name or version.

I also think we should ensure the version is valid semver https://github.com/npm/node-semver#usage

Copy link
Contributor Author

@jonathan-buttner jonathan-buttner Aug 6, 2020

Choose a reason for hiding this comment

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

Thanks for the comment @jfsiii, how about if I check if the pkgName is an empty string and throw an error?

For the pkgVersion I can do the same thing, semver.valid(pkgVersion) and if not throw an error?

@jonathan-buttner jonathan-buttner marked this pull request as ready for review August 6, 2020 15:40
@jonathan-buttner jonathan-buttner requested a review from a team August 6, 2020 15:40
@jonathan-buttner jonathan-buttner requested a review from a team as a code owner August 6, 2020 15:40
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@@ -71,6 +71,8 @@ export const IGNORE_FILE_GLOBS = [
'x-pack/plugins/apm/e2e/**/*',

'x-pack/plugins/maps/server/fonts/**/*',
// packages for the ingest manager's api integration tests could be valid semver which has dashes
'x-pack/test/ingest_manager_api_integration/apis/fixtures/test_packages/**/*',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jfsiii @skh @neptunian @nchaulet this is so we can have a valid semver as the package directory name with a dash in it. Should this only cover the packages directory? Or would it be useful if it was higher up like:
'x-pack/test/ingest_manager_api_integration/apis/fixtures/**/* ?

Copy link
Contributor

Choose a reason for hiding this comment

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

let's start here and lift it up later if we need to

Copy link
Contributor

@tylersmalley tylersmalley left a comment

Choose a reason for hiding this comment

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

Pre-commit hook changes look good.

Copy link
Contributor

@jfsiii jfsiii left a comment

Choose a reason for hiding this comment

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

Thanks for adding the function & tests

@@ -71,6 +71,8 @@ export const IGNORE_FILE_GLOBS = [
'x-pack/plugins/apm/e2e/**/*',

'x-pack/plugins/maps/server/fonts/**/*',
// packages for the ingest manager's api integration tests could be valid semver which has dashes
'x-pack/test/ingest_manager_api_integration/apis/fixtures/test_packages/**/*',
Copy link
Contributor

Choose a reason for hiding this comment

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

let's start here and lift it up later if we need to

after(async () => {
if (server.enabled) {
// remove the package just in case it being installed will affect other tests
await deletePackage(supertest, pkgkey);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to call the delete API here rather than coupling the tests to one another, but it's not a blocker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah ok, I'll switch it back 👍

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

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

@jonathan-buttner jonathan-buttner merged commit b4b6428 into elastic:master Aug 10, 2020
@jonathan-buttner jonathan-buttner deleted the support-prerelease branch August 10, 2020 15:18
jonathan-buttner added a commit to jonathan-buttner/kibana that referenced this pull request Aug 10, 2020
* Allow prerelease in version

* Adding integration test for prerelease version of a package

* Tests for invalid package key

* Removing inter-test dependency
jonathan-buttner added a commit that referenced this pull request Aug 10, 2020
* Allow prerelease in version

* Adding integration test for prerelease version of a package

* Tests for invalid package key

* Removing inter-test dependency
gmmorris added a commit to gmmorris/kibana that referenced this pull request Aug 11, 2020
…-task

* master: (42 commits)
  Allow any hostname for chromium proxy bypass (elastic#74693)
  [ML] ML on Kibana Management: Add ability to pass a group ID filter to job management page (elastic#74533)
  [Metrics UI] Fix No Data preview pluralization (elastic#74399)
  [Bug][Security_Solution][Telemetry] Capitalize S in macOS (elastic#74688)
  Remove karma tests  from legacy maps (elastic#74668)
  [Ingest Manager] stop creating events-* index pattern and placeholder index (elastic#74683)
  [Enterprise Search] Update the browser/document title on plugin navigation (elastic#74392)
  [visualizations] Add i18n translation for 'No results found' (elastic#74619)
  [maps] convert vector style properties to TS (elastic#74553)
  bump geckodriver binary to 0.27 (elastic#74638)
  fix: update apm agents to catch abort requests (elastic#74658)
  [Security Solution] Resolver children pagination (elastic#74603)
  add memoryStatus to df analytics page and analytics table in management (elastic#74570)
  [Ingest Manager] Allow prerelease in package version (elastic#74452)
  [App Arch]: remove legacy karma tests (elastic#74599)
  [i18n] revert reverted changes (elastic#74633)
  [Lens] Clear out all attribute properties before updating (elastic#74483)
  [Uptime] Fix full reloads while navigating to alert/ml (elastic#73796)
  Index pattern field class refactor (elastic#73180)
  [ML] Functional tests - stabilize DFA job type check (elastic#74631)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Aug 11, 2020
* master: (339 commits)
  [Ingest Node Pipelines] Sentence-case processor names (elastic#74645)
  Bump angular dependency from 1.7.9 to 1.8.0 (elastic#74482)
  [ML] Fixing schema for custom rule conditions (elastic#74676)
  [ML] Refactor in preparation for new es client (elastic#74552)
  [ML] Adding initial file analysis overrides (elastic#74376)
  Allow any hostname for chromium proxy bypass (elastic#74693)
  [ML] ML on Kibana Management: Add ability to pass a group ID filter to job management page (elastic#74533)
  [Metrics UI] Fix No Data preview pluralization (elastic#74399)
  [Bug][Security_Solution][Telemetry] Capitalize S in macOS (elastic#74688)
  Remove karma tests  from legacy maps (elastic#74668)
  [Ingest Manager] stop creating events-* index pattern and placeholder index (elastic#74683)
  [Enterprise Search] Update the browser/document title on plugin navigation (elastic#74392)
  [visualizations] Add i18n translation for 'No results found' (elastic#74619)
  [maps] convert vector style properties to TS (elastic#74553)
  bump geckodriver binary to 0.27 (elastic#74638)
  fix: update apm agents to catch abort requests (elastic#74658)
  [Security Solution] Resolver children pagination (elastic#74603)
  add memoryStatus to df analytics page and analytics table in management (elastic#74570)
  [Ingest Manager] Allow prerelease in package version (elastic#74452)
  [App Arch]: remove legacy karma tests (elastic#74599)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants