Skip to content

chore: cds^10#443

Merged
sjvans merged 6 commits into
2from
10-for-2
Jun 27, 2026
Merged

chore: cds^10#443
sjvans merged 6 commits into
2from
10-for-2

Conversation

@sjvans

@sjvans sjvans commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Chore: Upgrade to cds^10 — Migrate Test Config to .cdsrc.json and CDS Profiles

Refactor

♻️ Migrates test configuration from inline process.env overrides to a dedicated .cdsrc.json file and CDS CLI profiles, aligning with the cds^10 approach for environment/profile-based configuration. Also includes test timing optimizations and minor bug fixes.

Changes

  • .github/workflows/ci.yml: Commented out the cds@8 downgrade step; updated comment to reference cds@9.
  • .github/workflows/release.yml: Added a REVISIT comment to remove the better-sqlite3 install workaround with cds^10.
  • .gitignore: Removed test/bookshop/.cdsrc.json from the ignore list so it can be tracked in version control.
  • test/bookshop/.cdsrc.json: New file defining CDS profiles (logging, metrics, metrics-outbox, metrics-outbox-disabled, tracing-attributes, persistent-outbox, without-outbox) consolidating telemetry, messaging, and metrics settings previously scattered across test files.
  • test/bookshop/package.json: Removed _outbox and profile-specific [metrics-outbox]/[metrics-outbox-disabled] blocks (now in .cdsrc.json); added _scheduling: true.
  • test/logging.test.js: Removed inline process.env overrides for telemetry/log format; switched to cds.test(..., '--profile', 'logging') with a minimal remaining env override for cls_custom_fields.
  • test/metrics.test.js: Removed exportIntervalMillis env override; switched to cds.test(..., '--profile', 'metrics').
  • test/metrics-outbox.test.js / test/metrics-outbox-multitenant.test.js: Reduced metric collection wait times from 300ms to 150ms; fixed retry loop bug where both loops checked E1 instead of E1/E2 respectively.
  • test/tracing-attributes.test.js: Removed inline exporter env var; switched to cds.test(..., '--profile', 'tracing-attributes').
  • test/tracing-messaging-persistent-outbox.test.js: Renamed CASE to persistent-outbox; simplified env setup; marked describe block as skip pending vitest migration.
  • test/tracing-messaging-without-outbox.test.js: Renamed CASE to without-outbox; simplified env setup using outboxed: false.
  • test/tracing-messaging-with-in-memory-outbox.test.js: Removed this test file entirely.
  • test/tracing-messaging.js: Switched from cds.test().in(...) to cds.test(..., '--profile', CASE).
  • test/tracing.test.js: Switched from cds.test().in(...) to cds.test(...).
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.26.11

  • Summary Prompt: Default Prompt
  • Correlation ID: 14c5ae4d-4c97-4eff-a004-330c9fdcf2fe
  • Event Trigger: pull_request.edited
  • File Content Strategy: Full file content
  • Output Template: Default Template
  • LLM: anthropic--claude-4.6-sonnet

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

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.

The PR cleanly migrates test configuration from scattered process.env overrides into a consolidated test/bookshop/.cdsrc.json with named CDS profiles, which is a clear improvement in maintainability. The main concern is the persistent-outbox profile missing the outbox kind configuration that the old code explicitly set — worth verifying before re-enabling that test.

PR Bot Information

Version: 1.26.11

  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.opened
  • Correlation ID: 6c7ec365-2411-4079-83d3-9a5ab3e24908
  • File Content Strategy: Full file content

@cap-js cap-js deleted a comment from hyperspace-pr-bot Bot Jun 26, 2026
@cap-js cap-js deleted a comment from hyperspace-pr-bot Bot Jun 26, 2026
@sjvans sjvans mentioned this pull request Jun 26, 2026
1 task
@sjvans
sjvans marked this pull request as ready for review June 27, 2026 11:30
@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Chore: Upgrade to @sap/cds^9 — Drop cds^8 Support and Migrate Test Config to CDS Profiles

Refactor

♻️ Drops support for @sap/cds^8 and migrates test configuration from scattered process.env overrides to a dedicated test/bookshop/.cdsrc.json file using CDS CLI profiles. This aligns with the cds^9/cds^10 approach for environment/profile-based configuration and includes test timing optimizations and minor bug fixes.

Changes

  • CHANGELOG.md: Added entry for @sap/cds^10 support and @sap/cds^8 removal.
  • package.json: Narrowed peer dependency from ^8 || ^9 to ^9; narrowed dev dependencies (@cap-js/sqlite, @sap/cds-mtxs) to drop legacy version ranges.
  • test/bookshop/.cdsrc.json: New file — defines CDS profiles (logging, metrics, metrics-outbox, metrics-outbox-disabled, tracing-attributes, persistent-outbox, without-outbox) consolidating telemetry, messaging, and metrics settings previously scattered across test files.
  • test/bookshop/package.json: Removed inline [metrics-outbox]/[metrics-outbox-disabled] profile blocks (now in .cdsrc.json); removed _outbox section; added _scheduling: true.
  • .gitignore: Removed test/bookshop/.cdsrc.json from the ignore list so it is tracked in version control.
  • .github/workflows/ci.yml: Commented out the cds@8 downgrade step; updated comment to reference cds@9.
  • .github/workflows/release.yml: Added a REVISIT comment to remove the better-sqlite3 workaround with cds^10.
  • test/logging.test.js: Removed inline process.env telemetry overrides; switched to cds.test(..., '--profile', 'logging') with a minimal remaining cls_custom_fields env override.
  • test/metrics.test.js: Removed exportIntervalMillis env override; switched to cds.test(..., '--profile', 'metrics').
  • test/metrics-outbox.test.js: Reduced metric collection wait times from 300ms to 150ms; fixed retry loop bug where both loops checked E1 instead of E1/E2.
  • test/metrics-outbox-multitenant.test.js: Reduced metric collection wait times from 300ms to 150ms.
  • test/tracing-attributes.test.js: Removed inline exporter env var; switched to cds.test(..., '--profile', 'tracing-attributes').
  • test/tracing-messaging-persistent-outbox.test.js: Renamed CASE to persistent-outbox; simplified env setup; marked describe block as skip pending vitest migration.
  • test/tracing-messaging-without-outbox.test.js: Renamed CASE to without-outbox; simplified env setup using outboxed: false.
  • test/tracing-messaging-with-in-memory-outbox.test.js: Removed entirely.
  • test/tracing-messaging.js: Switched to cds.test(__dirname + '/bookshop', '--profile', CASE).
  • test/tracing.test.js: Switched from cds.test().in(...) to cds.test(...).

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.26.11

  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.ready_for_review
  • Correlation ID: 0e903766-6f6a-4d1f-9589-664bad1bee33
  • File Content Strategy: Full file content
  • Output Template: Default Template
  • Summary Prompt: Default Prompt

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

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.

The PR is a well-structured migration of test configuration from scattered process.env overrides to a centralized .cdsrc.json with CDS profiles, and includes several legitimate bug fixes (duplicate E1 retry loops, missing E2 assertions). The main concerns are: (1) peerDependencies should be widened to ^9 || ^10 since the changelog advertises cds^10 support; (2) the persistent-outbox profile is missing the outbox kind configuration that the original code set, which will silently break the test when it's re-enabled after the vitest migration.

PR Bot Information

Version: 1.26.11

  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content
  • Event Trigger: pull_request.ready_for_review
  • Correlation ID: 0e903766-6f6a-4d1f-9589-664bad1bee33

Comment thread .github/workflows/ci.yml
- run: npm i -g @sap/cds-dk@${{ matrix.cds-version }}
- run: npm i
- run: if [ ${{ matrix.cds-version }} -eq 9 ]; then npm i -f @sap/cds@8 @cap-js/sqlite@2 @sap/cds-mtxs@3; fi
#- run: if [ ${{ matrix.cds-version }} -eq 9 ]; then npm i -f @sap/cds@9 @cap-js/sqlite@2 @sap/cds-mtxs@3; fi

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.

Bug: The commented-out step originally forced @sap/cds@8 (now corrected to @sap/cds@9 in the comment), but the active matrix only tests cds-version: [9] while cds-version: [10] is also commented out. The better-sqlite3 rebuild step on line 40 still fires for cds-version -eq 9, so this is fine for now — but the commented line references a workaround that is no longer needed if cds@9 is already installed via line 37. The comment text says @sap/cds@9 but this step was originally meant to downgrade when cds-dk installed a newer version; the comment is now misleading about its purpose.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

Comment thread package.json
},
"peerDependencies": {
"@sap/cds": "^8 || ^9"
"@sap/cds": "^9"

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.

Bug: The peerDependencies was updated to "@sap/cds": "^9" but the CHANGELOG and PR description say this release adds support for cds^10 and drops cds^8. The peer dependency range should be "^9 || ^10" (or "^10" if ^9 support is also being dropped) to accurately reflect compatibility.

Suggested change
"@sap/cds": "^9"
"@sap/cds": "^9 || ^10"

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

process.env.cds_requires_messaging = JSON.stringify({
kind: 'file-based-messaging',
outbox: true,
file: `../${CASE}`

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.

Bug: The persistent-outbox profile only sets messaging kind/file but omits the persistent outbox configuration (the original code also set cds_requires_outbox = { kind: 'persistent-outbox' }). When this test is re-enabled, it will not actually exercise persistent outbox behavior — the missing outbox config should be tracked in a REVISIT comment or restored in the profile.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

@sjvans
sjvans merged commit 1583096 into 2 Jun 27, 2026
9 of 15 checks passed
@sjvans
sjvans deleted the 10-for-2 branch June 27, 2026 11:31
@sjvans sjvans mentioned this pull request Jun 28, 2026
1 task
sjvans added a commit that referenced this pull request Jun 29, 2026
# Release: `v2.0.0` — OpenTelemetry SDK 2.0 Support

### New Features

🚀 This major release upgrades `@cap-js/telemetry` to support
**OpenTelemetry SDK 2.0**, introduces
`@opentelemetry/instrumentation-undici` as a default instrumentation,
adds CALM (`@sap/xotel-agent-ext-js`) integration, and drops support for
`@sap/cds^8`.

### Changes

* `package.json`: Bumped version to `2.0.0`. Updated all
`@opentelemetry/*` dependencies to SDK 2.x-compatible versions. Replaced
`@opentelemetry/host-metrics` with
`@opentelemetry/instrumentation-host-metrics`. Added
`@opentelemetry/instrumentation-undici` as a new default
instrumentation. Dropped `@sap/cds^8` peer dependency support. Updated
`vcap` binding config for Dynatrace and Cloud Logging to also match by
tag.
* `cds-plugin.js`: Removed the startup check that blocked usage with
OpenTelemetry SDK 2.0. Added a workaround for `cds build` command
detection.
* `lib/index.js`: Refactored to support two setup modes:
`setup_standalone` (default) and `setup_with_calm` (when
`@sap/xotel-agent-ext-js` is detected). Auto-detection of
`@opentelemetry/instrumentation-host-metrics` as an instrumentation,
with `metricGroups` limited to `['process.cpu', 'process.memory']` by
default.
* `lib/tracing/index.js`: Added CALM delegate support for span
processors. Replaced deprecated `Resource` with
`resourceFromAttributes`. Updated to use `spanProcessors` constructor
option instead of `addSpanProcessor`. Added SAP Passport cleanup for new
transactions.
* `lib/metrics/index.js`: Added CALM delegate support for metric
readers. Replaced deprecated `Resource`/`View`/`DropAggregation` APIs
with `resourceFromAttributes` and `readers` constructor option. Removed
`lib/metrics/host.js` (replaced by instrumentation-based approach).
* `lib/logging/index.js`: Added CALM delegate support for log
processors. Refactored provider initialization. Improved error message
for missing Cloud Logging credentials.
* `lib/utils.js`: Replaced `getEnv`/`getEnvWithoutDefaults` with
`getStringFromEnv`. Replaced `new Resource(...)` with
`resourceFromAttributes(...)` throughout.
* `lib/exporter/ConsoleSpanExporter.js`: Updated span parent references
from deprecated `parentSpanId` to `parentSpanContext?.spanId`.
* `lib/exporter/ConsoleMetricExporter.js`: Updated scope name check for
host metrics instrumentation.
* `lib/tracing/trace.js`: Updated `instrumentationLibrary` reference to
`instrumentationScope` (SDK 2.0 rename).
* `README.md`: Removed the "not yet supported" warning for OpenTelemetry
SDK 2.0. Updated host metrics docs to reflect the new `metricGroups`
configuration. Added `undici` to default instrumentations list.
Clarified Cloud Logging user-provided service tag requirement to `"Cloud
Logging"` only.
* `CHANGELOG.md`: Updated version header to `2.0.0` with added, changed,
fixed, and removed entries.
* `.github/workflows/ci.yml`: Updated CI matrix to test only with
`cds-version: [9]`; added branch `2` to push triggers.
* `test/bookshop/.cdsrc.json`: Extracted CDS profile-based test
configurations from `package.json` into a dedicated config file.
* Various test files: Migrated from `cds.test().in(...)` to
`cds.test(..., '--profile', ...)` pattern; reduced wait times from 300ms
to 150ms in metrics tests.

- [ ] 🔄 Regenerate and Update Summary



<details>
<summary>PR Bot Information</summary>

**Version:** `1.26.11`

- Event Trigger: `pull_request.edited`
- Output Template: [Default
Template](https://github.tools.sap/intelligent-insights/i2-pull-request/blob/main/src/services/llm/prompts/summary_default_output_template.md)
- Correlation ID: `99a59df9-b306-487f-9485-bc9d1b221f55`
- Summary Prompt: [Default
Prompt](https://github.tools.sap/intelligent-insights/i2-pull-request/blob/main/src/services/llm/prompts/summary_instructions_prompt.md)
- File Content Strategy: Full file content
- LLM: `anthropic--claude-4.6-sonnet`
</details>

---

compiled of:
- #364
  + #424
  + #442
- #407
- #374
- #425
- #443

---------

Co-authored-by: Vitaly Kozyura <58591662+vkozyura@users.noreply.github.com>
Co-authored-by: I548646 <paul.erlenwein@sap.com>
Co-authored-by: Paul <paul.erlenwein@gmail.com>
Co-authored-by: hyperspace-insights[bot] <209611008+hyperspace-insights[bot]@users.noreply.github.com>
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.

1 participant