Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn data:update unusable on dev mode #1460

Open
rtorrente opened this issue Jan 4, 2025 · 4 comments
Open

yarn data:update unusable on dev mode #1460

rtorrente opened this issue Jan 4, 2025 · 4 comments

Comments

@rtorrente
Copy link
Contributor

Hey,

Command GITHUB_TOKEN=* yarn data:update does not work because it need a vercel token.
This blocks testing while a library is being added, forcing you to commit blindly without being able to test the result on the display.
I think doc is outdated in Readme and a vercel function was added since

GITHUB_TOKEN=TOKEN yarn data:update
⬇️️ Fetching latest data blob from the store
file:///home/USER/project/node_modules/@vercel/blob/dist/chunk-KN6WT5GP.js:68
  throw new BlobError(
        ^

BlobError: Vercel Blob: No token found. Either configure the `BLOB_READ_WRITE_TOKEN` environment variable, or pass a `token` option to your calls.
    at getTokenFromOptionsOrEnv
@Simek
Copy link
Member

Simek commented Jan 4, 2025

Hey @rtorrente, thanks for the report! Blob store is quite recent addition to address npm API stability, and indeed, for external contributors it might be a bit cumbersome, since you need to have an access to our Vercel org to be able to generate that token.

A separate thing is that yarn data:update is tailored more for feature development and data/schema changes testing, than validating new data entries. For this we have ci:validate command, which is also run via GitHub actions, when someone pushes a PR, and scripts have an access to need secrets.

But definitely, we should just fall back, and skip fill-out data, when token is not present, instead of throwing.

@rtorrente
Copy link
Contributor Author

Hey @Simek,

Thanks for the feedback.
You say that yarn data:update is not used to validate new entries but in that case I wonder if I've missed some information. If I want to add a lib, locally I can't test the rendering of automatic calculations on libs added (support newArch, unmaintained, etc) without waiting to see my PR merged and deployed.
This contradicts the fact that the documentation recommends that certain fields only be used if the automatic calculation is not correct.

@Simek
Copy link
Member

Simek commented Jan 4, 2025

You also won't be able to test new entries in that much detail on the PR unless deployment label is added manually, since we only deploy website on schedule, every 2 hours, due to API limits that are enforced on us via GitHub and NPM. We don't even deploy when your PR lands on main.

So in you case, indeed, the yarn data:update would be correct to run, but I would recommend using with package name, so to run only on added/updated entry, and not for all 16k+ entries, which bare yarn data:update will do.

I will create a PR fixing the blob access soon, and make the fallback to older data an optional (not required) part of the flow.

@rtorrente
Copy link
Contributor Author

Oh nice, I didn't know it was possible to run calculations only for specific packages !
I think it might be relevant to update the Readme by mentioning how yarn data:update works in the case of a test after a library has been added and before commit.

I believe that the majority of PRs are currently performed blind. Which isn't a good thing, because the directory is supposed to be a source of truth.

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

No branches or pull requests

2 participants