bazel-contrib / bcr-ui

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

missing `maintainers` field in metadata.json caused a TypeError #77

Closed xiemotongye closed 1 year ago

xiemotongye commented 1 year ago

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

The commit above does not contain maintainers field in modules/libdeflate/metadata.json. This will cause a TypeError while running npm run build:

TypeError: Cannot read properties of undefined (reading 'map')
    at ModulePage (/xxx/bcr-ui/.next/server/chunks/361.js:461:92)
    at Wc (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
    at Zc (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
    at Z (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
    at Zc (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
    at Z (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
    at Zc (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
    at Z (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
    at $c (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
    at bd (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
[    ] info  - Generating static pages (732/840)TypeError: Cannot read properties of undefined (reading 'map')
    at ModulePage (/xxx/bcr-ui/.next/server/chunks/361.js:461:92)
    at Wc (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
    at Zc (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253)
    at Z (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
    at Zc (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
    at Z (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
    at Zc (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:481)
    at Z (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
    at $c (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98)
    at bd (/xxx/bcr-ui/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404)
hobofan commented 1 year ago

This feels like an issue on the BCR side, where the presence of that field should be enforced. Other modules without a maintainer have the key with an empty array as maintainers.

Apart from that, I personally think that it's also a failure of enforcing registry policy to allow new modules without a maintainer.

hobofan commented 1 year ago

Closing this, as the immediate issue is resolved. Will probably open up some issues soon here and/or in the BCR repo to improve the metadata validation situation.