Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into release-note-1.12.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Annie committed Dec 9, 2020
2 parents e50e7b5 + f0d27c0 commit e3edec4
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 22 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Get Kibana version
id: kibana_version
run: |
echo "::set-output name=kibana_version::$(node -p "(require('./index-management-kibana-plugin/package.json').kibana.version).match(/[.0-9]+/)[0]")"
echo "::set-output name=kibana_version::$(node -p "(require('./index-management-kibana-plugin/kibana.json').kibanaVersion).match(/[.0-9]+/)[0]")"
- name: Checkout Kibana
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -69,16 +69,17 @@ jobs:
yarn kbn bootstrap
- name: Run kibana server
run: |
cd kibana/plugins/index-management-kibana-plugin
cd kibana
yarn start --no-base-path --no-watch &
sleep 300
# timeout 300 bash -c 'while [[ "$(curl -s localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
# for now just chrome, use matrix to do all browsers later
- name: Cypress tests
uses: cypress-io/github-action@v1
uses: cypress-io/github-action@v2
with:
working-directory: kibana/plugins/index-management-kibana-plugin
command: yarn run cypress run
wait-on: 'http://localhost:5601'
browser: chrome
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Get Kibana version
id: kibana_version
run: |
echo "::set-output name=kibana_version::$(node -p "(require('./index-management-kibana-plugin/package.json').kibana.version).match(/[.0-9]+/)[0]")"
echo "::set-output name=kibana_version::$(node -p "(require('./index-management-kibana-plugin/kibana.json').kibanaVersion).match(/[.0-9]+/)[0]")"
- name: Checkout Kibana
uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Get Kibana version
id: kibana_version
run: |
echo "::set-output name=kibana_version::$(node -p "(require('./index-management-kibana-plugin/package.json').kibana.version).match(/[.0-9]+/)[0]")"
echo "::set-output name=kibana_version::$(node -p "(require('./index-management-kibana-plugin/kibana.json').kibanaVersion).match(/[.0-9]+/)[0]")"
- name: Checkout Kibana
uses: actions/checkout@v2
with:
Expand Down
5 changes: 4 additions & 1 deletion cypress/integration/indices_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ describe("Indices", () => {
// Click apply policy button
cy.get(`[data-test-subj="Apply policyButton"]`).click({ force: true });

cy.get(`input[data-test-subj="comboBoxSearchInput"]`).focus().type(POLICY_ID, { parseSpecialCharSequences: false, delay: 1 });
cy.get(`input[data-test-subj="comboBoxSearchInput"]`).focus().type(POLICY_ID, {
parseSpecialCharSequences: false,
delay: 1,
});

// Click the policy option
cy.get(`button[role="option"]`).first().click({ force: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default class ApplyPolicyModal extends Component<ApplyPolicyModalProps, A
}
}
} catch (err) {
this.context.notifications.toasts.addDanger(err.message);
if (this.context != null) this.context.notifications.toasts.addDanger(err.message);
}

this.setState({ isLoading: false });
Expand Down
36 changes: 21 additions & 15 deletions server/services/RollupService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,21 +361,27 @@ export default class RollupService {
rollup: hit._source,
metadata: null,
}));
const ids = rollups.map((rollup) => rollup._id).join(",");
const explainResponse = await this.explainRollup(context, request, response, ids);
if (explainResponse.payload.ok) {
rollups.map((item) => {
item.metadata = explainResponse.payload.response[item._id];
});
return response.custom({
statusCode: 200,
body: { ok: true, response: { rollups: rollups, totalRollups: totalRollups, metadata: explainResponse } },
});
} else
return response.custom({
statusCode: 200,
body: { ok: false, error: explainResponse.payload.error },
});
if (totalRollups) {
const ids = rollups.map((rollup) => rollup._id).join(",");
const explainResponse = await this.explainRollup(context, request, response, ids);
if (explainResponse.payload.ok) {
rollups.map((item) => {
item.metadata = explainResponse.payload.response[item._id];
});
return response.custom({
statusCode: 200,
body: { ok: true, response: { rollups: rollups, totalRollups: totalRollups, metadata: explainResponse } },
});
} else
return response.custom({
statusCode: 200,
body: { ok: false, error: explainResponse.payload.error },
});
}
return response.custom({
statusCode: 200,
body: { ok: true, response: { rollups: rollups, totalRollups: totalRollups, metadata: {} } },
});
} catch (err) {
if (err.statusCode === 404 && err.body.error.type === "index_not_found_exception") {
return response.custom({
Expand Down

0 comments on commit e3edec4

Please sign in to comment.