Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKPORT 2024.1][PLAT-13690] Fix openapi bundle failure due to redoc…
…ly dependency on openapi-sampler Summary: Original commit: 1333618 / D34498 https://yugabyte.slack.com/archives/C048Z7EDH0F/p1713971854833549 Backporting as the same issue is seen 2024.1 builds too https://jenkins.dev.yugabyte.com/job/github-yugabyte-db-alma8-master-clang17-release/512 The jenkins builds started failing with an error: ``` [2024-04-24T14:52:24.048Z] /share/jenkins/workspace/github-yugabyte-db-alma8-master-clang17-release/yugabyte-db/managed/src/main/resources/openapi /share/jenkins/workspace/github-yugabyte-db-alma8-master-clang17-release/yugabyte-db/managed/scripts [2024-04-24T14:52:24.048Z] Running bundle on openapi spec ... [2024-04-24T14:52:24.048Z] npx: installed 197 in 12.668s [2024-04-24T14:52:24.048Z] Unexpected token '?' [2024-04-24T14:52:24.048Z] cp: cannot stat 'tmp/openapi_bundle.yaml': No such file or directory ``` Could reproduce locally after switching to `nvm use v12.22.12`: ``` [sneelakantan@dev-server-sneelakantan ~]$ redocly /nfusr/dev-server/sneelakantan/.nvm/versions/node/v12.22.12/lib/node_modules/openapi-sampler/dist/openapi-sampler.js:791 pattern = ((_pattern$match = pattern.match(/\/(.+?)\//)) === null || _pattern$match === void 0 ? void 0 : _pattern$match[1]) ?? ''; // Remove frontslash from front and back of RegExp ^ SyntaxError: Unexpected token '?' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at /nfusr/dev-server/sneelakantan/.nvm/versions/node/v12.22.12/lib/node_modules/@redocly/cli/node_modules/redoc/bundles/redoc.lib.js:41:72746 at /nfusr/dev-server/sneelakantan/.nvm/versions/node/v12.22.12/lib/node_modules/@redocly/cli/node_modules/redoc/bundles/redoc.lib.js:1807:3444 at /nfusr/dev-server/sneelakantan/.nvm/versions/node/v12.22.12/lib/node_modules/@redocly/cli/node_modules/redoc/bundles/redoc.lib.js:1807:3449 ``` Figured out a recent change in [email protected] (dependency of redocly/cli) that is causing above error (Redocly/openapi-sampler#153). So forcing to use the older version of [email protected] here to workaround this build error. Test Plan: Ran build locally. Will monitor jenkins phab pipeline. Reviewers: skurapati, rmadhavan, steve.varnau, dshubin, vkumar Reviewed By: skurapati, vkumar Subscribers: yugaware, dshubin Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D34524
- Loading branch information