Skip to content

feat: update nodejs#644

Draft
elaine-mattos wants to merge 22 commits intoclearlydefined:masterfrom
elaine-mattos:feat/update-nodejs
Draft

feat: update nodejs#644
elaine-mattos wants to merge 22 commits intoclearlydefined:masterfrom
elaine-mattos:feat/update-nodejs

Conversation

@elaine-mattos
Copy link

@elaine-mattos elaine-mattos commented Jul 17, 2025

Overview

This PR introduces several significant updates and improvements to the project, including:

Node.js version upgrades (Dockerfiles, CI, engines)
Dependency updates (major and minor, including security and compatibility)

Changes

Node.js Version Upgrades

  • DevDockerfile and Dockerfile: Upgraded from node:18-bullseye to node:24-bullseye
  • test.yml: Node.js version set to 24

Dependency Updates

  • Major dependency upgrades in Azure SDKs, Babel, ESLint, Express, Chai, Winston, and more;
  • Security and compatibility improvements;
  • Removal of deprecated/unsupported versions.
  • ScanCode: updated from 32.1.0 to 32.3.3
  • Reuse: updated from 3.0.1 to 5.0.2
  • cdConfig.js: Introduced baseFileLocation for consistent file path handling; cd_file now has separate location and attachmentLocation properties
  • file.js: Attachments are now stored in a dedicated attachment directory if attachmentLocation is set; File naming for attachments improved (attachment:KEY → attachmentLocation/KEY.json)
  • Removed deprecated winston-azure-application-insights integration.
  • Upgraded winston and refined local logging.

Miscellaneous

  • Added env.json to .gitignore to prevent local config leakage.

Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
- Refactor _detectVersion to robustly parse version using regex and handle missing versions
- Catch and log version detection errors
- Log detected SCANCODE and aggregated handler versions on initialization

Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
- Enhance error and version logging in fsfeReuse and licensee processors
- Improve error reporting for LICENSES directory access and REUSE execution
- Add attachment path support in file store for  keys
- Minor formatting cleanup

Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
…hment paths

Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
@elaine-mattos elaine-mattos marked this pull request as ready for review July 23, 2025 15:34
@elaine-mattos elaine-mattos marked this pull request as draft August 15, 2025 12:35

# REUSE
RUN pip3 install setuptools
RUN pip3 install reuse==3.0.1
Copy link

Choose a reason for hiding this comment

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

Whenever you update the PR, consider bumping this version as well. REUSE 6.x has quite interesting performance gains and also fixes potential license/copyright detection issues.

@JamieMagee
Copy link
Contributor

I compared this PR against current master to figure out what's still worth merging. Short version: about half of it landed through other work, but there are real gaps remaining.

What's already done separately: Node 24 is in CI and both Dockerfiles. The winston 3 migration in logger.js is complete, including dropping winston-azure-application-insights.

What's still broken on master that this PR fixes:

  • REUSE is pinned at 3.0.1 in the Dockerfile. This PR bumps it to 5.0.2 — that hasn't happened anywhere else. (ScanCode did get bumped past this PR's target, to 32.5.0, so that part is moot.)
  • Both Dockerfiles still use the legacy ENV PORT 5000 syntax instead of ENV PORT=5000. Docker has been warning about this for a while.
  • The DevDockerfile has a real bug: ENV BUILD_NUMBER=$APP_VERSION on line 8 references APP_VERSION, which isn't defined until line 9. The PR fixes the ordering.
  • scancode.js, licensee.js, and fsfeReuse.js still call logger.log() for failures instead of logger.error() — that means errors don't get surfaced properly in Application Insights.
  • No HTTPS proxy support in fetch.js. The HttpsProxyAgent addition is useful for anyone running behind a corporate proxy.
  • Test fixtures still live under 32.1.0/ even though ScanCode is at 32.5.0 now.

Smaller stuff: .gitignore is missing a .env entry, package.json doesn't declare engines.node, and the configurable npm registry URL is an interesting idea but the PR has debug console.log statements that would need cleanup.

Honestly, given how much master has diverged, rebasing this into one coherent PR would be painful. It'd probably be easier to cherry-pick the remaining fixes into a few focused PRs: one for the Dockerfile fixes (REUSE bump, ENV syntax, DevDockerfile bug), one for the logging improvements, and maybe one for proxy support.

@elaine-mattos
Copy link
Author

Hi @JamieMagee ,

Sorry, I was really busy with other things at work! I finally got some time to look deeper into clearly defined again and I'll look into it tomorrow!

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