tmforum-oda / oda-canvas

Apache License 2.0
19 stars 52 forks source link

cleanup source/.gitignore #318

Closed ferenc-hechler closed 1 month ago

ferenc-hechler commented 2 months ago

Description

Added the sources of the Service-Inventory-API into subfolder "source/tmf-services/TMF638_Service_Inventory". Docker image was built from the pipeline. The deployed service fails with the following error message:

info: kafka::brokers :: args=undefined
info: kafka::brokers["localhost:9092"]
node:internal/modules/cjs/loader:1251
  throw err;
  ^

Error: Cannot find module './json-schema-ref-parser/lib/index.js'
Require stack:
- /usr/src/app/utils/operationsUtils.js
- /usr/src/app/services/Service.js
- /usr/src/app/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:126:16)
    at Object.<anonymous> (/usr/src/app/utils/operationsUtils.js:14:20)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/src/app/utils/operationsUtils.js',
    '/usr/src/app/services/Service.js',
    '/usr/src/app/index.js'
  ]
}

Node.js v22.7.0

The file ./json-schema-ref-parser/lib/index.js is really not present in the docker image. The reason is that in source/.gitignore there is the following entry:

lib/

This applies to all subfolders, because it does not start with a "/" ("/lib/") which would limit it to the current folder.

There are lots of entries in the "source/.gitignore" which have to be cleaned up:

https://github.com/tmforum-oda/oda-canvas/blob/e527bd0456679259f0b6d38045c411ff1ada8fee/source/.gitignore#L1-L158

ferenc-hechler commented 1 month ago

Result of the discussion in the technical clinic session: The IDE dependent ignores, like VS-Code, should be kept. The language specific ignores should be moved into the corresponding sub-projects and replaced with the language specific version from https://github.com/github/gitignore/blob/main

So, for TMF638 this will be the Node ignores and not the Python ignores.

ferenc-hechler commented 1 month ago

Changes were done in branch "feature/issue-289-canvas-info-service". Issue will be closed, when this branch is merged into main.