Skip to content

feat: infrastructure and boilerplate deps upgrade (MAPCO-9937)#82

Open
roicohen326 wants to merge 16 commits into
masterfrom
feat/infrastructure-boilerplate-update-v2
Open

feat: infrastructure and boilerplate deps upgrade (MAPCO-9937)#82
roicohen326 wants to merge 16 commits into
masterfrom
feat/infrastructure-boilerplate-update-v2

Conversation

@roicohen326
Copy link
Copy Markdown
Contributor

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

Related issues: #XXX , #XXX ...
Closes #XXX ...

Further information:

Copy link
Copy Markdown
Contributor

@CL-SHLOMIKONCHA CL-SHLOMIKONCHA left a comment

Choose a reason for hiding this comment

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

Nice job, focus on:

  • merge similar imports
  • IConfig should be removed and replaced by : ConfigType
  • Also remove tsconfig.lint.json & tsconfig.test.json
  • Eslint error
  • Failed tests
  • Some missing config-management envs

Comment thread helm/templates/_helpers.tpl Outdated
{{/*
Returns the metrics url from global if exists or from the chart's values
*/}}
{{- define "ingestion-trigger.metricsUrl" -}}
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.

metrics url is redundant

Comment thread helm/templates/_helpers.tpl Outdated
{{/*
Returns the metrics buckets from global if exists or from the chart's values
*/}}
{{- define "ingestion-trigger.metricsBuckets" -}}
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.

metrics buckets is redundant

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.

would prefer to remain work with the common.tracing.merged within the _tplValues.tpl file

Comment thread helm/templates/configmap.yaml Outdated
{{ if $metrics.enabled }}
TELEMETRY_METRICS_ENABLED: {{ $metrics.enabled | quote }}
TELEMETRY_METRICS_URL: {{ $metrics.url }}
TELEMETRY_METRICS_ENABLED: {{ $metricsEnabled | quote }}
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.

matrics envs redundant

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.

missing configManagement envs

openAsync: jest.fn().mockImplementation(actualModule['openAsync'] as (...args: unknown[]) => unknown),
};
});
import httpStatusCodes from 'http-status-codes';
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.

handle those eslint errors

});

beforeEach(() => {
registerDefaultConfig();
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 recheck this one, should not be called after the getApp?

import { trace } from '@opentelemetry/api';
import * as gdal from 'gdal-async';

jest.mock('gdal-async', () => {
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.

usually jest.mock must be shown above all import, please recheck it.

Comment thread .gitignore Outdated
bundledApi.yaml

# Temporary schema files
Schema/
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.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right, this was added during cleanup of local generated files and is not required for this PR, so I will remove it.

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.

should see why you had to use taskId with !

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

After the ESLint v9 migration, stricter rules exposed older tolerated patterns, so I fixed the real code issues first and used a few tactical suppressions only where external package conventions didn’t align with lint rules.
These suppressions are short term safeguards for migration stability, and I will remove them as part of targeted cleanup refactors in the upcoming PR.

@CL-SHLOMIKONCHA
Copy link
Copy Markdown
Contributor

please upgrade js-logger to v5.0.0 support the loki telemetry,
see more:
MapColonies/ts-server-boilerplate@85862fa

Comment thread helm/templates/configmap.yaml Outdated
{{ if $tracing.enabled }}
TELEMETRY_TRACING_URL: {{ $tracing.url }}
{{ end }}
CONFIG_SERVER_URL: {{ .Values.configManagement.serverUrl | quote }}
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 convert to use the with syntax:
{{- with .Values.configManagement }}
see more: https://github.com/MapColonies/ts-server-boilerplate/blob/master/helm/templates/configmap.yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread helm/templates/configmap.yaml Outdated
OFFLINE_MODE: {{ .Values.configManagement.offlineMode | quote }}
npm_config_cache: /tmp/
{{- end }}
# TODO: check if values should be clean up No newline at end of file
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.

EOF

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread helm/values.yaml Outdated
logPrettyPrintEnabled: false
responseCompressionEnabled: true
requestPayloadLimit: 1mb
tracing:
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.

we still need the tracing scope to determine to enabled and set the telemetry url

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

logContext: this.logContext,
jobId: task.jobId,
taskId: task.id,
error: err instanceof Error ? err.message : 'Unknown 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.

change to err (run linter again - if theres more of this warning please fix)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread src/ingestion/schemas/infoDataSchema.ts Outdated
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.

recheck this warning

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread src/serviceClients/jobTrackerClient.ts Outdated
if (err instanceof Error) {
const message = 'Failed to notify job tracker';
const error = new Error(`${message}: ${err.message}`);
logger.error({ msg: message, error: err });
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.

same comment - change to err

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Comment thread src/utils/hash/checksum.ts Outdated
this.logger.error({ msg: 'error processing checksum for a chunk', err, logContext: logCtx });
stream.destroy();
reject(err);
reject(err instanceof Error ? err : new Error(String(err)));
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

Comment thread src/utils/hash/checksum.ts Outdated
this.logger.error({ msg: 'error processing checksum result', err, logContext: logCtx });
stream.destroy();
reject(err);
reject(err instanceof Error ? err : new Error(String(err)));
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

Comment thread src/instrumentation.mjs Outdated
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 did you delete this file? its needed to init config and tracing, server would not run without this one.

afterEach(function () {
resetContainer();
jest.restoreAllMocks();
nock.cleanAll();
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.

add ignore rule for this case

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.

3 participants