bazel-contrib / bcr-ui

Website for the Bazel Central Registry
https://registry.bazel.build
Apache License 2.0
14 stars 9 forks source link

missing `yanked_versions` field in metadata.json caused a TypeError #134

Closed xiemotongye closed 6 months ago

xiemotongye commented 6 months ago

https://registry.bazel.build/ stop updating after this commit: https://github.com/bazelbuild/bazel-central-registry/commit/83a300d2a31e467ed435da51e53013b8bd6b3730

This commit doesn't contain yanked_versions field in modules/debian_dependency_bazelizer/metadata.json. This will cause a TypeError while running npm run build:

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at /xxx/bcr-ui/.next/server/chunks/361.js:102:30
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async getStaticPropsModulePage (/xxx/bcr-ui/.next/server/chunks/361.js:98:26)
    at async getStaticProps (/xxx/bcr-ui/.next/server/chunks/361.js:491:12)
    at async renderToHTML (/xxx/bcr-ui/node_modules/next/dist/server/render.js:492:20)
    at async /xxx/bcr-ui/node_modules/next/dist/export/worker.js:253:36
    at async Span.traceAsyncFn (/xxx/bcr-ui/node_modules/next/dist/trace/trace.js:79:20)
xiemotongye commented 6 months ago

relating to https://github.com/bazelbuild/bazel-central-registry/issues/1254

xiemotongye commented 6 months ago

I've fixed this issue in bcr. https://github.com/bazelbuild/bazel-central-registry/pull/1255

So maybe this issue could be closed. In order to prevent similar problems from recurring, I think maybe BCR should improve the metadata validation.

Wyverald commented 6 months ago

We seem to be hitting this again with rules_perl: https://github.com/bazel-contrib/bcr-ui/actions/runs/7616018990/job/20741852278#step:8:134