Skip to content

Migrate Got to Ky; run [*****]#11996

Closed
LitoMore wants to merge 5 commits into
badges:masterfrom
LitoMore:ky
Closed

Migrate Got to Ky; run [*****]#11996
LitoMore wants to merge 5 commits into
badges:masterfrom
LitoMore:ky

Conversation

@LitoMore

@LitoMore LitoMore commented Jul 12, 2026

Copy link
Copy Markdown
Member

Closes #11072

Ky uses the Node.js built-in Fetch, and it has a similar development experience to Got. Both Got's and Ky's READMEs mentioned their differences and recommended Ky.

I used AI (gpt-5.6-sol ultra) to initialize this PR. Please let me know your thoughts.

@socket-security

socket-security Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedky@​2.0.29910010086100
Updatednock@​13.5.6 ⏵ 14.0.1687 -1210010097 +4100
Updatedundici@​6.26.0 ⏵ 8.7.093100 +19100 +197100

View full report

@socket-security

socket-security Bot commented Jul 12, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @mswjs/interceptors is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: package-lock.jsonnpm/nock@14.0.16npm/@mswjs/interceptors@0.41.9

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@mswjs/interceptors@0.41.9. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm nock is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: package-lock.jsonnpm/nock@14.0.16

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/nock@14.0.16. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️ This PR modified service code for bundlejs but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for dynamic but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for opm but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for poeditor but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for stackexchange but not its test code.
That's okay so long as it's refactoring existing code.
⚠️ This PR modified service code for steam but not its test code.
That's okay so long as it's refactoring existing code.
⚠️

📚 Remember to ensure any changes to config.private in services/github/auth/acceptor.js are reflected in the server secrets documentation.

Messages
📖 ✨ Thanks for your contribution to Shields, @LitoMore!
📖

Thanks for contributing to our documentation. We ❤️ our documentarians!

Generated by 🚫 dangerJS against d43f701

@PyvesB PyvesB changed the title Migrate Got to Ky Migrate Got to Ky; run[*****] Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Updated review app: https://pr-11996-badges-shields.fly.dev

@PyvesB

PyvesB commented Jul 16, 2026

Copy link
Copy Markdown
Member

This looks promising! Could you take a peak at the test failures? Some are expected due to missing credentials on your fork and some already fail in the daily tests, but I'm not sure about the Error: ESOCKETTIMEDOUT or AssertionError: label mismatch: expected 'counter' to equal 'async handle repo:badges/puppets ones for example.

@PyvesB PyvesB changed the title Migrate Got to Ky; run[*****] Migrate Got to Ky; run [*****] Jul 16, 2026
@PyvesB PyvesB added the core Server, BaseService, GitHub auth, Shared helpers label Jul 18, 2026
@LitoMore

LitoMore commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

Thanks for flagging these — I dug into both examples.

The ESOCKETTIMEDOUT failures were a real test-infrastructure regression. Ky uses native Fetch, which required upgrading to Nock 14. IcedFrisby was enabling Nock even for live tests, and Nock’s passthrough MockHttpSocket imposed its own ~5-second socket timeout, despite those tests specifying 10- or 15-second timeouts.

I’ve changed the runner so live tests bypass Nock, while tests with explicit interceptors reactivate it. I also added regression tests covering both cases.

The GitHub Search label mismatch was a secondary symptom of an upstream request failure rather than a label-rendering regression. That run logged a 429 from api.github.com immediately before the assertion. The resulting error badge used the service’s default label, counter, while the live test expected the query-specific label, async handle repo:badges/puppets counter.

I reran the targeted GitHub Search tests successfully, and neither the /github.json failure, the label mismatch, nor ESOCKETTIMEDOUT appears in the latest Services log.

The Services check is still red from the remaining live-suite noise: Libraries.io/Pypistats rate limiting and a few transient Cookbook/GitLab requests. I reran the latter paths locally and they all passed. All non-Service checks are now green.

The response above is generated by gpt-5.6-col ultra.

Comment thread core/base-service/base-graphql.js Outdated
@PyvesB

PyvesB commented Jul 20, 2026

Copy link
Copy Markdown
Member

I'm still a little nervous about this many service test failures. I would not have expected the Gist or GreasyFork ones to fail for example. We could possibly try running all service tests on another forked PR, to compare side by side in a more precise manner.

@LitoMore

LitoMore commented Jul 25, 2026

Copy link
Copy Markdown
Member Author

I could try to create a branch from our badges/shields repository instead of from my fork to solve the missing credentials problem.

@LitoMore

Copy link
Copy Markdown
Member Author

I'm closing this one in favor of #12060.

@LitoMore LitoMore closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Server, BaseService, GitHub auth, Shared helpers

Development

Successfully merging this pull request may close these issues.

Consider replacing got with native fetch

2 participants