Skip to content

refactor: unify tarball resolution and optimize download latency#468

Open
aprendendofelipe wants to merge 1 commit intostackblitz-labs:mainfrom
aprendendofelipe:refactor/tarball-resolver
Open

refactor: unify tarball resolution and optimize download latency#468
aprendendofelipe wants to merge 1 commit intostackblitz-labs:mainfrom
aprendendofelipe:refactor/tarball-resolver

Conversation

@aprendendofelipe
Copy link
Contributor

  • Replace multiple specific endpoints with a global tarball-resolver middleware.
  • Remove 302 redirects.
  • Eliminate routing hacks required to prevent Nitro from hijacking Vue's / and /~/... routes.
  • Improve E2E testability by introducing x-commit-key and x-pkg-name-key headers.
  • Make analytics database writes non-blocking (event.waitUntil).

@aprendendofelipe
Copy link
Contributor Author

Marking as draft. I need to fix a bug when ref is a branch name containing @. I'll check this out later.

@aprendendofelipe
Copy link
Contributor Author

I updated the workflow_run.in_progress.json fixture to use a chaotic branch name (@test/@chaotic.branch/name-@v1.@) to stress-test the resolver. Interestingly, I noticed the current version of the service also fails to parse this payload correctly. This PR fixes that pre-existing bug!

@aprendendofelipe aprendendofelipe marked this pull request as ready for review February 23, 2026 22:37
@Aslemammad
Copy link
Member

Amazing, does this have og:images? something brand friendly? maybe we can work on it in a different PR, which i'd love to see it in pkg.pr.new. also feel free to update the PR and fix the conflicts so it'd be mergable. really appreciate the effort.

but i'll get back to this PR after we make a release for #465 so we make sure no users are hitting issues with it.

@aprendendofelipe
Copy link
Contributor Author

This PR does not deal with SEO concerns, but it is fully compatible with them. For example, we can add an og:image tag to the /~/** pages pointing to something like /api/thumbnail/~/**

@aprendendofelipe
Copy link
Contributor Author

aprendendofelipe commented Feb 25, 2026

I had to remove local R2 persistence because, with PR #470, the SHA used in the tests now changes on every commit.

Regardless of #470, I believe test runs should already be isolated from each other.

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.

2 participants