-
Notifications
You must be signed in to change notification settings - Fork 979
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
[CCI] Add bluebird replaces for src/plugins/vis_type_timeline #4025
[CCI] Add bluebird replaces for src/plugins/vis_type_timeline #4025
Conversation
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #4025 +/- ##
==========================================
- Coverage 66.46% 66.35% -0.11%
==========================================
Files 3229 3229
Lines 62091 62137 +46
Branches 9607 9619 +12
==========================================
- Hits 41269 41234 -35
- Misses 18511 18581 +70
- Partials 2311 2322 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
@@ -106,7 +105,8 @@ export function runRoute( | |||
savedObjectsClient: context.core.savedObjects.client, | |||
}); | |||
const chainRunner = chainRunnerFn(tlConfig); | |||
const sheet = await Bluebird.all(chainRunner.processRequest(request.body)); | |||
const promises = chainRunner.processRequest(request.body); | |||
const sheet = await Promise.all(Array.from(promises)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does chainRunner.processRequest(request.body)
returns returns an array of promises? or it returns an iterable (like a Set) of promises, so you convert it to an array before passing it to Promise.all?
From chainRunnerFn
def, I see the return is
return {
processRequest: processRequest,
getStats: function () {
return stats;
},
};
where processRequest
is defined as
function processRequest(request) {
if (!request) throw new Error('Empty request body');
validateTime(request.time, tlConfig);
tlConfig.time = request.time;
tlConfig.time.to = moment(request.time.to).valueOf();
tlConfig.time.from = moment(request.time.from).valueOf();
tlConfig.time.interval = calculateInterval(
tlConfig.time.from,
tlConfig.time.to,
tlConfig.settings['timeline:target_buckets'] || 200,
tlConfig.time.interval,
tlConfig.settings['timeline:min_interval'] || '1ms'
);
tlConfig.setTargetSeries();
stats.invokeTime = new Date().getTime();
stats.queryCount = 0;
queryCache = {};
// This is setting the "global" sheet, required for resolving references
sheet = parseSheet(request.sheet);
return preProcessSheet(sheet).then(function () {
return _.map(sheet, function (chainList, i) {
return resolveChainList(chainList)
.then(function (seriesList) {
stats.sheetTime = new Date().getTime();
return seriesList;
})
.catch(function (e) {
throwWithCell(i, e);
});
});
});
}
The _.map
function from lodash is being used here.resolveChainList(chainList)
returns a Promise. _.map
returns an array. So it seems to me the return type is array of Promise. Therefore, we could do
const sheet = await Promise.all(chainRunner.processRequest(request.body));
?
Could you help me to double check and verify? Could set some console logs to verify the type of promises chainRunner returns.
Since this is in server, you could add launch.json in .vscode then add a break point when you run a timeline func
{
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "attach",
"name": "back",
"port": 9229
}
]
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall nice and clean change! Thank you so much. I have two suggestions here:
- Help to verify the return type
const promises = chainRunner.processRequest(request.body);
Pls see my comment. - Add CHANGELOG.
@ananzh |
* Bump Node.js requirements to 18 Signed-off-by: Miki <miki@amazon.com> * Replace `lmdb-store` with `lmdb` Signed-off-by: Miki <miki@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> * Bump `elastic-apm-node` to the latest minor Signed-off-by: Miki <miki@amazon.com> * Replace webpack and plugins with a patched version that uses xxhash64 * Use `xxhash64` as the hashing algorithm of webpack * Upgrade `globby` * Remove `fibers` Signed-off-by: Miki <miki@amazon.com> * Replace `fs.rmdir` with `fs.rm` in cross-platform tests Signed-off-by: Miki <miki@amazon.com> * Increase listener limit Signed-off-by: Miki <miki@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> * Add promise-stripping serializer Signed-off-by: Miki <miki@amazon.com> * Bump heap for CI Signed-off-by: Miki <miki@amazon.com> * Correct use of fs/promises in @osd/pm Signed-off-by: Miki <miki@amazon.com> * Use fs/promise in plugin post-install cleanup Signed-off-by: Miki <miki@amazon.com> * Set the test server's host to `0.0.0.0` Signed-off-by: Miki <miki@amazon.com> * Sync `.node-version` file Signed-off-by: Miki <miki@amazon.com> * Support both `isPrimary`, for Node 18, and `isMaster`, for Node 14 Signed-off-by: Miki <miki@amazon.com> * Add types when using `isDeepStrictEqual` Signed-off-by: Miki <miki@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> * Add names to `SchemaError` to log more specific errors Signed-off-by: Miki <miki@amazon.com> * Fix failing vega visualization tests outside the CI Signed-off-by: Miki <miki@amazon.com> * Fix snapshot of errors thrown for undefined accessors Signed-off-by: Miki <miki@amazon.com> * Fix flakiness of log_rotator Signed-off-by: Miki <miki@amazon.com> * Fix asynchronous `fs` usafe in plugin discover Signed-off-by: Miki <miki@amazon.com> * Fix mocks in @osd/optimizer Signed-off-by: Miki <miki@amazon.com> * Fix memory leaks caused by setting states on unloaded components Signed-off-by: Miki <miki@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> * Bump Node in Dockerfile Signed-off-by: Miki <miki@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> * Remove the response `close` event as an indicator of the requesting finishing opensearch-project#3601 (comment) Signed-off-by: Miki <miki@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> * [BWC] Timeout after 3 mins of waiting for OSD to be running in tests Signed-off-by: Miki <miki@amazon.com> * Make build use the same node version that tests are run against Signed-off-by: Miki <miki@amazon.com> * Make Node resolve DNS by IPv4 first * This is helpful to resolve `locahost` to `127.0.0.1` Signed-off-by: Miki <miki@amazon.com> * Standardize patterns used by plugin discovery * Enhance absolute path serialization on Windows Signed-off-by: Miki <amoo_miki@yahoo.com> * Mock fetch in SenseEditor tests Signed-off-by: Miki <amoo_miki@yahoo.com> * Restore node-sass usage to fix build performance * `sass-loader@10` is the last version that supports webpack@4 * `sass` is extremely slow when using the legacy API (`render`) and to use the "Modern API" (`compileStringAsync`), `sass-loader@13` would be needed. * The performance of `sass@10` is made acceptable only with `fibers` but that is deprecated and doesn't work on Node 18 Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Miki <miki@amazon.com> * Revert "[CI] setup Chrome and utilize binary path (opensearch-project#3997)" This reverts commit 0188d05 Signed-off-by: Miki <miki@amazon.com> * Prevent fast-fail while running functional test in CI Signed-off-by: Miki <miki@amazon.com> * Revert "Temporarily hardcode chromedriver to 112.0.0 to enable all ftr tests (opensearch-project#3976)" This reverts commit 5ea0cbe. Signed-off-by: Miki <miki@amazon.com> * Save Cypress results artifacts during CI Signed-off-by: Miki <miki@amazon.com> * Add missing required dependency on `set-value` * Also force all to ^4.1.0 due to a vulnerability fixed in 3.1.0. Signed-off-by: Miki <miki@amazon.com> * Prevent multiple calls to bootstrap's shutdown Signed-off-by: Miki <miki@amazon.com> * Use Node 18.16.0 in distributions * Bump jest-canvas-mock to fix failing tests * Extend Node engines versions Signed-off-by: Miki <miki@amazon.com> * Normalize test snapshots across Node 14, 16, and 18 Signed-off-by: Miki <miki@amazon.com> * Update CHANGELOG for Node.js >=14.20.1 <19 support Signed-off-by: Miki <miki@amazon.com> --------- Signed-off-by: Miki <miki@amazon.com> Signed-off-by: Miki <amoo_miki@yahoo.com> Signed-off-by: Anan Zhuang <ananzh@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com>
* Remove timeline application In this PR, we made the following changes: First of all, clean out some advanced settings specific to timeline application and tests. * Remove timelion:default_rows: This setting defines the default number of rows that a new Timelion sheet should have. * Remove timelion:default_rows: This setting defines the default number of columns that a new Timelion sheet should have. * Remove timelion:showTutorial. Second, remove src/plugin/timeline completely and modify timeline vis. Third, remove all the functional tests related to timeline application. Issue resolve opensearch-project#3519 opensearch-project#3593 Signed-off-by: ananzh <ananzh@amazon.com> --------- Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: ananzh <ananzh@amazon.com>
…pensearch-project#3955) Signed-off-by: Miki <miki@amazon.com>
…#4171) Signed-off-by: Josh Romero <rmerqg@amazon.com>
…de 18 (opensearch-project#4151) Signed-off-by: ananzh <ananzh@amazon.com> Signed-off-by: Miki <miki@amazon.com>
CHANGELOG.md
Outdated
@@ -204,6 +204,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
- [Console] Remove unused ul element and its custom styling ([#3993](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3993)) | |||
- Fix EUI/OUI type errors ([#3798](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3798)) | |||
- Remove unused Sass in `tile_map` plugin ([#4110](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4110)) | |||
- Add bluebird replaces for vis_type_timeline plugin ([#4025](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4025)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add bluebird replaces for vis_type_timeline plugin ([#4025](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4025)) | |
- Replace the use of `bluebird` in the `vis_type_timeline` plugin ([#4025](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4025)) |
resolves opensearch-project#4173 Signed-off-by: Su <szhongna@amazon.com>
…#4188) Snapshot checksum verification caused failure in test runs: opensearch-project#4187 Skipping the verification to enable the tests run as the snapshot of OpenSearch should not impact the tests. Issue: n/a Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
…d verifies if it is installed (opensearch-project#3116) Resolves Issue -opensearch-project#2799 Signed-off-by: Manasvini B Suryanarayana <manasvis@amazon.com>
…favor of OUI utility class. (opensearch-project#4164) * remove custom styling in favor of oui utility class Signed-off-by: Sirazh Gabdullin <sirazh.gabdullin@nu.edu.kz> * Update CHANGELOG.md Signed-off-by: Sirazh Gabdullin <sirazh.gabdullin@nu.edu.kz> --------- Signed-off-by: Sirazh Gabdullin <sirazh.gabdullin@nu.edu.kz>
@Nicksqain I think |
@ananzh |
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
…qain/OpenSearch-Dashboards into bluebird-vis_type_timeline
@ananzh My git is broken, I'm sorry. how do I roll back my rebase? |
@Nicksqain A simple way is to pull the latest main, then create a new branch and cherry-pick the commit here. Then force push. |
@Nicksqain I don't what causes the error in your screenshot, but I tried to use Here is the function test group 1 result:
Note: I removed the bootstrap for windows. so windows failure is fine. See linux passed all ftr tests. |
@Nicksqain Due to an extended period without updates, we're going to close this issue for now. We appreciate your contribution and understand that priorities and availability can change. Please feel free to reopen this issue when you have the opportunity to revisit it. Thank you for your understanding. |
Description
Issues Resolved
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr