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

[CCI] Add bluebird replaces for packages/osd-opensearch-archiver #4024

Conversation

Nicksqain
Copy link
Contributor

Description

Issues Resolved

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Nicksqain added 2 commits May 14, 2023 11:43
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
Signed-off-by: Alexei Karikov <karikov.alist.ru@gmail.com>
@codecov
Copy link

codecov bot commented May 14, 2023

Codecov Report

Merging #4024 (e8d8ab6) into main (0188d05) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main    #4024   +/-   ##
=======================================
  Coverage   66.44%   66.44%           
=======================================
  Files        3229     3229           
  Lines       62067    62067           
  Branches     9599     9599           
=======================================
  Hits        41238    41238           
  Misses      18526    18526           
  Partials     2303     2303           
Flag Coverage Δ
Linux 66.38% <0.00%> (ø)
Windows 66.38% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...kages/osd-opensearch-archiver/src/lib/directory.ts 0.00% <0.00%> (ø)

@abbyhu2000 abbyhu2000 added the OSCI Open Source Contributor Initiative label May 16, 2023
@@ -44,7 +44,7 @@ import {
} from '../lib';

async function isDirectory(path: string): Promise<boolean> {
const stats: Stats = await fromNode((cb) => stat(path, cb));
const stats: Stats = await promisify(stat)(path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should use fs/promises:

import { stat } from 'fs/promises';
Suggested change
const stats: Stats = await promisify(stat)(path);
const stats: Stats = await stat(path);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I was sticking to description #3662
I'll look into it

Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't apologize. I should thank you for doing all of this!

@@ -82,7 +82,7 @@ export async function rebuildAllAction({
createWriteStream(tempFile),
] as [Readable, ...Writable[]]);

await fromNode((cb) => rename(tempFile, childPath, cb));
await promisify(rename)(tempFile, childPath);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should use fs/promises as well.


export async function readDirectory(path: string) {
const allNames = await fromNode<string[]>((cb) => readdir(path, cb));
const allNames: string[] = await promisify(readdir)(path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should use fs/promises as well.

Comment on lines +40 to +43
function delay(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

We have been defining this delay function way too often. We should move this out into an importable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AMoo-Miki
Thank you for ur review! I was wondering about that, so maybe you can tell me where I can place the delay function?
#3662 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

packages/osd-utils would be a perfect spot; just throw it into a new file. This way when we get rid of Node 14, we can just use timers/promises and delete this file.

@joshuarrrr joshuarrrr added the needs more info Requires more information from poster label Jun 13, 2023
@abbyhu2000
Copy link
Member

convert to draft since requested changes have not been addressed for more than two weeks

@abbyhu2000 abbyhu2000 marked this pull request as draft July 25, 2023 18:55
@ananzh
Copy link
Member

ananzh commented Jul 25, 2024

@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.

@ananzh ananzh closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Requires more information from poster OSCI Open Source Contributor Initiative repeat-contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants