Skip to content

fix(webapp): paginate shared Vercel env var fetch in onboarding + pull#3879

Merged
0ski merged 2 commits into
mainfrom
oskar/fix-vercel-shared-env-var-pagination
Jun 9, 2026
Merged

fix(webapp): paginate shared Vercel env var fetch in onboarding + pull#3879
0ski merged 2 commits into
mainfrom
oskar/fix-vercel-shared-env-var-pagination

Conversation

@0ski

@0ski 0ski commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Closes #3850

Screenshot 2026-06-09 at 18 44 40

getVercelSharedEnvironmentVariables/...Values read only the first page (~25) of
the shared env endpoint, silently dropping the rest. The shared endpoint
(/v1/env) paginates with a next-cursor the SDK can't follow, so add a raw-fetch
cursor walk (#fetchAllSharedEnvsRaw) that loads every page, via a new
getVercelClientAndToken accessor. Onboarding and pullEnvVarsFromVercel already
decrypt and save the shared values.
@0ski 0ski marked this pull request as ready for review June 9, 2026 17:40
@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4b687f9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 42cee410-9c65-4e24-ad69-97daa8603168

📥 Commits

Reviewing files that changed from the base of the PR and between 84c8396 and 4b687f9.

📒 Files selected for processing (1)
  • apps/webapp/app/models/vercelIntegration.server.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/webapp/app/models/vercelIntegration.server.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: Analyze (javascript-typescript)

Walkthrough

This PR refactors Vercel integration to obtain raw access tokens alongside SDK clients and implements custom HTTP pagination for shared environment variables. A new getVercelClientAndToken helper returns both the Vercel client and access token. The shared env-var listing switches from SDK-based client.environment.listSharedEnvVariable (which has cursor/response limitations) to a raw #fetchAllSharedEnvsRaw helper that paginates through the /v1/env endpoint. Both getVercelSharedEnvironmentVariables and getVercelSharedEnvironmentVariableValues now accept accessToken directly. Callers in pullEnvVarsFromVercel and VercelSettingsPresenter.getOnboardingData are updated to use the new signatures.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete; it only includes issue reference and a screenshot without addressing template sections like Checklist, Testing, or Changelog. Complete the PR description by adding Testing section with test steps, Changelog with change summary, and confirming all checklist items are addressed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: implementing pagination for shared Vercel environment variable fetching in onboarding and pull operations.
Linked Issues check ✅ Passed Code changes directly address #3850 by implementing pagination via new getVercelClientAndToken helper and #fetchAllSharedEnvsRaw to follow pagination.next across multiple pages for shared env-vars.
Out of Scope Changes check ✅ Passed All changes are in-scope: modifications to VercelIntegrationRepository and VercelSettingsPresenter focus solely on pagination implementation and passing accessToken for shared env-var retrieval.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch oskar/fix-vercel-shared-env-var-pagination

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@0ski 0ski enabled auto-merge (squash) June 9, 2026 17:49
coderabbitai[bot]

This comment was marked as resolved.

Parse the raw GET /v1/env page with a zod schema instead of an `as` cast, so a
Vercel payload-shape change fails cleanly at the boundary rather than silently
degrading to empty/partial imports. Addresses a CodeRabbit review comment.
@0ski 0ski merged commit 774a979 into main Jun 9, 2026
36 checks passed
@0ski 0ski deleted the oskar/fix-vercel-shared-env-var-pagination branch June 9, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Vercel integration env var import is capped at ~25 variables (first API page only)

2 participants