Skip to content

Conversation

@shivasurya
Copy link
Owner

This adds the core matching logic for keyword argument validation in the Go executor. The implementation checks both function name patterns and keyword argument values when determining if a call site matches a rule. It supports exact matching and wildcard patterns for argument values, enabling precise detection of security-sensitive function calls with specific parameter configurations.

@shivasurya shivasurya added enhancement New feature or request go Pull requests that update go code labels Nov 21, 2025
@shivasurya shivasurya self-assigned this Nov 21, 2025
@shivasurya shivasurya added enhancement New feature or request go Pull requests that update go code labels Nov 21, 2025
@safedep
Copy link

safedep bot commented Nov 21, 2025

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 83.05085% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.76%. Comparing base (323b8e9) to head (920a729).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sourcecode-parser/dsl/call_matcher.go 83.05% 8 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #385      +/-   ##
==========================================
+ Coverage   78.73%   78.76%   +0.03%     
==========================================
  Files          70       70              
  Lines        6933     6990      +57     
==========================================
+ Hits         5459     5506      +47     
- Misses       1237     1245       +8     
- Partials      237      239       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Owner Author

shivasurya commented Nov 21, 2025

Merge activity

  • Nov 21, 1:29 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Nov 21, 1:30 AM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 21, 1:31 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya changed the base branch from shiva/pr-01-dsl-ir-extension-keyword-args to graphite-base/385 November 21, 2025 01:29
@shivasurya shivasurya changed the base branch from graphite-base/385 to main November 21, 2025 01:29
This PR implements the core matching logic that checks CallSite arguments against keyword constraints defined in the IR, making argument checking functional for the first time.

Changes:
- Modified matchesCallSite() to check both function name and argument constraints
- Implemented matchesArguments() to validate keyword argument constraints with AND logic
- Implemented matchesArgumentValue() with type-specific matching for strings, booleans, and numbers
- Added helper functions: cleanValue(), normalizeValue(), matchesBoolean(), matchesNumber()
- Added 12 comprehensive unit tests covering all matching scenarios and edge cases

Test Results:
- All 12 new tests pass
- 100% coverage on matchesArguments(), cleanValue(), matchesBoolean(), matchesNumber()
- 89.1% overall coverage on dsl package
- No regression in existing tests
- Lint passes, build succeeds

Stacked on: PR #1 (shiva/pr-01-dsl-ir-extension-keyword-args)
@shivasurya shivasurya force-pushed the shiva/pr-02-keyword-matching-logic branch from 50f3c62 to 920a729 Compare November 21, 2025 01:30
@shivasurya shivasurya merged commit a7b2db0 into main Nov 21, 2025
3 checks passed
@shivasurya shivasurya deleted the shiva/pr-02-keyword-matching-logic branch November 21, 2025 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants