Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Bump node-fetch from 2.6.1 to 3.1.1 in /script #23506

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 22, 2022

Bumps node-fetch from 2.6.1 to 3.1.1.

Release notes

Sourced from node-fetch's releases.

v3.1.1

Security patch release

Recommended to upgrade, to not leak sensitive cookie and authentication header information to 3th party host while a redirect occurred

What's Changed

New Contributors

Full Changelog: node-fetch/node-fetch@v3.1.0...v3.1.1

v3.1.0

What's Changed

... (truncated)

Changelog

Sourced from node-fetch's changelog.

Changelog

All notable changes will be recorded here.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

What's Changed

New Contributors

Full Changelog: node-fetch/node-fetch@v3.1.0...v3.1.2

3.1.0

What's Changed

... (truncated)

Commits
Maintainer changes

This version was pushed to npm by endless, a new releaser for node-fetch since your current version.


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 3.1.1.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](node-fetch/node-fetch@v2.6.1...v3.1.1)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jan 22, 2022
@darangi darangi merged commit 53e497b into master Jan 26, 2022
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/script/node-fetch-3.1.1 branch January 26, 2022 16:09
@DeeDeeG
Copy link
Contributor

DeeDeeG commented Feb 23, 2022

Short summary: This PR broke a part of Nightly CI. Needs to be imported differently here, or downgraded to v2.x instead of v3.x. No known security impact to downgrading to latest v2.x, since it is just as patched for security as v3.x. is.


I think this broke the "Bump dependencies" job/task, which runs only on the Nightly CI pipeline.

(See: First Nightly run after this PR was merged has an error failing to import the node-fetch module: Failing CI run. All the Nightly runs since then have this same error.)

node-fetch 2.x to 3.x is a breaking change, particularly with the module switching to ESM (standard ECMAScript JS module) instead of being CommonJS (Node-style module).

It is recommended to stay on node-fetch 2.x unless we are consuming it from ESM. I don't think atom's build scripts are ESM, rather I think they are CommonJS.

See: https://github.com/node-fetch/node-fetch/blob/v3.2.0/docs/v3-UPGRADE-GUIDE.md#converted-to-es-module

This module was converted to be a ESM only package in version 3.0.0-beta.10. node-fetch is an ESM-only module - you are not able to import it with require. We recommend you stay on v2 which is built with CommonJS unless you use ESM yourself. We will continue to publish critical bug fixes for it.

Alternatively, you can use the async import() function from CommonJS to load node-fetch asynchronously:

// mod.cjs
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));

Note that node-fetch v2 is as patched for security as node-fetch v3, as far as I can tell from broswing the project's releases. The latest security release of v2.x and v3.x were on the same day for apparently the same vulnerability.

Edit to add: For what it's worth, I think the copy of node-fetch bumped by this PR is exclusively used here: https://github.com/atom/atom/blob/v1.59.0/script/lib/update-dependency/fetch-outdated-dependencies.js#L1

So the "correct thing to do" here consists only of correct use with regard to that one file used in the Nightly CI pipeline.

DeeDeeG added a commit to DeeDeeG/atom that referenced this pull request Feb 23, 2022
This version has all the known security patches in v3.x,
and is meanwhile the recommended version to use from CommonJS
(NodeJS-style) modules, as opposed to ESM.

Atom's build and CI scripts are all CommonJS as far as I know,
so we should basically stay on node-fetch v2.x.

This fixes the currently broken "Bump dependencies" job in Nightly CI.

Effectively reverts ad1318e,
AKA atom#23506,
albeit with a more up-to-date patch version of node-fetch v2.x.
@darangi
Copy link
Contributor

darangi commented Feb 23, 2022

Thanks for catching this 🙇🏾 @DeeDeeG

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants