@andrian.yablonskyy/thub-coordinator 1.0.30 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrian.yablonskyy/thub-coordinator",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "TestHub Coordinator — job queue, resource registry, scheduler, heartbeat monitor, log/artifact store and web dashboard",
5
5
  "main": "src/server.js",
6
6
  "engines": {
@@ -19,7 +19,7 @@
19
19
  "lint:fix": "eslint . --fix"
20
20
  },
21
21
  "dependencies": {
22
- "@andrian.yablonskyy/thub-common": "*",
22
+ "@andrian.yablonskyy/thub-common": "^1.0.26",
23
23
  "better-sqlite3": "^12.4.1",
24
24
  "express": "^5.1.0",
25
25
  "express-session": "^1.18.2",
package/src/server.js CHANGED
@@ -90,6 +90,14 @@ function buildServices(config){
90
90
  };
91
91
  }
92
92
 
93
+ function commonPath(){
94
+ return path.dirname(require.resolve('@andrian.yablonskyy/thub-common/package.json'));
95
+ }
96
+
97
+ function commonVersion(){
98
+ return require('@andrian.yablonskyy/thub-common/package.json').version;
99
+ }
100
+
93
101
  function createApp(config, services){
94
102
  const app = express();
95
103
  app.set('view engine', 'pug');
@@ -98,6 +106,10 @@ function createApp(config, services){
98
106
  app.locals.services = services;
99
107
  // Shown in every dashboard page's footer (layout.pug).
100
108
  app.locals.coordinatorVersion = require('../package.json').version;
109
+ // The thub-common this process actually loaded (it validates job specs):
110
+ // installs keep the one they got, so it can lag behind — shown on the
111
+ // dashboard and logged at startup to make that visible.
112
+ app.locals.commonVersion = commonVersion();
101
113
 
102
114
  app.use(express.json({ limit: '2mb' }));
103
115
  app.use(express.urlencoded({ extended: true }));
@@ -162,6 +174,7 @@ function start(configPath){
162
174
  const server = app.listen(config.port, config.host, () => {
163
175
  console.log(`Config: ${config.configPath || '(built-in defaults)'}; data: ${config.dataDir}`);
164
176
  console.log(`TestHub Coordinator listening on http://${config.host}:${config.port}`);
177
+ console.log(`Coordinator v${require('../package.json').version}, thub-common v${commonVersion()} (${commonPath()})`);
165
178
  });
166
179
 
167
180
  return { app, server, services, config };
@@ -14,7 +14,11 @@
14
14
  'use strict';
15
15
 
16
16
  const { validateJobSpec, JOB_STATES, ACTIVE_JOB_STATES, TERMINAL_JOB_STATES, RESOURCE_STATES } = require('@andrian.yablonskyy/thub-common'),
17
- { paginate } = require('./list-prefs');
17
+ { paginate } = require('./list-prefs'),
18
+ // Named in spec errors: a field the Agent sends but this thub-common
19
+ // doesn't know means the Coordinator needs an update.
20
+ VERSIONS = `Coordinator v${require('../../package.json').version}, ` +
21
+ `thub-common v${require('@andrian.yablonskyy/thub-common/package.json').version}`;
18
22
 
19
23
  function rowToJob(row){
20
24
  if (!row){
@@ -131,7 +135,7 @@ function createJobsService(db, { bus, events, registry, artifacts, config }){
131
135
  rawSpec?.priority === undefined ? { ...rawSpec, priority: DEFAULT_PRIORITY[source] } : rawSpec
132
136
  );
133
137
  if (!valid){
134
- throw Object.assign(new Error(`Invalid job spec: ${errors.join('; ')}`), { status: 400 });
138
+ throw Object.assign(new Error(`Invalid job spec (${VERSIONS}): ${errors.join('; ')}`), { status: 400 });
135
139
  }
136
140
  spec.source = source;
137
141
 
package/views/layout.pug CHANGED
@@ -12,7 +12,12 @@ html(lang="en" data-bs-theme=(user && user.theme) || "auto")
12
12
  .container-fluid
13
13
  a.navbar-brand.d-flex.flex-column.lh-1.py-1(href="/")
14
14
  span TestHub
15
- small.text-body-secondary.fw-normal.mt-1(style="font-size: .7rem;")
15
+ small.text-body-secondary.fw-normal.mt-1(
16
+ style="font-size: .7rem;"
17
+ data-bs-toggle="tooltip"
18
+ data-bs-placement="bottom"
19
+ data-bs-title=`Coordinator v${coordinatorVersion} · thub-common v${commonVersion} (validates job specs)`
20
+ )
16
21
  | ver. #{coordinatorVersion}
17
22
  if user && user.role !== 'admin' && updates.coordinatorUpdate
18
23
  span.badge.text-bg-warning.ms-1(