Use CDS extractor diagnostics instead of exit error codes#223
Merged
jeongsoolee09 merged 6 commits intoadvanced-security:mainfrom Aug 19, 2025
Merged
Use CDS extractor diagnostics instead of exit error codes#223jeongsoolee09 merged 6 commits intoadvanced-security:mainfrom
jeongsoolee09 merged 6 commits intoadvanced-security:mainfrom
Conversation
This commit addresses a regression in the behavior of the CDS extractor in some cases and/or for some CAP projects. Specifically, this commit: - Removes calls like `process.exit(1)` from the CDS extractor codebase. - Adds new diagnostic warnings for error conditions that had previously resulted in a non-zero exit code being returned from `cds-extractor.ts`. - Adds unit tests to ensure that fails if the `cds-extractor.ts` file contains any `process.exit(n)` call where `n != 0`. - Updates eslint configs for the CDS extractor to resolve reported errors.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request improves error handling in the CDS extractor by replacing hard exits with diagnostic logging, ensuring the JavaScript extractor can continue processing even when CDS-specific operations fail. The changes focus on graceful degradation when CDS processing encounters issues while maintaining overall extraction functionality.
- Replace
process.exit(1)calls with diagnostic logging and graceful continuation - Add new diagnostic functions for different failure scenarios (environment setup, dependency graph, dependency installation, no CDS projects)
- Update ESLint configuration to better separate JavaScript and TypeScript file handling
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| extractors/cds/tools/cds-extractor.ts | Replace hard exits with diagnostic logging and graceful fallback to JavaScript extraction |
| extractors/cds/tools/src/diagnostics.ts | Add new diagnostic functions for various CDS extractor failure scenarios |
| extractors/cds/tools/test/cds-extractor.test.ts | Add comprehensive tests to verify exit code safety and diagnostic usage |
| extractors/cds/tools/package.json | Update lint commands to include new test files and adjust coverage collection |
| extractors/cds/tools/eslint.config.mjs | Refactor ESLint configuration with better separation between JS and TS files |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
This commit addresses a regression in the behavior of the CDS extractor in some cases and/or for some CAP projects. Specifically, this commit: - Removes calls like `process.exit(1)` from the CDS extractor codebase. - Adds new diagnostic warnings for error conditions that had previously resulted in a non-zero exit code being returned from `cds-extractor.ts`. - Adds unit tests to ensure that fails if the `cds-extractor.ts` file contains any `process.exit(n)` call where `n != 0`. - Updates eslint configs for the CDS extractor to resolve reported errors.
…-js into cds-compile-retry
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.
What This PR Contributes
This pull request focuses on improving error handling and diagnostics in the CDS extractor, ensuring that failures in environment setup, dependency graph building, dependency installation, and project detection do not cause hard exits. Instead, diagnostics are logged and the extractor continues gracefully, allowing the JavaScript extractor to run even when CDS-specific steps fail. Additionally, the ESLint configuration is refactored for better separation between JavaScript and TypeScript files, and new tests verify these error handling improvements.