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

[ES client] Rename deprecated params #115528

Merged
merged 6 commits into from
Oct 20, 2021

Conversation

mshustov
Copy link
Contributor

@mshustov mshustov commented Oct 19, 2021

Summary

Extracted from #113950
In the next major release @elastic/elasticsearch client drops camelCase support for keys.
Renames the next params:

  • filterPath --> filter_path
  • ignoreUnavailable --> ignore_unavailable
  • allowNoIndices --> allow_no_indices
  • trackScores --> track_scores
  • trackTotalHits --> track_total_hits

I'm going to port the changes to 7.x to avoid merge conflicts during backports.
Let me know if you find other usages in the plugin code.

@mshustov mshustov added chore v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.16.0 buildkite-ci labels Oct 19, 2021
@kibanamachine
Copy link
Contributor

kibanamachine commented Oct 19, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/management/snapshot_restore/policies·ts.apis management Snapshot and Restore SLM policies Create should create a SLM policy

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://dryrun

[00:00:00]     │
[00:00:00]       └-: apis
[00:00:00]         └-> "before all" hook in "apis"
[00:06:10]         └-: management
[00:06:10]           └-> "before all" hook in "management"
[00:06:39]           └-: Snapshot and Restore
[00:06:39]             └-> "before all" hook in "Snapshot and Restore"
[00:06:39]             └-: SLM policies
[00:06:39]               └-> "before all" hook in "SLM policies"
[00:06:39]               └-> "before all" hook in "SLM policies"
[00:06:39]               └-: Create
[00:06:39]                 └-> "before all" hook for "should create a SLM policy"
[00:06:39]                 └-> should create a SLM policy
[00:06:39]                   │ info [o.e.r.RepositoriesService] [node-01] put repository [test_repo]
[00:06:39]                   └-> "before each" hook: global before each for "should create a SLM policy"
[00:06:39]                   │ info [o.e.x.s.a.TransportPutSnapshotLifecycleAction] [node-01] adding new snapshot lifecycle [test_create_policy]
[00:06:39]                   │ info [o.e.x.s.SnapshotLifecycleService] [node-01] scheduling snapshot lifecycle job [test_create_policy-1]
[00:06:39]                   └- ✖ fail: apis management Snapshot and Restore SLM policies Create should create a SLM policy
[00:06:39]                   │       Error: expected { name: 'my_snapshot',
[00:06:39]                   │   schedule: '0 30 1 * * ?',
[00:06:39]                   │   repository: 'test_repo',
[00:06:39]                   │   config: 
[00:06:39]                   │    { indices: [ 'my_index' ],
[00:06:39]                   │      metadata: { meta: 'my_meta' },
[00:06:39]                   │      partial: false },
[00:06:39]                   │   retention: { expire_after: '1d', min_count: 5, max_count: 10 } } to sort of equal { name: 'my_snapshot',
[00:06:39]                   │   schedule: '0 30 1 * * ?',
[00:06:39]                   │   repository: 'test_repo',
[00:06:39]                   │   config: 
[00:06:39]                   │    { indices: [ 'my_index' ],
[00:06:39]                   │      ignore_unavailable: true,
[00:06:39]                   │      partial: false,
[00:06:39]                   │      metadata: { meta: 'my_meta' } },
[00:06:39]                   │   retention: { expire_after: '1d', max_count: 10, min_count: 5 } }
[00:06:39]                   │       + expected - actual
[00:06:39]                   │ 
[00:06:39]                   │        {
[00:06:39]                   │          "config": {
[00:06:39]                   │       +    "ignore_unavailable": true
[00:06:39]                   │            "indices": [
[00:06:39]                   │              "my_index"
[00:06:39]                   │            ]
[00:06:39]                   │            "metadata": {
[00:06:39]                   │       
[00:06:39]                   │       at Assertion.assert (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:100:11)
[00:06:39]                   │       at Assertion.eql (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:244:8)
[00:06:39]                   │       at Context.<anonymous> (test/api_integration/apis/management/snapshot_restore/policies.ts:87:53)
[00:06:39]                   │       at runMicrotasks (<anonymous>)
[00:06:39]                   │       at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:06:39]                   │       at Object.apply (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:06:39]                   │ 
[00:06:39]                   │ 

Stack Trace

Error: expected { name: 'my_snapshot',
  schedule: '0 30 1 * * ?',
  repository: 'test_repo',
  config: 
   { indices: [ 'my_index' ],
     metadata: { meta: 'my_meta' },
     partial: false },
  retention: { expire_after: '1d', min_count: 5, max_count: 10 } } to sort of equal { name: 'my_snapshot',
  schedule: '0 30 1 * * ?',
  repository: 'test_repo',
  config: 
   { indices: [ 'my_index' ],
     ignore_unavailable: true,
     partial: false,
     metadata: { meta: 'my_meta' } },
  retention: { expire_after: '1d', max_count: 10, min_count: 5 } }
    at Assertion.assert (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:244:8)
    at Context.<anonymous> (test/api_integration/apis/management/snapshot_restore/policies.ts:87:53)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.apply (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16) {
  actual: '{\n' +
    '  "config": {\n' +
    '    "indices": [\n' +
    '      "my_index"\n' +
    '    ]\n' +
    '    "metadata": {\n' +
    '      "meta": "my_meta"\n' +
    '    }\n' +
    '    "partial": false\n' +
    '  }\n' +
    '  "name": "my_snapshot"\n' +
    '  "repository": "test_repo"\n' +
    '  "retention": {\n' +
    '    "expire_after": "1d"\n' +
    '    "max_count": 10\n' +
    '    "min_count": 5\n' +
    '  }\n' +
    '  "schedule": "0 30 1 * * ?"\n' +
    '}',
  expected: '{\n' +
    '  "config": {\n' +
    '    "ignore_unavailable": true\n' +
    '    "indices": [\n' +
    '      "my_index"\n' +
    '    ]\n' +
    '    "metadata": {\n' +
    '      "meta": "my_meta"\n' +
    '    }\n' +
    '    "partial": false\n' +
    '  }\n' +
    '  "name": "my_snapshot"\n' +
    '  "repository": "test_repo"\n' +
    '  "retention": {\n' +
    '    "expire_after": "1d"\n' +
    '    "max_count": 10\n' +
    '    "min_count": 5\n' +
    '  }\n' +
    '  "schedule": "0 30 1 * * ?"\n' +
    '}',
  showDiff: true
}

Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/management/snapshot_restore/policies·ts.apis management Snapshot and Restore SLM policies Create "after all" hook for "should create a policy with only required fields"

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://dryrun

[00:00:00]     │
[00:00:00]       └-: apis
[00:00:00]         └-> "before all" hook in "apis"
[00:06:10]         └-: management
[00:06:10]           └-> "before all" hook in "management"
[00:06:39]           └-: Snapshot and Restore
[00:06:39]             └-> "before all" hook in "Snapshot and Restore"
[00:06:39]             └-: SLM policies
[00:06:39]               └-> "before all" hook in "SLM policies"
[00:06:39]               └-> "before all" hook in "SLM policies"
[00:06:39]               └-: Create
[00:06:39]                 └-> "before all" hook for "should create a SLM policy"
[00:06:39]                 └-> should create a SLM policy
[00:06:39]                   │ info [o.e.r.RepositoriesService] [node-01] put repository [test_repo]
[00:06:39]                   └-> "before each" hook: global before each for "should create a SLM policy"
[00:06:39]                   │ info [o.e.x.s.a.TransportPutSnapshotLifecycleAction] [node-01] adding new snapshot lifecycle [test_create_policy]
[00:06:39]                   │ info [o.e.x.s.SnapshotLifecycleService] [node-01] scheduling snapshot lifecycle job [test_create_policy-1]
[00:06:39]                   └- ✖ fail: apis management Snapshot and Restore SLM policies Create should create a SLM policy
[00:06:39]                   │       Error: expected { name: 'my_snapshot',
[00:06:39]                   │   schedule: '0 30 1 * * ?',
[00:06:39]                   │   repository: 'test_repo',
[00:06:39]                   │   config: 
[00:06:39]                   │    { indices: [ 'my_index' ],
[00:06:39]                   │      metadata: { meta: 'my_meta' },
[00:06:39]                   │      partial: false },
[00:06:39]                   │   retention: { expire_after: '1d', min_count: 5, max_count: 10 } } to sort of equal { name: 'my_snapshot',
[00:06:39]                   │   schedule: '0 30 1 * * ?',
[00:06:39]                   │   repository: 'test_repo',
[00:06:39]                   │   config: 
[00:06:39]                   │    { indices: [ 'my_index' ],
[00:06:39]                   │      ignore_unavailable: true,
[00:06:39]                   │      partial: false,
[00:06:39]                   │      metadata: { meta: 'my_meta' } },
[00:06:39]                   │   retention: { expire_after: '1d', max_count: 10, min_count: 5 } }
[00:06:39]                   │       + expected - actual
[00:06:39]                   │ 
[00:06:39]                   │        {
[00:06:39]                   │          "config": {
[00:06:39]                   │       +    "ignore_unavailable": true
[00:06:39]                   │            "indices": [
[00:06:39]                   │              "my_index"
[00:06:39]                   │            ]
[00:06:39]                   │            "metadata": {
[00:06:39]                   │       
[00:06:39]                   │       at Assertion.assert (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:100:11)
[00:06:39]                   │       at Assertion.eql (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:244:8)
[00:06:39]                   │       at Context.<anonymous> (test/api_integration/apis/management/snapshot_restore/policies.ts:87:53)
[00:06:39]                   │       at runMicrotasks (<anonymous>)
[00:06:39]                   │       at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:06:39]                   │       at Object.apply (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:06:39]                   │ 
[00:06:39]                   │ 
[00:06:39]                 └-> "after all" hook for "should create a policy with only required fields"
[00:06:39]                   └- ✖ fail: apis management Snapshot and Restore SLM policies Create "after all" hook for "should create a policy with only required fields"
[00:06:39]                   │      ResponseError: resource_not_found_exception: [resource_not_found_exception] Reason: snapshot lifecycle policy not found: test_create_required_fields_policy
[00:06:39]                   │       at onBody (/dev/shm/workspace/parallel/15/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:361:23)
[00:06:39]                   │       at IncomingMessage.onEnd (/dev/shm/workspace/parallel/15/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:285:11)
[00:06:39]                   │       at IncomingMessage.emit (node:events:402:35)
[00:06:39]                   │       at endReadableNT (node:internal/streams/readable:1343:12)
[00:06:39]                   │       at processTicksAndRejections (node:internal/process/task_queues:83:21)
[00:06:39]                   │ 
[00:06:39]                   │ 

Stack Trace

ResponseError: resource_not_found_exception: [resource_not_found_exception] Reason: snapshot lifecycle policy not found: test_create_required_fields_policy
    at onBody (/dev/shm/workspace/parallel/15/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:361:23)
    at IncomingMessage.onEnd (/dev/shm/workspace/parallel/15/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:285:11)
    at IncomingMessage.emit (node:events:402:35)
    at endReadableNT (node:internal/streams/readable:1343:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  meta: {
    body: { error: [Object], status: 404 },
    statusCode: 404,
    headers: {
      'x-elastic-product': 'Elasticsearch',
      'content-type': 'application/json;charset=utf-8',
      'content-length': '283'
    },
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 0,
      aborted: false
    }
  }
}

Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/management/snapshot_restore/policies·ts.apis management Snapshot and Restore SLM policies Create should create a SLM policy

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]     │
[00:00:00]       └-: apis
[00:00:00]         └-> "before all" hook in "apis"
[00:07:06]         └-: management
[00:07:06]           └-> "before all" hook in "management"
[00:07:36]           └-: Snapshot and Restore
[00:07:36]             └-> "before all" hook in "Snapshot and Restore"
[00:07:36]             └-: SLM policies
[00:07:36]               └-> "before all" hook in "SLM policies"
[00:07:36]               └-> "before all" hook in "SLM policies"
[00:07:37]                 │ info [o.e.r.RepositoriesService] [node-01] put repository [test_repo]
[00:07:37]               └-: Create
[00:07:37]                 └-> "before all" hook for "should create a SLM policy"
[00:07:37]                 └-> should create a SLM policy
[00:07:37]                   └-> "before each" hook: global before each for "should create a SLM policy"
[00:07:37]                   │ info [o.e.x.s.a.TransportPutSnapshotLifecycleAction] [node-01] adding new snapshot lifecycle [test_create_policy]
[00:07:37]                   │ info [o.e.x.s.SnapshotLifecycleService] [node-01] scheduling snapshot lifecycle job [test_create_policy-1]
[00:07:37]                   └- ✖ fail: apis management Snapshot and Restore SLM policies Create should create a SLM policy
[00:07:37]                   │       Error: expected { name: 'my_snapshot',
[00:07:37]                   │   schedule: '0 30 1 * * ?',
[00:07:37]                   │   repository: 'test_repo',
[00:07:37]                   │   config: 
[00:07:37]                   │    { indices: [ 'my_index' ],
[00:07:37]                   │      metadata: { meta: 'my_meta' },
[00:07:37]                   │      partial: false },
[00:07:37]                   │   retention: { expire_after: '1d', min_count: 5, max_count: 10 } } to sort of equal { name: 'my_snapshot',
[00:07:37]                   │   schedule: '0 30 1 * * ?',
[00:07:37]                   │   repository: 'test_repo',
[00:07:37]                   │   config: 
[00:07:37]                   │    { indices: [ 'my_index' ],
[00:07:37]                   │      ignore_unavailable: true,
[00:07:37]                   │      partial: false,
[00:07:37]                   │      metadata: { meta: 'my_meta' } },
[00:07:37]                   │   retention: { expire_after: '1d', max_count: 10, min_count: 5 } }
[00:07:37]                   │       + expected - actual
[00:07:37]                   │ 
[00:07:37]                   │        {
[00:07:37]                   │          "config": {
[00:07:37]                   │       +    "ignore_unavailable": true
[00:07:37]                   │            "indices": [
[00:07:37]                   │              "my_index"
[00:07:37]                   │            ]
[00:07:37]                   │            "metadata": {
[00:07:37]                   │       
[00:07:37]                   │       at Assertion.assert (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:100:11)
[00:07:37]                   │       at Assertion.eql (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:244:8)
[00:07:37]                   │       at Context.<anonymous> (test/api_integration/apis/management/snapshot_restore/policies.ts:87:53)
[00:07:37]                   │       at runMicrotasks (<anonymous>)
[00:07:37]                   │       at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:07:37]                   │       at Object.apply (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:07:37]                   │ 
[00:07:37]                   │ 

Stack Trace

Error: expected { name: 'my_snapshot',
  schedule: '0 30 1 * * ?',
  repository: 'test_repo',
  config: 
   { indices: [ 'my_index' ],
     metadata: { meta: 'my_meta' },
     partial: false },
  retention: { expire_after: '1d', min_count: 5, max_count: 10 } } to sort of equal { name: 'my_snapshot',
  schedule: '0 30 1 * * ?',
  repository: 'test_repo',
  config: 
   { indices: [ 'my_index' ],
     ignore_unavailable: true,
     partial: false,
     metadata: { meta: 'my_meta' } },
  retention: { expire_after: '1d', max_count: 10, min_count: 5 } }
    at Assertion.assert (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/expect/expect.js:244:8)
    at Context.<anonymous> (test/api_integration/apis/management/snapshot_restore/policies.ts:87:53)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.apply (/dev/shm/workspace/parallel/15/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16) {
  actual: '{\n' +
    '  "config": {\n' +
    '    "indices": [\n' +
    '      "my_index"\n' +
    '    ]\n' +
    '    "metadata": {\n' +
    '      "meta": "my_meta"\n' +
    '    }\n' +
    '    "partial": false\n' +
    '  }\n' +
    '  "name": "my_snapshot"\n' +
    '  "repository": "test_repo"\n' +
    '  "retention": {\n' +
    '    "expire_after": "1d"\n' +
    '    "max_count": 10\n' +
    '    "min_count": 5\n' +
    '  }\n' +
    '  "schedule": "0 30 1 * * ?"\n' +
    '}',
  expected: '{\n' +
    '  "config": {\n' +
    '    "ignore_unavailable": true\n' +
    '    "indices": [\n' +
    '      "my_index"\n' +
    '    ]\n' +
    '    "metadata": {\n' +
    '      "meta": "my_meta"\n' +
    '    }\n' +
    '    "partial": false\n' +
    '  }\n' +
    '  "name": "my_snapshot"\n' +
    '  "repository": "test_repo"\n' +
    '  "retention": {\n' +
    '    "expire_after": "1d"\n' +
    '    "max_count": 10\n' +
    '    "min_count": 5\n' +
    '  }\n' +
    '  "schedule": "0 30 1 * * ?"\n' +
    '}',
  showDiff: true
}

and 2 more failures, only showing the first 3.

Metrics [docs]

✅ unchanged

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

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

@mshustov mshustov marked this pull request as ready for review October 19, 2021 14:20
@mshustov mshustov requested review from a team as code owners October 19, 2021 14:20
@mshustov mshustov requested a review from a team October 19, 2021 14:20
@mshustov mshustov requested review from a team as code owners October 19, 2021 14:20
@mshustov mshustov requested a review from a team October 19, 2021 14:20
@Kerry350 Kerry350 self-requested a review October 19, 2021 15:06
Copy link
Contributor

@phillipb phillipb left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@yctercero yctercero left a comment

Choose a reason for hiding this comment

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

Security solution changes LGTM.

Copy link
Contributor

@patrykkopycinski patrykkopycinski left a comment

Choose a reason for hiding this comment

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

Asset Management LGTM

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Rubberstamping approval. @elastic/kibana-app-services You are the owners for the file that was touched: https://github.com/elastic/kibana/pull/115528/files#diff-97c352c28918de15081fb5ef9d9405e42c42fb4539e114d186f908d20bf49f58

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

app services change lgtm

Copy link
Contributor

@cqliu1 cqliu1 left a comment

Choose a reason for hiding this comment

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

Canvas changes LGTM 👍

Copy link
Member

@machadoum machadoum left a comment

Choose a reason for hiding this comment

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

security-solution LGTM

Copy link
Member

@Bamieh Bamieh left a comment

Choose a reason for hiding this comment

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

LGTM

@Kerry350 Kerry350 removed their request for review October 20, 2021 09:22
@mshustov mshustov added the auto-backport Deprecated - use backport:version if exact versions are needed label Oct 20, 2021
Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Reporting changes LGTM

@mshustov mshustov merged commit c6fcde9 into elastic:master Oct 20, 2021
@mshustov mshustov deleted the rename-deprecetaed-es-params branch October 20, 2021 14:46
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 20, 2021
* filterPath --> filter_path

* ignoreUnavailable --> ignore_unavailable

* ignoreUnavailable --> ignore_unavailable

* trackScores --> track_scores

* trackTotalHits --> track_total_hits

* rollback unnecessary changes
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

tylersmalley pushed a commit that referenced this pull request Oct 20, 2021
* filterPath --> filter_path

* ignoreUnavailable --> ignore_unavailable

* ignoreUnavailable --> ignore_unavailable

* trackScores --> track_scores

* trackTotalHits --> track_total_hits

* rollback unnecessary changes

Co-authored-by: Mikhail Shustov <restrry@gmail.com>
@mshustov mshustov mentioned this pull request Oct 22, 2021
35 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed buildkite-ci chore release_note:skip Skip the PR/issue when compiling release notes v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.