Skip to content

Update to biolerplate v2#53

Open
Powfu2 wants to merge 11 commits into
masterfrom
update-to-biolerplate-v2
Open

Update to biolerplate v2#53
Powfu2 wants to merge 11 commits into
masterfrom
update-to-biolerplate-v2

Conversation

@Powfu2

@Powfu2 Powfu2 commented Jul 9, 2026

Copy link
Copy Markdown
Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Related issues: MAPCO-6292
Closes #XXX ...

Further information:

@Powfu2
Powfu2 requested a review from NivGreenstein July 9, 2026 15:52
Comment on lines +67 to 69
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note:
You can add top-level ENVs and reference them.
See example here

Comment thread config/default.json
Comment on lines +44 to +45
"database": "host",
"schema": "postgres"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert please

Suggested change
"database": "host",
"schema": "postgres"
"database": "dump-server",
"schema": "dump_server"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already reverted dunno why its still here

Comment thread src/common/db/index.ts Outdated
...connectionOptions,
password: undefined,
ssl: {
key: readFileSync(ssl.key),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If readFilesSync fails, it throws an error. make sure it throws an indicative one

Comment thread src/common/db/index.ts Outdated
const dbConfig = config.get<DbConfig>('db');
const connectionOptions = createConnectionOptions({ entities: ENTITIES_DIRS, ...dbConfig });
const config = container.resolve<ConfigType>(SERVICES.CONFIG);
const dbConfig: DbConfig = config.get('db');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to assign DbConfig type. The type will auto resolve

Comment thread src/common/constants.ts Outdated
import { readPackageJsonSync } from '@map-colonies/read-pkg';

export const SERVICE_NAME = readPackageJsonSync().name ?? 'unknown_service';
export const DEFAULT_SERVER_PORT = 80;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please default to port 8080

Comment thread src/containerConfig.ts Outdated
Comment on lines +107 to +109
useFactory: (container): HealthCheck => {
const connection = container.resolve<Connection>(Connection);
return getDbHealthCheckFunction(connection);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a function somewhere else. Don't create logic at containerConfig

Comment thread src/index.ts Outdated
Comment on lines +23 to +24
console.error('😢 - failed initializing the server');
console.error(error);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using logger if its available? revert relevant changes

Comment thread src/instrumentation.mts
import { getConfig, initConfig } from './common/config.js';

if (isMainThread) {
await initConfig();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure to disable it in the helm chart/ envs

Comment thread tests/helpers/index.ts

export const getMockObjectStorageConfig = (includeProjectId: boolean): IObjectStorageConfig => {
const objectStorageConfig: IObjectStorageConfig = { protocol: 'http', host: 'some_storage_host', port: '9000' };
const objectStorageConfig: IObjectStorageConfig = { protocol: 'http', host: 'some_storage_host', port: 9000 };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use nock to catch and resolve http requests.
Also, override the test config instead of this.

Comment thread ormconfig.ts Outdated
Comment on lines +5 to +6
// The typeorm CLI cannot await the async application config, so the db section is read directly
// from the local config file, honoring the same DB_* env overrides the schema defines for the application.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ai slop?

@NivGreenstein

Copy link
Copy Markdown
Contributor

Also, missing some files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants