Skip to content

ci: add pipeline with upstream libinjection integration#9

Merged
fzipi merged 6 commits intomainfrom
copilot/add-pipeline-tests
Mar 16, 2026
Merged

ci: add pipeline with upstream libinjection integration#9
fzipi merged 6 commits intomainfrom
copilot/add-pipeline-tests

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

  • Create .github/workflows/ci.yml GitHub Actions pipeline
  • Apply reviewer suggestions (single main branch, drop Python 3.8)
  • Fix Node.js 20 deprecation warnings: upgrade actions/checkout@v4@v6 and actions/setup-python@v5@v6
  • Remove deprecated SWIG -py3 flag from ci.yml
  • Fix ImportError: undefined symbol: libinjection_sqli_not_whitelist:
    • Add %ignore directives in libinjection/libinjection.i for all four static upstream functions (sqli_reset, sqli_lookup_word, sqli_blacklist, sqli_not_whitelist) so SWIG does not generate broken wrappers
    • Update json2python.py to use sqli_check_fingerprint (non-static public API that internally applies both blacklist and whitelist logic) instead of calling the now-ignored sqli_not_whitelist
  • All 4 tests pass locally (test_tokens, test_tokens_mysql, test_folding, test_fingerprints)
Original prompt

This section details on the original issue you should resolve

<issue_title>Add pipeline tests</issue_title>
<issue_description>Create a new pipeline to test that the module works with upstream changes. It should use github actions for python and get the files from upstream.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com>
Copilot AI changed the title [WIP] Add pipeline tests for module integration Add GitHub Actions CI pipeline with upstream libinjection integration Mar 11, 2026
@fzipi fzipi marked this pull request as ready for review March 12, 2026 22:30
@fzipi fzipi changed the title Add GitHub Actions CI pipeline with upstream libinjection integration ci: add pipeline with upstream libinjection integration Mar 16, 2026
Co-authored-by: Felipe Zipitría <3012076+fzipi@users.noreply.github.com>
@fzipi
Copy link
Collaborator

fzipi commented Mar 16, 2026

…ymbol for static C functions

Co-authored-by: fzipi <3012076+fzipi@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 16, 2026

@copilot Fix the warnings in the pipeline run: https://github.com/libinjection/python3-libinjection/actions/runs/23140793713/job/67216259478?pr=9

Fixed in commit 2b9c83d. Three changes were made:

  1. Node.js 20 deprecation warnings — upgraded actions/checkout@v4@v6 and actions/setup-python@v5@v6 (both v6 support Node.js 24). Also removed the deprecated SWIG -py3 flag.

  2. ImportError: undefined symbol: libinjection_sqli_not_whitelist — the upstream header declares sqli_not_whitelist, sqli_blacklist, sqli_lookup_word, and sqli_reset as static, giving them internal linkage. SWIG was generating wrappers that tried to call these symbols from libinjection_wrap.c, causing the undefined symbol at .so load time. Added %ignore directives in libinjection.i for all four static functions.

  3. json2python.py — replaced the now-unavailable sqli_not_whitelist(state) call with sqli_check_fingerprint(state), which is the public non-static API that internally performs both the fingerprint membership check and the whitelist false-positive reduction. All 4 tests pass locally.

Copilot AI requested a review from fzipi March 16, 2026 11:28
@fzipi fzipi merged commit cf5a6c5 into main Mar 16, 2026
4 checks passed
@fzipi fzipi deleted the copilot/add-pipeline-tests branch March 16, 2026 12:20
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.

Add pipeline tests

2 participants