GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: v21 by wolfy1339 · Pull Request #413 · octokit/rest.js

Conversation

@wolfy1339

@wolfy1339 wolfy1339 commented Mar 4, 2024

Copy link
Copy Markdown
Member

BREAKING CHANGE: package is now ESM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Kesin11, oscard0m, wooorm, and pixelcmtd reacted with thumbs up emoji 3vorp reacted with thumbs down emoji jeffwilcox and Danw33 reacted with rocket emoji yvele reacted with eyes emoji
All reactions
  • 👍 4 reactions
  • 👎 1 reaction
  • 🚀 2 reactions
  • 👀 1 reaction
renovate Bot and others added 7 commits March 4, 2024 19:03
@renovate
fix(deps): update octokit monorepo
aed67c2
@wolfy1339
fix: add explicit type anotation
3ddd79e
@wolfy1339
fix(docs): update for ESM
42be65a
@wolfy1339
fix(deps): bump deps
f179b0b
@wolfy1339
fix(build): adapt for ESM
aad55f4
@wolfy1339
maint: remove greenkeeper config
bb067b8
@wolfy1339
Empty commit to trigger release
828467b
BREAKING CHANGE: package is now ESM
@wolfy1339 wolfy1339 added Type: Feature New feature or request Type: Breaking change Used to note any change that requires a major version bump labels Mar 4, 2024
@github-actions

github-actions Bot commented Mar 4, 2024

Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

wolfy1339 added 5 commits March 4, 2024 15:52
@wolfy1339
test: remove btoa-lite
c3e0d33
@wolfy1339
test: add missing jest
d628273
@wolfy1339
fix: bump deps
21f1aaa
@wolfy1339
test: update expected error message
c2339de
@wolfy1339
docs: update for ESM + recent versions of Octokit
10cf79f
@wolfy1339 wolfy1339 mentioned this pull request Mar 18, 2024
[BUG]: TypeScript error when using with @octokit/rest octokit/plugin-retry.js#528
Closed
1 task done
wolfy1339 added 3 commits March 18, 2024 10:27
@wolfy1339
Merge remote-tracking branch 'origin' into beta
7083224
@wolfy1339
style: prettier
37333e5
@wolfy1339
test: use regex to check URL in validation error
20324f6
@wolfy1339

wolfy1339 commented Mar 18, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

It seems that the test is failing because of a trailing slash (/) missing, after modifying @octokit/fixtures-server to account for the missing trailing slash it now fails with

 HttpError: Unknown error: {"error":"Nock: No match for request","detail":{"expected":{"method":"GET","url":"https://fixtures-xrae14px8de.api.github.com/repos/octokit-fixture-org/hello-world/contents","headers":{"accept-encoding":"gzip, deflate","sec-fetch-mode":"cors","accept-language":"*","authorization":"token 0000000000000000000000000000000000000001","user-agent":"octokit-rest.js/0.0.0-development octokit-core.js/6.0.1 Node.js/20.10.0 (linux; x64)","accept":"application/vnd.github.v3+json","connection":"close","host":"fixtures-xrae14px8de.api.github.com"}}}}
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wolfy1339
test: turn on verbatimModuleSyntax
5de6b00
@EricCrosson EricCrosson mentioned this pull request Mar 21, 2024
fix(deps): update octokit monorepo (major) EricCrosson/install-github-release-binary#257
Merged
1 task
@wolfy1339 wolfy1339 mentioned this pull request Apr 4, 2024
Document supported @octokit/rest versions octokit/plugin-throttling.js#690
Closed
wolfy1339 added 2 commits April 9, 2024 20:56
@wolfy1339
build: upgrade @octokit/fixtures-server
3538cc2
@wolfy1339
test: update regex for error
f2546fa
@wolfy1339

wolfy1339 commented Apr 10, 2024

Copy link
Copy Markdown
Member Author

@octokit/js Is anyone able to figure out how to get the test passing?

Is there a way to get @octokit/endpoint to ignore the trailing / for the GET /repos/{owner}/{repo}/contents/{path} endpoint, if path is empty

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@oscard0m

oscard0m commented Apr 10, 2024

Copy link
Copy Markdown
Member

@octokit/js Is anyone able to figure out how to get the test passing?

Is there a way to get @octokit/endpoint to ignore the trailing / for the GET /repos/{owner}/{repo}/contents/{path} endpoint, if path is empty

I'm going to take a look into this. I'll keep you posted.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@oscard0m

oscard0m commented Apr 10, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@octokit/js Is anyone able to figure out how to get the test passing?
Is there a way to get @octokit/endpoint to ignore the trailing / for the GET /repos/{owner}/{repo}/contents/{path} endpoint, if path is empty

I'm going to take a look into this. I'll keep you posted.

TL;DR (in test/scenarios/get-content.test.ts)

There is a logic in place in @octokit/endpoint.js which is removing the ending / and creating a mismatch in tests.


The Problem (in test/scenarios/get-content.test.ts)

I'm focusing on the tests failing for test/scenarios/get-content.test.ts. I will add a new comment for the other test failing.

The error prompted is the following one (complete logs here):

HttpError: Unknown error: {"error":"GET /repos/octokit-fixture-org/hello-world/contents does not match next fixture: GET /repos/octokit-fixture-org/hello-world/contents/","detail":{"pending":["GET [https://fixtures-987ffyc5v8n.api.github.com:443/repos/octokit-fixture-org/hello-world/contents/](https://fixtures-987ffyc5v8n.api.github.com/repos/octokit-fixture-org/hello-world/contents/)","GET [https://fixtures-987ffyc5v8n.api.github.com:443/repos/octokit-fixture-org/hello-world/contents/README.md](https://fixtures-987ffyc5v8n.api.github.com/repos/octokit-fixture-org/hello-world/contents/README.md)"]}}

The root cause

The line swallowing the ending / for the URL requested is this one https://github.com/octokit/endpoint.js/blob/fdbc2643b75d7f291eba3b1cda6428946093d778/src/util/url-template.ts#L197

This change was introduced in octokit/endpoint.js#455 to cover use cases like:

Request Response
/repos/OWNER/REPO/branches 200
/repos/OWNER/REPO/branches/ 404

But, /repos/OWNER/REPO/contents/PATH works with and without /, so we should probably support both 1.

Request Response
/repos/octokit/endpoint.js/contents 200
/repos/octokit/endpoint.js/contents/ 200
/repos/octokit/endpoint.js/contents/test 200
/repos/octokit/endpoint.js/contents/test/ 200

This mismatch comes when we compare the requested URL (with no ending /) and the expected from @octokit/fixtures (with ending /):
https://github.com/octokit/fixtures/blob/5aa66e46e3f3475c4c1eb521cd402dfd85091b52/scenarios/api.github.com/get-content/normalized-fixture.json#L5

We should probably improve the logic we have in place in @octokit/endpoints, but I would like to hear your thoughts on this @octokit/js @octokit/extensibility-sdks. I'm discarding the option of fixing it in @octokit/fixtures because those are auto-generated.

Footnotes

  1. Apparently in the past the trailing / was not working for /repos/{org}/{repo}/contents endpoint but seems that it was escalated and now it's working. ↩

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@oscard0m oscard0m self-assigned this Apr 10, 2024
@oscard0m

oscard0m commented Apr 10, 2024

Copy link
Copy Markdown
Member

The Problem (in test/scenarios/get-archive.test.ts)

The error prompted is the following one (complete logs here):

HttpError: Unknown error: {"error":"Nock: No match for request","detail":{"expected":{"method":"GET","url":"https://fixtures-r9di1toxolb.api.github.com/repos/octokit-fixture-org/get-archive/tarball/main","headers":{"accept-encoding":"gzip, deflate","sec-fetch-mode":"cors","accept-language":"*","authorization":"token 0000000000000000000000000000000000000001","user-agent":"octokit-rest.js/0.0.0-development octokit-core.js/6.1.2 Node.js/20.12.1 (darwin; x64)","accept":"application/vnd.github.v3+json","connection":"close","host":"fixtures-r9di1toxolb.api.github.com"}}}}

The root cause

I've been debugging a bit but did not found the root cause yet. I will keep checking. It's the only fixture which uses 302 as status response. Maybe it has something to do with that. What I can say is the issue is unrelated to the one with get-content.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ekmixon ekmixon mentioned this pull request Jul 11, 2024
[Snyk] Upgrade @octokit/rest from 16.43.2 to 21.0.0 ekmixon/aquasecurity-cloudsploit#132
Open
@snyk-io snyk-io Bot mentioned this pull request Jul 12, 2024
[Snyk] Upgrade @octokit/rest from 20.0.2 to 21.0.0 Morin3/Hcc12#12
Merged
This was referenced Jul 12, 2024
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.0 mikolajroszak/mikolaj.com-snyk#260
Open
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.0 mikolajroszak/mikolaj.com-snyk#261
Open
@snyk-io snyk-io Bot mentioned this pull request Jul 14, 2024
[Snyk] Upgrade @octokit/rest from 16.39.0 to 21.0.0 Morin3/Hcc12#14
Merged
This was referenced Jul 15, 2024
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.0 mikolajroszak/mikolaj.com-snyk#263
Open
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.0 mikolajroszak/mikolaj.com-snyk#264
Open
@Mapuppy09 Mapuppy09 mentioned this pull request Aug 5, 2024
[Snyk] Upgrade @octokit/rest from 20.1.1 to 21.0.0 Mapuppy09/documentation#1
Merged
@mikolajroszak mikolajroszak mentioned this pull request Aug 7, 2024
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.1 mikolajroszak/mikolaj.com-snyk#291
Open
@ekmixon ekmixon mentioned this pull request Aug 7, 2024
[Snyk] Upgrade @octokit/rest from 16.43.2 to 21.0.1 ekmixon/aquasecurity-cloudsploit#139
Open
@ekmixon ekmixon mentioned this pull request Sep 7, 2024
[Snyk] Upgrade @octokit/rest from 16.43.2 to 21.0.2 ekmixon/aquasecurity-cloudsploit#142
Open
@mikolajroszak mikolajroszak mentioned this pull request Sep 7, 2024
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.2 mikolajroszak/mikolaj.com-snyk#309
Open
@ekmixon ekmixon mentioned this pull request Sep 9, 2024
[Snyk] Upgrade: , , , async, chai, minimatch, eslint, google-auth-library, mocha, ms-rest-azure, nodemon, nyc ekmixon/aquasecurity-cloudsploit#143
Open
This was referenced Sep 10, 2024
[Snyk] Upgrade: , , , typescript mikolajroszak/mikolaj.com-snyk#310
Open
[Snyk] Upgrade: , , , typescript mikolajroszak/mikolaj.com-snyk#312
Open
This was referenced Sep 11, 2024
[Snyk] Upgrade: , , , async, chai, minimatch, eslint, google-auth-library, mocha, ms-rest-azure, nodemon, nyc ekmixon/aquasecurity-cloudsploit#144
Open
[Snyk] Upgrade: , , , async, chai, minimatch, eslint, google-auth-library, mocha, ms-rest-azure, nodemon, nyc ekmixon/aquasecurity-cloudsploit#145
Open
This was referenced Sep 14, 2024
[Snyk] Upgrade: , , , typescript mikolajroszak/mikolaj.com-snyk#313
Open
[Snyk] Upgrade: , , , typescript mikolajroszak/mikolaj.com-snyk#315
Open
This was referenced Sep 22, 2024
[Snyk] Upgrade: , typescript SherfeyInv/clir#40
Closed
[Snyk] Upgrade @octokit/rest from 18.12.0 to 21.0.2 SherfeyInv/clir#41
Closed
This was referenced Sep 24, 2024
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.2 mikolajroszak/mikolaj.com-snyk#318
Open
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.2 mikolajroszak/mikolaj.com-snyk#326
Open
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.2 mikolajroszak/mikolaj.com-snyk#331
Open
@mikolajroszak mikolajroszak mentioned this pull request Oct 4, 2024
[Snyk] Upgrade @octokit/rest from 18.5.4 to 21.0.2 mikolajroszak/mikolaj.com-snyk#332
Open
@ms-bot ms-bot mentioned this pull request Oct 7, 2024
chore(deps): bump 🧳 @octokit/rest to ^21.0.2 mobsuccess-devops/pmd-github-action#15
Closed
@benpbolton benpbolton mentioned this pull request Feb 21, 2025
fix(deps): bump Octokit dependencies to address ReDos vulnerabilities, bump devDependencies #487
Merged
2 of 4 tasks
wolfy1339 added a commit that referenced this pull request Feb 26, 2025
@benpbolton @wolfy1339
fix(deps): bump Octokit dependencies to address ReDos vulnerabilities…
eb3e62c
…, bump `devDependencies` (#487)

This aims to resolve #486 `npm vulnerabilities with the 20.x branch

Should resolve:

GHSA-2p57-rm9w-gvfp
GHSA-3xgq-45jj-v275
GHSA-67mh-4wv8-2f99
GHSA-78xj-cgh5-2h22
GHSA-952p-6rrq-rcjv
GHSA-9qxr-qj54-h672
GHSA-9wv6-86v2-598j
GHSA-c2qf-rxjj-qqgw
GHSA-c76h-2ccp-4975
GHSA-c7qv-q95q-8v27
GHSA-f5x3-32g6-xq36
GHSA-grv7-fg5c-xmjg
GHSA-h5c3-5r3r-rr8q
GHSA-m4v8-wqvr-p9f7
GHSA-m6fv-jmcg-4jfg
GHSA-pxg6-pf52-xh8x
GHSA-qwcr-r2fm-qrc7
GHSA-rhx6-c78j-4q9w
GHSA-rmvr-2pp2-xj38
GHSA-xx4v-prfh-6cgc


----

### Before the change?
<!-- Please describe the current behavior that you are modifying. -->

> 31 vulnerabilities (3 low, 18 moderate, 10 high)

![CleanShot 2025-02-21 at 12 06
39](https://github.com/user-attachments/assets/02abda17-8aee-46e3-b808-764672a18475)


### After the change?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

> 9 moderate severity vulnerabilities

![CleanShot 2025-02-21 at 12 12
49](https://github.com/user-attachments/assets/10d593d8-9de5-478e-8cde-b5fb81762706)

**Important note**: the remaining reported 'moderate' vulnerabilities
for `@octokit/request` and `@octokit/plugin-paginate-rest` for
GHSA-h5c3-5r3r-rr8q and
GHSA-rmvr-2pp2-xj38 are actually mitigated
already; npm audit isn't taking the minor versions properly into account
as:

- @octokit/plugin-paginate-rest is patched in `9.2.2` (applied)
- @octokit/request is patched in `8.4.1` (applied)

This is a reporting issue: npm/cli#8125


### Pull request checklist

**Important note**: this PR reduces updates (reduces :() test coverage
due to the same challenges discovered in
#413 (comment)

- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been reviewed and added / updated if needed (for bug
fixes / features)

### Does this introduce a breaking change?
<!-- If this introduces a breaking change make sure to note it here any
what the impact might be -->

Please see our docs on [breaking
changes](https://github.com/octokit/.github/blob/master/community/breaking_changes.md)
to help!

- [ ] Yes
- [x] No

----

---------

Co-authored-by: wolfy1339 <[email protected]>
wolfy1339 added a commit that referenced this pull request Feb 26, 2025
@benpbolton @wolfy1339
fix(deps): bump Octokit dependencies to address ReDos vulnerabilities…
711f2ee
…, bump `devDependencies` (#487)

This aims to resolve #486 `npm vulnerabilities with the 20.x branch

Should resolve:

GHSA-2p57-rm9w-gvfp
GHSA-3xgq-45jj-v275
GHSA-67mh-4wv8-2f99
GHSA-78xj-cgh5-2h22
GHSA-952p-6rrq-rcjv
GHSA-9qxr-qj54-h672
GHSA-9wv6-86v2-598j
GHSA-c2qf-rxjj-qqgw
GHSA-c76h-2ccp-4975
GHSA-c7qv-q95q-8v27
GHSA-f5x3-32g6-xq36
GHSA-grv7-fg5c-xmjg
GHSA-h5c3-5r3r-rr8q
GHSA-m4v8-wqvr-p9f7
GHSA-m6fv-jmcg-4jfg
GHSA-pxg6-pf52-xh8x
GHSA-qwcr-r2fm-qrc7
GHSA-rhx6-c78j-4q9w
GHSA-rmvr-2pp2-xj38
GHSA-xx4v-prfh-6cgc

----

<!-- Please describe the current behavior that you are modifying. -->

> 31 vulnerabilities (3 low, 18 moderate, 10 high)

![CleanShot 2025-02-21 at 12 06
39](https://github.com/user-attachments/assets/02abda17-8aee-46e3-b808-764672a18475)

<!-- Please describe the behavior or changes that are being added by
this PR. -->

> 9 moderate severity vulnerabilities

![CleanShot 2025-02-21 at 12 12
49](https://github.com/user-attachments/assets/10d593d8-9de5-478e-8cde-b5fb81762706)

**Important note**: the remaining reported 'moderate' vulnerabilities
for `@octokit/request` and `@octokit/plugin-paginate-rest` for
GHSA-h5c3-5r3r-rr8q and
GHSA-rmvr-2pp2-xj38 are actually mitigated
already; npm audit isn't taking the minor versions properly into account
as:

- @octokit/plugin-paginate-rest is patched in `9.2.2` (applied)
- @octokit/request is patched in `8.4.1` (applied)

This is a reporting issue: npm/cli#8125

**Important note**: this PR reduces updates (reduces :() test coverage
due to the same challenges discovered in
#413 (comment)

- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been reviewed and added / updated if needed (for bug
fixes / features)

<!-- If this introduces a breaking change make sure to note it here any
what the impact might be -->

Please see our docs on [breaking
changes](https://github.com/octokit/.github/blob/master/community/breaking_changes.md)
to help!

- [ ] Yes
- [x] No

----

---------

Co-authored-by: wolfy1339 <[email protected]>
@campaigner-prod campaigner-prod Bot mentioned this pull request Apr 23, 2026
chore(deps): @octokit/rest (major → 22.0.1) [prebuild/node_modules/@napi-rs/cli] DataDog/action-prebuildify#122
Closed
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gr2m gr2m gr2m approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@oscard0m oscard0m

Labels

released Type: Breaking change Used to note any change that requires a major version bump Type: Feature New feature or request

Projects

🧰 Octokit Active
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@wolfy1339 @oscard0m @gr2m
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.