skohub-io / skohub-vocabs

A lightweight tool to publish SKOS Vocabularies
https://skohub.io/
Apache License 2.0
36 stars 25 forks source link

I18n #102

Closed literarymachine closed 3 years ago

literarymachine commented 4 years ago

Fixes #79

acka47 commented 4 years ago

@dr0i please deploy on test.

dr0i commented 4 years ago

Deployed to test.

dr0i commented 4 years ago

Note to self:

  1. npm test fails because the port from .env is used (which is the same port used for the productive service running there). So change that .env-port temporarily for the sake of test.

  2. npm test did fail with:

✕ Should process a correct hook and create the files for a build (40030ms) ... ● processWebhooks › Should process a correct hook and create the files for a build expect(received).toBe(expected) // Object.is equality Expected: 0 Received: 1 111 | const dataDirContent = (await fs.readdir('data')) 112 | .filter(filename => filename !== '.gitignore') 113 | expect(dataDirContent.length).toBe(0)

Then I removed all files in test/data and did git checkout -- test/data/ and then npm test did succeed. I compared the test/data before and after the removing of the files there - but there was no difference. Weird.

dr0i commented 4 years ago

I am not "that fluent" in javascript to say the least, so I cannot review properly. But let me ask some conceptual question: it's not needed to trigger the gatsby build with npm run build when w have the webhook running, right? Because the latter would trigger the build of the vocabularies and expose these, right? (if that`s true I would note this in the README).

dr0i commented 4 years ago

Re "super strange weird test/data": just read the README to do a "rm -rf .cache after changes in data/ which may also be true for test/data/ and which would explain the weirdness.

dr0i commented 3 years ago

Redeployed. Note that, although the daemon comes up, an error message appeared in the logs:

npm ERR! code ELIFECYCLE

This error vanished when doing echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches. It seems similar too https://github.com/skohub-io/skohub-vocabs/issues/104 . Although I am not aware of the effects of this npm ERR I will add the fixes as hints into the README. Opened https://github.com/skohub-io/skohub-vocabs/issues/112 for this.

acka47 commented 3 years ago

Redeployed. Note that, although the daemon comes up, an error message appeared in the logs:

npm ERR! code ELIFECYCLE

I think this is the same error as in https://github.com/skohub-io/skohub-vocabs/issues/79#issuecomment-738652600

dr0i commented 3 years ago

Correction: although a tail -f logs/skohub-vocabs.log didn't reveal the mentioned npm ERR a cat on the log shows that it's still there, so the "fix" using max_user_watches didn't help. Also npm cache clean --force; rm -rf node_modules package-lock.json didn't help. As the daemon (that's the webhookserver) shows up we might ignore this. But there are other problems showing in the log, which I only experience on test:

UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/home/lod/git/skohub-vocabs/src/../public/' at Object.statSync (fs.js:932:3) at Object.statSync (/home/lod/git/skohub-vocabs/node_modules/graceful-fs/polyfills.js:307:34)

The public directory indeed does not exist, but then it also doesn't exist on production. It should be created when npm run build is done to Run the static site generator, but that's not done in scripts/start.sh. I am a bit in the dark here maybe you can brighten this up a bit @literarymachine ?

acka47 commented 3 years ago

The current status is that it says the build is triggered but the build page is empty, see https://test.skohub.io/build/?id=93625061-84f5-4182-8f8a-677209bcce4e

grafik

dr0i commented 3 years ago

I think this is the same error as in #79 (comment)

no, this ERR is showing always up when starting via the start script:

npm ERR! code ELIFECYCLE npm ERR! errno 143 npm ERR! gatsby-starter-default@0.1.0 listen: node src/webHookServer.js npm ERR! Exit status 143 npm ERR!· npm ERR! Failed at the gatsby-starter-default@0.1.0 listen script.

I wil at least note this at the server to not forget to just ignore this.

acka47 commented 3 years ago

@dr0i, please redeploy to test once again.

dr0i commented 3 years ago

Redeployed.

acka47 commented 3 years ago

Looks good now from a functional perspective. Please add code review and deploy to production.

dr0i commented 3 years ago

I am not "that fluent" in javascript to say the least, so I cannot review properly.

If this is ok, though, I can deploy it anyway.

acka47 commented 3 years ago

@fsteeg, do you want to take a look? Otherwise I am ok with deploying it directly.

acka47 commented 3 years ago

Please deploy, then, @dr0i .

dr0i commented 3 years ago

Deployed to production, closed.