Skip to content

Commit d197306

Browse files
committed
Merge remote-tracking branch 'origin/sync-02092026'
2 parents f3d2278 + 660d807 commit d197306

File tree

205 files changed

+601
-1101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+601
-1101
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
84de82b25fff81f7b28c1a83789d1a9247fa73b4
55
f66b9d9a77db9dfae1d1fe7b764b0a850883df60
66
e892d2934b7048b610e4c879fd9b1a523b0004f7
7+
4e2e8b7980a31086a35c71de8fc8c305393ff771

.oxlintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"categories": {},
55
"rules": {
66
"no-undef": "error",
7+
"no-unused-vars": "error",
78
"no-console": "off",
89
"no-constant-condition": "off",
910
"prefer-const": "off",

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ These are the steps @Ethan-Arrowood has been following to synchronize the reposi
8181
8282
### Last Synchronized Commit
8383
84-
`916492e0bd147b79fd11d3b7bc41902999d64c2b`
84+
`e69e4b9c0c1c94576d306965c511e9c99efbf00c`
8585
8686
## Code of Conduct
8787

bin/copyDb.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export async function compactOnStart() {
8787

8888
updateConfigValue(CONFIG_PARAMS.STORAGE_COMPACTONSTART, false);
8989

90-
for (const [db, { dbPath, backupDest }] of compactedDb) {
90+
for (const [_db, { dbPath, backupDest }] of compactedDb) {
9191
console.error('Moving backup database', backupDest, 'back to', dbPath);
9292
try {
9393
await move(backupDest, dbPath, { overwrite: true });
@@ -258,7 +258,7 @@ export async function copyDb(sourceDatabase: string, targetDatabasePath: string)
258258
'bytes'
259259
);
260260
return;
261-
} catch (error) {
261+
} catch {
262262
// try to resume with a bigger key
263263
if (typeof start === 'string') {
264264
if (start === 'z') {

bin/restart.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const { restartWorkers, onMessageByType, shutdownWorkersNow } = require('../serv
1010
const { handleHDBError, hdbErrors } = require('../utility/errors/hdbError.js');
1111
const { HTTP_STATUS_CODES } = hdbErrors;
1212
const envMgr = require('../utility/environment/environmentManager.js');
13-
const { server } = require('../server/Server.ts');
1413
const path = require('node:path');
1514
const { unlinkSync } = require('node:fs');
1615
envMgr.initSync();

components/Application.ts

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export async function installApplication(application: Application) {
249249
// If custom install command is specified, run it
250250
if (application.install?.command) {
251251
const [command, ...args] = application.install.command.split(' ');
252-
const { stderr, code } = await nonInteractiveSpawn(
252+
const { stdout, stderr, code } = await nonInteractiveSpawn(
253253
application.name,
254254
command,
255255
args,
@@ -260,8 +260,13 @@ export async function installApplication(application: Application) {
260260
if (code === 0) {
261261
return;
262262
}
263-
// otherwise, print the stderr output
264-
printStderr(application.name, stderr, 'error');
263+
if (stdout) {
264+
printStd(application.name, command, stdout, 'stdout', 'warn');
265+
}
266+
267+
if (stderr) {
268+
printStd(application.name, command, stderr, 'stderr', 'warn');
269+
}
265270
// and throw a descriptive error
266271
throw new Error(
267272
`Failed to install dependencies for ${application.name} using custom install command: ${application.install.command}. Exit code: ${code}`
@@ -300,7 +305,7 @@ export async function installApplication(application: Application) {
300305
// Would result in `pnpm@7` being used as the executable.
301306
// Important note: an `npm` version should not be specifiable; the only valid npm version is the one installed alongside Node.js
302307

303-
const { stderr, code } = await nonInteractiveSpawn(
308+
const { stdout, stderr, code } = await nonInteractiveSpawn(
304309
application.name,
305310
packageManager.name,
306311
['install'], // All of `npm`, `yarn`, and `pnpm` support the `install` command. If we need to configure options here we may have to use some other defaults though
@@ -315,18 +320,30 @@ export async function installApplication(application: Application) {
315320

316321
// Otherwise handle failure case based on `onFail` value
317322
if (onFail === 'error') {
318-
// Log the stderr using the error log level (in case the user doesn't have debug level set)
319-
printStderr(packageManager.name, stderr, 'error');
323+
// Log the std outputs using the error log level (in case the user doesn't have debug level set)
324+
if (stdout) {
325+
printStd(application.name, packageManager.name, stdout, 'stdout', 'error');
326+
}
327+
328+
if (stderr) {
329+
printStd(application.name, packageManager.name, stderr, 'stderr', 'error');
330+
}
331+
320332
// And throw an error instead of continuing
321333
throw new Error(
322334
`Failed to install dependencies for ${application.name} using ${packageManager.name}. Exit code: ${code}`
323335
);
324336
}
325337

326-
// If onFail is 'warn', print out stderr using the warn level, plus an additional message
338+
// If onFail is 'warn', print outputs using the warn level, plus an additional message
327339
if (onFail === 'warn') {
328-
// Log the stderr using the warn log level
329-
printStderr(packageManager.name, stderr, 'warn');
340+
if (stdout) {
341+
printStd(application.name, packageManager.name, stdout, 'stdout', 'warn');
342+
}
343+
344+
if (stderr) {
345+
printStd(application.name, packageManager.name, stderr, 'stderr', 'warn');
346+
}
330347

331348
application.logger.warn(
332349
`Failed to install dependencies for ${application.name} using ${packageManager.name}. Exit code: ${code}`
@@ -337,7 +354,7 @@ export async function installApplication(application: Application) {
337354
}
338355

339356
// Finally, default to running `npm install`
340-
const { stderr, code } = await nonInteractiveSpawn(
357+
const { stdout, stderr, code } = await nonInteractiveSpawn(
341358
application.name,
342359
'npm',
343360
['install', '--force'],
@@ -349,8 +366,14 @@ export async function installApplication(application: Application) {
349366
return;
350367
}
351368

352-
// Otherwise, print the stderr output
353-
printStderr(application.name, stderr, 'error');
369+
// Otherwise, print the stdout and stderr outputs
370+
if (stdout) {
371+
printStd(application.name, 'npm', stdout, 'stdout', 'warn');
372+
}
373+
374+
if (stderr) {
375+
printStd(application.name, 'npm', stderr, 'stderr', 'error');
376+
}
354377

355378
// and throw a descriptive error
356379
throw new Error(`Failed to install dependencies for ${application.name} using npm default. Exit code: ${code}`);
@@ -574,15 +597,15 @@ export function nonInteractiveSpawn(
574597
clearTimeout(timeout);
575598
// Print out stderr before rejecting
576599
if (stderr) {
577-
printStderr(applicationName, command, stderr);
600+
printStd(applicationName, command, stderr, 'stderr');
578601
}
579602
reject(error);
580603
});
581604

582605
childProcess.on('close', (code) => {
583606
clearTimeout(timeout);
584607
if (stderr) {
585-
printStderr(applicationName, command, stderr);
608+
printStd(applicationName, command, stderr, 'stderr');
586609
}
587610
logger.loggerWithTag(`${applicationName}:spawn:${command}`).debug(`Process exited with code ${code}`);
588611
resolve({
@@ -606,15 +629,15 @@ export function getEnvBuiltInComponents() {
606629
return builtInComponents;
607630
}
608631

609-
function printStderr(
632+
function printStd(
610633
applicationName: string,
611634
command: string,
612-
stderr: string,
635+
stdString: string,
636+
stdStreamLabel: 'stdout' | 'stderr',
613637
level: 'debug' | 'warn' | 'error' = 'debug'
614638
) {
615-
const stderrLogger = logger.loggerWithTag(`${applicationName}:spawn:${command}:stderr`);
616-
for (const line of stderr.split('\n')) {
617-
// Intentionally using the `debug` loglevel here since many CLIs, and predominantly package managers use stderr to report progress and metadata.
618-
stderrLogger[level](line);
639+
const stdLogger = logger.loggerWithTag(`${applicationName}:spawn:${command}:${stdStreamLabel}`);
640+
for (const line of stdString.split('\n')) {
641+
stdLogger[level](line);
619642
}
620643
}

components/componentLoader.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ import { Status } from '../server/status/index.ts';
3636
import { lifecycle as componentLifecycle } from './status/index.ts';
3737
import { DEFAULT_CONFIG } from './DEFAULT_CONFIG.ts';
3838
import { PluginModule } from './PluginModule.ts';
39-
import { platform } from 'node:os';
4039
import { getEnvBuiltInComponents } from './Application.ts';
41-
import { RocksDatabase } from '@harperfast/rocksdb-js';
4240

4341
const CF_ROUTES_DIR = resolvePath(env.get(CONFIG_PARAMS.COMPONENTSROOT));
4442
let loadedComponents = new Map<any, any>();

components/operations.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
const path = require('node:path');
44
const { isMainThread } = require('node:worker_threads');
5-
65
const fs = require('fs-extra');
76
const fg = require('fast-glob');
87
const normalize = require('normalize-path');
9-
108
const validator = require('./operationsValidation.js');
119
const log = require('../utility/logging/harper_logger.js');
1210
const hdbTerms = require('../utility/hdbTerms.ts');

config/RootConfigWatcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class RootConfigWatcher extends EventEmitter {
4040

4141
this.emit('change', (this.#config = config));
4242
})
43-
.catch((error) => {
43+
.catch((_error) => {
4444
// if yaml parse error ignore?
4545
});
4646
}

config/configUtils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ function getConfiguration() {
741741
742742
*/
743743
async function setConfiguration(setConfigJson) {
744+
// eslint-disable-next-line no-unused-vars
744745
const { operation, hdb_user, hdbAuthHeader, ...configFields } = setConfigJson;
745746
try {
746747
updateConfigValue(undefined, undefined, configFields, true);

0 commit comments

Comments
 (0)