Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 30, 2025

  • Explored repository structure and built successfully
  • Ran tests to confirm current state
  • Reviewed PR fix(client-ofetch): fix missing credentials property support #2699 which shows missing credentials support
  • Examined current implementation in buildOfetchOptions function
  • Added credentials property to buildOfetchOptions function in utils.ts
  • Added comprehensive tests for credentials property support
  • Verified all tests pass (872 tests including 3 new credential tests)
  • Verified type checking passes
  • Generated example client and confirmed credentials property is included
  • Tested manually that credentials work with all values (include, omit, same-origin)
  • Ran pnpm test:update to regenerate all test snapshots
  • Committed updated snapshots (10 ofetch snapshot files)

Summary

Fixed the missing credentials property support in the ofetch client by ensuring it's properly passed through to the underlying ofetch instance.

Changes Made

  1. Added credentials support: Modified buildOfetchOptions to include credentials: opts.credentials as OfetchOptions['credentials']
  2. Added comprehensive tests: Created tests covering all RequestCredentials values ('include', 'omit', 'same-origin') and undefined cases
  3. Updated all test snapshots: Regenerated 10 ofetch snapshot files to include the credentials property in generated code

The change is minimal and maintains backward compatibility while enabling full credentials support as requested in issue #2699.

Original prompt

This section details on the original issue you should resolve

<issue_title>ofetch client dropping credentials keyword</issue_title>
<issue_description>See pull request #2699

We should support the credentials keyword so that it gets correctly propagated to the client instance</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #2709

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

vercel bot commented Sep 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
hey-api-docs Ready Ready Preview Comment Sep 30, 2025 6:15am

Copy link

changeset-bot bot commented Sep 30, 2025

🦋 Changeset detected

Latest commit: ba7e6dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…tions

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] ofetch client dropping credentials keyword fix(client-ofetch): add missing credentials property support Sep 30, 2025
@Copilot Copilot AI requested a review from mrlubos September 30, 2025 02:36
Copilot finished work on behalf of mrlubos September 30, 2025 02:36
@mrlubos
Copy link
Member

mrlubos commented Sep 30, 2025

@copilot make sure to run pnpm test:update and commit the updated snapshots

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 30, 2025

@copilot make sure to run pnpm test:update and commit the updated snapshots

Done! Updated all test snapshots with the credentials property (089bdcb).

Removed unnecessary patch entries and added support for missing credentials property in client-ofetch.
@mrlubos mrlubos marked this pull request as ready for review September 30, 2025 06:15
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 30, 2025
@dosubot dosubot bot added lgtm This PR has been approved by a maintainer client Client package related labels Sep 30, 2025
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.13%. Comparing base (44ccd36) to head (ba7e6dc).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2710   +/-   ##
=======================================
  Coverage   25.12%   25.13%           
=======================================
  Files         386      386           
  Lines       37351    37352    +1     
  Branches     1783     1783           
=======================================
+ Hits         9385     9387    +2     
+ Misses      27953    27952    -1     
  Partials       13       13           
Flag Coverage Δ
unittests 25.13% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

pkg-pr-new bot commented Sep 30, 2025

Open in StackBlitz

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/codegen-core@2710
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@2710
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@2710
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@2710

commit: ba7e6dc

@mrlubos mrlubos merged commit c4fc4aa into main Sep 30, 2025
17 checks passed
@mrlubos mrlubos deleted the copilot/fix-a01977c0-ddcf-4172-81f2-12f0dff81913 branch September 30, 2025 06:27
@hey-api hey-api bot mentioned this pull request Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Client package related lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ofetch client dropping credentials keyword

2 participants