johanneswuerbach / backstage-plugin-techdocs-addon-mermaid

Backstage TechDocs Mermaid Addon
MIT License
43 stars 18 forks source link

Warning in CI pipeline #12

Closed axdotl closed 1 year ago

axdotl commented 1 year ago

After adding the Addon to a Backstage App the build contain warnings. As warning are treated as error by default on CI, the build breaks.

webpack compiled with 2 warnings
WARNING in ../../node_modules/mermaid/dist/mermaid.core.mjs 27645:52-67
Critical dependency: the request of a dependency is an expression

WARNING in ../../node_modules/mermaid/dist/mermaid.core.mjs 27659:52-63
Critical dependency: the request of a dependency is an expression

Did you manage to solve these warning? Because using CI=false yarn build in the pipeline feels a bit odd.

johanneswuerbach commented 1 year ago

Hey, sorry for the late reply. Which backstage version are you using? I tested with 1.8.2 and don't see any warnings 🤔

axdotl commented 1 year ago

When raising this issue I was on 1.7.0, but also after upgrade to 1.8.2 the issue still exists.

Are there any further information I could provide?

johanneswuerbach commented 1 year ago

Maybe the node and yarn version? As said I don’t see this when doing a yarn build 🤔ls there anything specific required to enable yarn treating warnings as errors?

axdotl commented 1 year ago

I'm using following version:

To reproduce the CI system behavior, you can try following command:

CI=true yarn build
johanneswuerbach commented 1 year ago

In a newly generated backstage app, I don't see a build command 🤔

% CI=true yarn build
yarn run v1.22.15
error Command "build" not found.

My package.json scripts` sections looks like:

"scripts": {
    "dev": "concurrently \"yarn start\" \"yarn start-backend\"",
    "start": "yarn workspace app start",
    "start-backend": "yarn workspace backend start",
    "build:backend": "yarn workspace backend build",
    "build:all": "backstage-cli repo build --all",
    "build-image": "yarn workspace backend build-image",
    "tsc": "tsc",
    "tsc:full": "tsc --skipLibCheck false --incremental false",
    "clean": "backstage-cli repo clean",
    "test": "backstage-cli repo test",
    "test:all": "backstage-cli repo test --coverage",
    "lint": "backstage-cli repo lint --since origin/master",
    "lint:all": "backstage-cli repo lint",
    "prettier:check": "prettier --check .",
    "create-plugin": "backstage-cli create-plugin --scope internal",
    "new": "backstage-cli new --scope internal"
  },
axdotl commented 1 year ago

Yes, the scripts changed with the upgrade from 1.7.0 to 1.8.2 (see Upgrade Helper). Actually build was renamed to build:all but executes the same. So you could try

CI=true yarn build:all
johanneswuerbach commented 1 year ago

Looks like this was a bug in an old mermaid version and is already resolved 🎉 https://github.com/mermaid-js/mermaid/issues/3781

I'll bump the required version here, but you should be already able to update it yourself :-)

axdotl commented 1 year ago

Great - so there will be a new release? If so, can you please also upgrade the backstage dependencies to most recent versions?

johanneswuerbach commented 1 year ago

I'll have a look, but there are some issues with react-router-dom. Could you open a new issue for that?

Published the mermaid bump as backstage-plugin-techdocs-addon-mermaid@0.3.2

axdotl commented 1 year ago

Thanks a lot! Will do.

axdotl commented 1 year ago

Sorry if I'm nitpicking, but would you mind to add a git tag for release 0.3.2?

johanneswuerbach commented 1 year ago

Totally, actually just missed the push.