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

Removed unsupported lib, added async methods #932

Merged

Conversation

ismayilov-ismayil
Copy link
Contributor

Issue: sync-request library not supported any more and has high vulnerability issue
Solution: sync-request package removed. downloadFile and related methods changed to async. To make it backward-compatibly async method wrapped into sync by deasync library.

Comment on lines 213 to 224
var downloadArchive = function (url, fileName) {
var result;
downloadArchiveAsync(url, fileName).then(t => result = t);
deasync.loopWhile(function () { return result == undefined; });
return result;
}

/**
* @deprecated This method uses library which is not prefered to use on production
*/

exports.downloadArchive = downloadArchive;
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we need that for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

since this is exported I am not sure is there any user of this method, thus I prefer to keep for a while.

Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK, we don't have make files in the final build, so it's only for internal usage

Comment on lines 161 to 171
var downloadFile = function (url, fileName) {
var result;
downloadFileAsync(url, fileName).then(t => result = t);
deasync.loopWhile(function () { return result == undefined; });
return result;
}
exports.downloadFile = downloadFile;

var downloadArchive = function (url) {
if (!url) {
throw new Error('Parameter "url" must be set.');
}
/**
* @deprecated This method uses library which is not prefered to use on production
*/
exports.downloadFile = downloadFile
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we need this function for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same here

Copy link
Contributor

@KonstantinTyukalov KonstantinTyukalov May 4, 2023

Choose a reason for hiding this comment

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

powershell/make-util.js Show resolved Hide resolved
powershell/make-util.js Outdated Show resolved Hide resolved
node/mock-test.ts Outdated Show resolved Hide resolved
node/mock-test.ts Outdated Show resolved Hide resolved
@ismayilov-ismayil ismayilov-ismayil marked this pull request as ready for review May 17, 2023 09:56
powershell/make-util.js Outdated Show resolved Hide resolved
powershell/package.json Show resolved Hide resolved
node/buildutils.js Outdated Show resolved Hide resolved
node/buildutils.js Outdated Show resolved Hide resolved
node/buildutils.js Outdated Show resolved Hide resolved
node/mock-test.ts Show resolved Hide resolved
node/mock-test.ts Show resolved Hide resolved
@kirill-ivlev
Copy link
Contributor

In general LGTM, but could you please bump task-lib version, confirm that there is no breaking changes and fill changelogs file.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@KonstantinTyukalov KonstantinTyukalov left a comment

Choose a reason for hiding this comment

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

Tested locally with AntV1 task tests. LGTM

node/buildutils.js Outdated Show resolved Hide resolved
powershell/make-util.js Outdated Show resolved Hide resolved
powershell/make-util.js Outdated Show resolved Hide resolved
node/mock-test.ts Outdated Show resolved Hide resolved
powershell/make-util.js Show resolved Hide resolved
node/mock-test.ts Outdated Show resolved Hide resolved
node/buildutils.js Outdated Show resolved Hide resolved
node/buildutils.js Show resolved Hide resolved
node/buildutils.js Show resolved Hide resolved
powershell/make-util.js Show resolved Hide resolved
powershell/make-util.js Outdated Show resolved Hide resolved
node/mock-test.ts Outdated Show resolved Hide resolved
@ismayilov-ismayil ismayilov-ismayil merged commit cea7412 into master Sep 19, 2023
Drarig29 added a commit to DataDog/datadog-ci-azure-devops that referenced this pull request Nov 15, 2023
* Bump azure-pipelines-task-lib to fix open handles

- microsoft/azure-pipelines-task-lib#932
- ForbesLindesay/sync-request#129

* Fix "Could not locate the bindings file"

* Run mock tasks asynchronously
Drarig29 added a commit to DataDog/datadog-ci-azure-devops that referenced this pull request Nov 15, 2023
* Bump azure-pipelines-task-lib to fix open handles

- microsoft/azure-pipelines-task-lib#932
- ForbesLindesay/sync-request#129

* Fix "Could not locate the bindings file"

* Run mock tasks asynchronously

* [dep] Remove superfluous libraries

* Try node 10 entrypoint

* Revert "Try node 10 entrypoint"

This reverts commit b962ed3.
Drarig29 added a commit to DataDog/datadog-ci-azure-devops that referenced this pull request Nov 15, 2023
* Bump azure-pipelines-task-lib to fix open handles

- microsoft/azure-pipelines-task-lib#932
- ForbesLindesay/sync-request#129

* Fix "Could not locate the bindings file"

* Run mock tasks asynchronously

* [test] Download Node.js only once
DmitriiBobreshev pushed a commit that referenced this pull request Dec 11, 2023
* Removed unsupported lib, added async methods

* Update 3rd party library change to async

* Format style in ThirdPartyNotice
DmitriiBobreshev added a commit that referenced this pull request Dec 13, 2023
* Removed unsupported lib, added async methods (#932)

* Removed unsupported lib, added async methods

* Update 3rd party library change to async

* Format style in ThirdPartyNotice

* [Deasync remove] - Remove deasync from task-lib

- Remove deasync from node build process

* [Deasync remove] - Remove deasync from task-lib

- Remove deasync from node build process

* [Deasync remove] - Remove deasync from task-lib

- Remove deasync from node build process
- Fixed unit tests
- Updated json

* Added publish script for PowerShell SDK (#975)

* simple yampl to create pipeline

* Add additional steps into pipeline to publish nuget feed

* Upgrade net framework version

* Revert csproj changes

* Specify msbuild version for old netframework support

* Add arch argument to msbuild installation

* Bump package version

* Use nuspec version directly

* Fix downloadFileAsync

* rm committed minimatch dll

* Move publish steps to job + temp disable it

* Move version to package back. Fix encoding

* Add publish script

* Update tags

* update company metadata

* Update to publish to powershell gallery

---------

Co-authored-by: Konstantin Tyukalov <v-ktyukalov@microsoft.com>
Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>

* [Deasync remove] - Remove deasync from task-lib

- Code review changes

---------

Co-authored-by: İsmayıl İsmayılov <110806089+ismayilov-ismayil@users.noreply.github.com>
Co-authored-by: Konstantin Tyukalov <v-ktyukalov@microsoft.com>
Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>
DergachevE pushed a commit that referenced this pull request Apr 26, 2024
* Removed unsupported lib, added async methods (#932)

* Removed unsupported lib, added async methods

* Update 3rd party library change to async

* Format style in ThirdPartyNotice

* [Deasync remove] - Remove deasync from task-lib

- Remove deasync from node build process

* [Deasync remove] - Remove deasync from task-lib

- Remove deasync from node build process

* [Deasync remove] - Remove deasync from task-lib

- Remove deasync from node build process
- Fixed unit tests
- Updated json

* Added publish script for PowerShell SDK (#975)

* simple yampl to create pipeline

* Add additional steps into pipeline to publish nuget feed

* Upgrade net framework version

* Revert csproj changes

* Specify msbuild version for old netframework support

* Add arch argument to msbuild installation

* Bump package version

* Use nuspec version directly

* Fix downloadFileAsync

* rm committed minimatch dll

* Move publish steps to job + temp disable it

* Move version to package back. Fix encoding

* Add publish script

* Update tags

* update company metadata

* Update to publish to powershell gallery

---------

Co-authored-by: Konstantin Tyukalov <v-ktyukalov@microsoft.com>
Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>

* [Deasync remove] - Remove deasync from task-lib

- Code review changes

---------

Co-authored-by: İsmayıl İsmayılov <110806089+ismayilov-ismayil@users.noreply.github.com>
Co-authored-by: Konstantin Tyukalov <v-ktyukalov@microsoft.com>
Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>
@max-zaytsev max-zaytsev mentioned this pull request May 17, 2024
fullstackinfo pushed a commit to fullstackinfo/azure-pipelines-task-lib that referenced this pull request Aug 17, 2024
* Removed unsupported lib, added async methods

* Update 3rd party library change to async

* Format style in ThirdPartyNotice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants