-
Notifications
You must be signed in to change notification settings - Fork 3
Setup CDS extractor esbuild JS bundle #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lcartey
merged 14 commits into
advanced-security:main
from
data-douser:cds-extractor-dist
Jul 18, 2025
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
02b9735
Setup CDS extractor esbuild JS bundle
data-douser 4222b2f
Merge branch 'main' into cds-extractor-dist
data-douser 1098f4c
Add actions workflow for CDS extractor dist bundle
data-douser 1bd1466
Merge branch 'cds-extractor-dist' of github.com:data-douser/codeql-sa…
data-douser d396a94
Use shell-quote to sanitize CDS extractor args
data-douser a2e2850
Fix CDS extractor esbuild for shell-quote
data-douser 19a17cf
Unminify CDS extractor bundle
data-douser 5dc8cf1
Remove shell-quote library from CDS extractor
data-douser 8aafc0a
Cleanup changes to CDS extractor
data-douser 258671f
Use 'node20' as target for CDS extractor build
data-douser 670de11
Update CDS node dependencies to latest
data-douser e9b316e
Update cds-extractor-dist-bundle.yml workflow
data-douser 583e49b
Rework "validated" CDS commands
data-douser ad670f8
Merge branch 'main' into cds-extractor-dist
lcartey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: CDS Extractor Distribution Bundle | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'extractors/cds/**' | ||
| pull_request: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'extractors/cds/**' | ||
| workflow_dispatch: | ||
| # This job can be manually triggered to validate the CDS extractor bundle | ||
|
|
||
| jobs: | ||
| bundle-validation: | ||
| name: CDS extractor bundle validation | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: 'extractors/cds/tools/package-lock.json' | ||
|
|
||
| - name: Install node dependencies | ||
| working-directory: extractors/cds/tools | ||
| run: npm ci | ||
|
|
||
| - name: Run TS code linter | ||
| working-directory: extractors/cds/tools | ||
| run: npm run lint | ||
|
|
||
| - name: Run TS code unit tests with coverage report | ||
| working-directory: extractors/cds/tools | ||
| run: npm run test:coverage | ||
|
|
||
| - name: Build and validate the CDS extractor bundle | ||
| working-directory: extractors/cds/tools | ||
| run: npm run bundle:validate | ||
|
|
||
| - name: Check JS bundle size and properties | ||
| working-directory: extractors/cds/tools | ||
| run: | | ||
| _bundle_file="dist/cds-extractor.bundle.js" | ||
| # Test that bundle exists and get detailed info | ||
| if [ -f "$_bundle_file" ]; then | ||
| echo "✅ Bundle file exists" | ||
|
|
||
| # Check if bundle has shebang | ||
| if head -n 1 "${_bundle_file}" | grep -q "#!/usr/bin/env node"; then | ||
| echo "✅ Bundle has Node.js shebang" | ||
| else | ||
| echo "⚠️ Bundle missing Node.js shebang" | ||
| fi | ||
|
|
||
| # Check if source map exists | ||
| if [ -f "${_bundle_file}.map" ]; then | ||
| echo "✅ Source map exists" | ||
| else | ||
| echo "⚠️ Source map not found" | ||
| fi | ||
| else | ||
| echo "❌ Bundle file not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # - name: Upload bundle artifact | ||
data-douser marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # uses: actions/upload-artifact@v4 | ||
| # with: | ||
| # name: cds-extractor-bundle | ||
| # path: | | ||
| # extractors/cds/tools/dist/cds-extractor.bundle.js | ||
| # extractors/cds/tools/dist/cds-extractor.bundle.js.map | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Override .gitignore configs from parent directories in order to | ||
| # include the bundled JS code for the CDS extractor. | ||
| !dist/ | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 20.15.0 |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.