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

Switch to the new backend #88

Closed
cmoulliard opened this issue May 21, 2024 · 3 comments
Closed

Switch to the new backend #88

cmoulliard opened this issue May 21, 2024 · 3 comments

Comments

@cmoulliard
Copy link
Collaborator

TODO

Switch to the new backend to be aligned with recent versions of backstage and to be also aligned with janus-idp which is using it too

cmoulliard added a commit to ch007m/backstage-playground that referenced this issue May 21, 2024
@cmoulliard
Copy link
Collaborator Author

There is a module not_found error when we launch yarn dev which is coming from argocd backendmodule. To be investigated

[1] node:internal/modules/cjs/loader:1144
[1]   const err = new Error(message);
[1]               ^
[1] 
[1] Error: Cannot find module 'ent'
[1] Require stack:
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/nodejs-common/util.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/nodejs-common/service.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/nodejs-common/index.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/index.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@backstage/backend-app-api/node_modules/@backstage/backend-common/dist/index.cjs.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@backstage/backend-app-api/dist/index.cjs.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@backstage/backend-common/dist/index.cjs.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/dist/index.cjs.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-common/dist/index.cjs.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/dist/index.cjs.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/scaffolder-backend-argocd/dist/index.cjs.js
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/packages/backend/src/plugins/argocd-actions/plugin.ts
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/packages/backend/src/plugins/argocd-actions/index.ts
[1] - /Users/cmoullia/code/openshift/fork-backstage-playground/packages/backend/src/index.ts
[1]     at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
[1]     at Module._load (node:internal/modules/cjs/loader:985:27)
[1]     at Module.require (node:internal/modules/cjs/loader:1235:19)
[1]     at require (node:internal/modules/helpers:176:18)
[1]     at Object.<anonymous> (/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/nodejs-common/util.js:49:26)
[1]     at Module._compile (node:internal/modules/cjs/loader:1376:14)
[1]     at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
[1]     at Object.newLoader [as .js] (/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/pirates/lib/index.js:121:7)
[1]     at Module.load (node:internal/modules/cjs/loader:1207:32)
[1]     at Module._load (node:internal/modules/cjs/loader:1023:12)
[1]     at Module.require (node:internal/modules/cjs/loader:1235:19)
[1]     at require (node:internal/modules/helpers:176:18)
[1]     at Object.<anonymous> (/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/nodejs-common/service.js:28:19)
[1]     at Module._compile (node:internal/modules/cjs/loader:1376:14)
[1]     at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
[1]     at Object.newLoader [as .js] (/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/pirates/lib/index.js:121:7) {
[1]   code: 'MODULE_NOT_FOUND',
[1]   requireStack: [
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/nodejs-common/util.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/nodejs-common/service.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/nodejs-common/index.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@google-cloud/storage/build/cjs/src/index.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@backstage/backend-app-api/node_modules/@backstage/backend-common/dist/index.cjs.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@backstage/backend-app-api/dist/index.cjs.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/node_modules/@backstage/backend-common/dist/index.cjs.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-app-api/dist/index.cjs.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/node_modules/@backstage/backend-common/dist/index.cjs.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/backstage-plugin-argo-cd-backend/dist/index.cjs.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/node_modules/@roadiehq/scaffolder-backend-argocd/dist/index.cjs.js',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/packages/backend/src/plugins/argocd-actions/plugin.ts',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/packages/backend/src/plugins/argocd-actions/index.ts',
[1]     '/Users/cmoullia/code/openshift/fork-backstage-playground/packages/backend/src/index.ts'
[1]   ]
[1] }
[1] 
[1] Node.js v20.11.0
[0] webpack compiled successfully

@cmoulliard
Copy link
Collaborator Author

When the following module is added, yarn reports a violation error fixed using more recent versions

yarn add @backstage/plugin-permission-backend-module-allow-all-policy
error Invariant Violation: expected workspace package to exist for "make-fetch-happen"
    at invariant (/Users/cmoullia/.cache/node/corepack/yarn/1.22.21/lib/cli.js:2318:15)
    at _loop2 (/Users/cmoullia/.cache/node/corepack/yarn/1.22.21/lib/cli.js:91024:9)
    at PackageHoister.init (/Users/cmoullia/.cache/node/corepack/yarn/1.22.21/lib/cli.js:91083:19)
    at PackageLinker.getFlatHoistedTree (/Users/cmoullia/.cache/node/corepack/yarn/1.22.21/lib/cli.js:48552:20)
    at PackageLinker.<anonymous> (/Users/cmoullia/.cache/node/corepack/yarn/1.22.21/lib/cli.js:48563:27)
    at Generator.next (<anonymous>)
    at step (/Users/cmoullia/.cache/node/corepack/yarn/1.22.21/lib/cli.js:310:30)
    at /Users/cmoullia/.cache/node/corepack/yarn/1.22.21/lib/cli.js:328:14
    at new Promise (<anonymous>)
    at new F (/Users/cmoullia/.cache/node/corepack/yarn/1.22.21/lib/cli.js:5540:28)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

cmoulliard added a commit to ch007m/backstage-playground that referenced this issue May 21, 2024
…to a more recent version of yarn, add signin page which is needed to use guest auth provider

Signed-off-by: cmoulliard <[email protected]>
cmoulliard added a commit that referenced this issue May 22, 2024
* WIP. Refactor the backend to use the new backend system. #88

Signed-off-by: cmoulliard <[email protected]>

* The following property "private" has been remeoved by yarn 4.x. from phe plugins package.json

Signed-off-by: cmoulliard <[email protected]>

* Fix issue reported within #88 such as violation error. Switch to a more recent version of yarn, add signin page which is needed to use guest auth provider

Signed-off-by: cmoulliard <[email protected]>

* Enable corepack to allow to use yarn >= 1.x

Signed-off-by: cmoulliard <[email protected]>

* Enable corepack to allow to use yarn >= 1.x within build-k8s-image job too

Signed-off-by: cmoulliard <[email protected]>

* Use the command corepack enable before to install the packages

Signed-off-by: cmoulliard <[email protected]>

* Move corepack enable task to the correct place

Signed-off-by: cmoulliard <[email protected]>

* Use corepack prepare yarn@stable --activate to set the proper package manager as we still got job errors

Signed-off-by: cmoulliard <[email protected]>

* Try to use the hack documented here: actions/setup-node#899

Signed-off-by: cmoulliard <[email protected]>

* Add missing yarn.lock file

Signed-off-by: cmoulliard <[email protected]>

* Use --immutable-cache as --prefer-offline --frozen-lockfile are deprecated

Signed-off-by: cmoulliard <[email protected]>

* Replace --immutable-cache with --immutable

Signed-off-by: cmoulliard <[email protected]>

---------

Signed-off-by: cmoulliard <[email protected]>
@cmoulliard
Copy link
Collaborator Author

Done with PR #94

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

1 participant