ome / omero-figure

An OMERO.web app for creating Figures from images in OMERO
http://figure.openmicroscopy.org
GNU Affero General Public License v3.0
15 stars 31 forks source link

Scheduled workflow failed with `grunt build` error #432

Closed sbesson closed 3 years ago

sbesson commented 3 years ago

From https://github.com/ome/omero-figure/actions/runs/803231848

 grunt jst
/usr/lib/node_modules/grunt/node_modules/micromatch/index.js:44
    let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
                                                   ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/grunt/node_modules/liftup/node_modules/findup-sync/index.js:12:10)

Quickly looking at the diff with the last successful build, the issue seems to be related to the grunt@1.3.0 -> grunt@1.4.0 bump

will-moore commented 3 years ago

https://github.com/gruntjs/grunt/blob/main/CHANGELOG just says:

v1.4.0
  date: 2021-04-21
  changes:
    - Security fixes in production and dev dependencies

which doesn't give much to go on...

sbesson commented 3 years ago

From https://github.com/gruntjs/grunt/compare/v1.3.0...v1.4.0 it looks like the primary changes are in the dependencies

will-moore commented 3 years ago

When you say "Quickly looking at the diff with the last successful build..." where is that diff? How can I look at it? To me it looks like Job 88 (Green) and Job 94 Red are linked to the same commit: e0f19d8c38ae3cfc9248f632df285fd4e0b6f2cb ?

sbesson commented 3 years ago

To me it looks like Job 88 (Green) and Job 94 Red are linked to the same commit: e0f19d8 ?

Exactly, so the issue is not with a change in the code itself but rather an unpinned underlying dependency which changes in between the two workflow runs against the same commit. Try looking at the logs for the workflows i.e. 2371902047 vs 2430343361

will-moore commented 3 years ago

Well, at least https://github.com/ome/omero-figure/pull/430/commits/e866aeeedf37a0538e629634eaf528b99581b89f confirms that pinning to grunt@1.3.0 fixes the build.

I was trying to reproduce locally, but not sure how to start with a clean environment to replicate all the version numbers. Doing this to match versions on the failed logs above:

npm install grunt@1.4.0
npm install grunt-cli@1.4.2

and updating other libs (needed --force)

npm update --force

Resulted in:

$ grunt --version
grunt-cli v1.3.2
grunt v1.4.0

and no failure with $ grunt jst.

sbesson commented 3 years ago

The only other thing I can think of would be that the NodeJS version is too old and would need to be incremented https://github.com/ome/omero-figure/blob/e0f19d8c38ae3cfc9248f632df285fd4e0b6f2cb/.omeroci/app-deps#L5

will-moore commented 3 years ago

I can't even work out how to increment that version. Where does that URL even come from?

Looking at https://github.com/nodesource/distributions#installation-instructions-1 I see different install instructions like:

curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -

Does that do the same thing?

sbesson commented 3 years ago

From the history, this URL was introduced in https://github.com/ome/omero-figure/pull/259 so I'll leave @jburel to comment. I would assume using the official installation instructions should be the way forward although it remains to be tested.

will-moore commented 3 years ago

Updated a few things and https://github.com/ome/omero-figure/pull/430/commits/09cddd8f31ac7eac2525c04322e7fead4384f5d4 is now Green 🥳

sbesson commented 3 years ago

Awesome @will-moore!! Could the infrastructure commits be backported into a standalone PR so that we do not tie their integration to a feature PR?