openvibers/openvibe.news Commits
News's readiness has no fake green (roadmap WS-Q task 7, Shared v1.24.0). sources_pull answered ok ({ pull: 'off' }) when the pull was switched off and had never run, which verified nothing. It now reports skipped with the reason (NEWS_PULL_INTERVAL_MS=0 or NEWS_WORKER=off), never ok; a pull that ran and failed, or is due and has not run, still fails as before. openvibe-shared is pinned at v1.24.0 (from v1.22.0), named in STATUS.json. npm test 16/16.
Changes
@@@ -8,7 +8,7 @@"port": 4820,"domain": "openvibe.news","contracts": "openvibe-contracts v0.49.0",-- "packages": ["openvibe-publishing v0.4.0", "openvibe-contracts v0.49.0", "openvibe-shared v1.22.0", "openvibe-sdk v0.12.0"],++ "packages": ["openvibe-publishing v0.4.0", "openvibe-contracts v0.49.0", "openvibe-shared v1.24.0", "openvibe-sdk v0.12.0"],"capabilities": ["news.story.create","news.story.read",@@@ -18,7 +18,7 @@"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0","openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.4.0","openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.22.0"++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0"},"devDependencies": {"jsonwebtoken": "^9.0.2"@@@ -1058,9 +1058,9 @@}},"node_modules/openvibe-shared": {-- "version": "1.22.0",-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.22.0",-- "integrity": "sha512-FtqbR8h6YphOnJNqklJED3HyqvTwZJl58gyiZ3QgzmZtZcA16O2NMGq67O4p7grLojwaIG5DhXDMgmZcpScxJQ==",++ "version": "1.24.0",++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0",++ "integrity": "sha512-VPzafrc07Pw0oqmXioOlDRtlX5xu82jNLBYkVYxXvhjkILMpWsyjExItIRt5Y6l2st0ozHm7bDQFTJpKEShMEA==","license": "MIT","dependencies": {"jsonwebtoken": "^9.0.0"@@@ -25,7 +25,7 @@"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0","openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.4.0","openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.22.0"++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0"},"devDependencies": {"jsonwebtoken": "^9.0.2"@@@ -13,7 +13,7 @@** Request metrics come from openvibe-shared/metrics in app.js; content counts are not metrics.*/--const { createReadiness } = require('openvibe-shared/ready');++const { createReadiness, skip } = require('openvibe-shared/ready');const { CHARTER_TABLES } = require('./db');function createNewsReadiness({ store, auth, outbox, ingest, config, release = null }) {@@@ -56,7 +56,8 @@ function createNewsReadiness({ store, auth, outbox, ingest, config, release = nucheck: () => {const last = ingest.lastPull();const off = !config.sources.pullIntervalMs || !config.worker.enabled;-- if (!last) return off ? { ok: true, detail: { pull: 'off' } } : 'no pull from OpenVibe.Sources has run yet';++ // Pull switched off and never run: nothing verified, so skipped, never ok (WS-Q task 7).++ if (!last) return off ? skip('pull off (NEWS_PULL_INTERVAL_MS=0 or NEWS_WORKER=off)', { pull: 'off' }) : 'no pull from OpenVibe.Sources has run yet';if (last.state !== 'ok') return `last pull failed (${last.error_code}): ${last.detail}`;return { ok: true, detail: { cursor: last.cursor_after, at: new Date(last.at).toISOString() } };},
@@ -8,7 +8,7 @@
@@ -8,7 +8,7 @@
"port": 4820,
"port": 4820,
"domain": "openvibe.news",
"domain": "openvibe.news",
"contracts": "openvibe-contracts v0.49.0",
"contracts": "openvibe-contracts v0.49.0",
- "packages": ["openvibe-publishing v0.4.0", "openvibe-contracts v0.49.0", "openvibe-shared v1.22.0", "openvibe-sdk v0.12.0"],
+ "packages": ["openvibe-publishing v0.4.0", "openvibe-contracts v0.49.0", "openvibe-shared v1.24.0", "openvibe-sdk v0.12.0"],
"capabilities": [
"capabilities": [
"news.story.create",
"news.story.create",
"news.story.read",
"news.story.read",
@@ -18,7 +18,7 @@
@@ -18,7 +18,7 @@
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.4.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.4.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.22.0"
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0"
},
},
"devDependencies": {
"devDependencies": {
"jsonwebtoken": "^9.0.2"
"jsonwebtoken": "^9.0.2"
@@ -1058,9 +1058,9 @@
@@ -1058,9 +1058,9 @@
}
}
},
},
"node_modules/openvibe-shared": {
"node_modules/openvibe-shared": {
- "version": "1.22.0",
- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.22.0",
- "integrity": "sha512-FtqbR8h6YphOnJNqklJED3HyqvTwZJl58gyiZ3QgzmZtZcA16O2NMGq67O4p7grLojwaIG5DhXDMgmZcpScxJQ==",
+ "version": "1.24.0",
+ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0",
+ "integrity": "sha512-VPzafrc07Pw0oqmXioOlDRtlX5xu82jNLBYkVYxXvhjkILMpWsyjExItIRt5Y6l2st0ozHm7bDQFTJpKEShMEA==",
"license": "MIT",
"license": "MIT",
"dependencies": {
"dependencies": {
"jsonwebtoken": "^9.0.0"
"jsonwebtoken": "^9.0.0"
@@ -25,7 +25,7 @@
@@ -25,7 +25,7 @@
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.49.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.4.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.4.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.12.0",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.22.0"
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.24.0"
},
},
"devDependencies": {
"devDependencies": {
"jsonwebtoken": "^9.0.2"
"jsonwebtoken": "^9.0.2"
@@ -13,7 +13,7 @@
@@ -13,7 +13,7 @@
*
*
* Request metrics come from openvibe-shared/metrics in app.js; content counts are not metrics.
* Request metrics come from openvibe-shared/metrics in app.js; content counts are not metrics.
*/
*/
-const { createReadiness } = require('openvibe-shared/ready');
+const { createReadiness, skip } = require('openvibe-shared/ready');
const { CHARTER_TABLES } = require('./db');
const { CHARTER_TABLES } = require('./db');
function createNewsReadiness({ store, auth, outbox, ingest, config, release = null }) {
function createNewsReadiness({ store, auth, outbox, ingest, config, release = null }) {
@@ -56,7 +56,8 @@ function createNewsReadiness({ store, auth, outbox, ingest, config, release = nu
@@ -56,7 +56,8 @@ function createNewsReadiness({ store, auth, outbox, ingest, config, release = nu
check: () => {
check: () => {
const last = ingest.lastPull();
const last = ingest.lastPull();
const off = !config.sources.pullIntervalMs || !config.worker.enabled;
const off = !config.sources.pullIntervalMs || !config.worker.enabled;
- if (!last) return off ? { ok: true, detail: { pull: 'off' } } : 'no pull from OpenVibe.Sources has run yet';
+ // Pull switched off and never run: nothing verified, so skipped, never ok (WS-Q task 7).
+ if (!last) return off ? skip('pull off (NEWS_PULL_INTERVAL_MS=0 or NEWS_WORKER=off)', { pull: 'off' }) : 'no pull from OpenVibe.Sources has run yet';
if (last.state !== 'ok') return `last pull failed (${last.error_code}): ${last.detail}`;
if (last.state !== 'ok') return `last pull failed (${last.error_code}): ${last.detail}`;
return { ok: true, detail: { cursor: last.cursor_after, at: new Date(last.at).toISOString() } };
return { ok: true, detail: { cursor: last.cursor_after, at: new Date(last.at).toISOString() } };
},
},