fix: workaround for cds.cli.command bug#374
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
The change itself is a reasonable workaround, but the guard on line 6 is too broad — it will suppress the plugin for any process whose argv contains the bare string 'build' regardless of context, unlike the more precise positional check already used for 'add'.
PR Bot Information
Version: 1.26.5
- File Content Strategy: Full file content
- Event Trigger:
pull_request.ready_for_review - LLM:
anthropic--claude-4.6-sonnet - Correlation ID:
4743ca7e-193a-4675-a529-8872b09ede9e
Co-authored-by: hyperspace-insights[bot] <209611008+hyperspace-insights[bot]@users.noreply.github.com>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Workaround for
cds.cli.commandBug withbuildCommandBug Fix
🐛 Added a workaround to prevent the telemetry plugin from loading when the
cds buildcommand is invoked. Due to a bug incds.cli.command, thebuildcommand incorrectly resolves to an empty string (''), causing the plugin initialization check to pass unintentionally.Changes
cds-plugin.js: Added an early return guard that checks ifbuildis present inprocess.argv. This ensures the plugin exits before proceeding with initialization when thecds buildcommand is used, mirroring the existing workaround forcds add.PR Bot Information
Version:
1.26.54743ca7e-193a-4675-a529-8872b09ede9eanthropic--claude-4.6-sonnetpull_request.ready_for_review