fix(ci): use local commit python for node python (#17488) - #17519
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates GitHub Actions workflows so the backend’s embedded Python dependencies can use the client-python code from the same OpenCTI commit/branch during CI and image builds, reducing mismatches between platform code and the pycti client it installs.
Changes:
- Add a
client_python_localinput toci-test-backend.ymland rewriteopencti-graphql/src/python/requirements.txtto installpyctifrom the same OpenCTI ref when enabled. - Enable
client_python_localinci-main.ymlwhen calling the backend test workflow. - Modify feature-branch deployment workflow input default for
client_python_local, and update rolling image build workflow to rewritepyctito a git-based dependency.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/test-feature-branch.yml | Changes the default behavior for using local client-python during feature-branch deployments. |
| .github/workflows/ci-test-backend.yml | Adds an input + step to force backend tests to use pycti from the same OpenCTI ref. |
| .github/workflows/ci-main.yml | Passes client_python_local: true into the backend test reusable workflow. |
| .github/workflows/cd-build-rolling-images-on-merge.yml | Rewrites pycti dependency to a git URL for rolling builds on merge. |
Suppressed comments (1)
.github/workflows/ci-test-backend.yml:292
- This job uses
inputs.checkout_refto installpyctifrom Git, but the checkout step doesn’t useinputs.checkout_ref. If a caller provides a different ref, the workspace and the installed client version can be inconsistent. Addwith.ref: ${{ inputs.checkout_ref }}to the checkout step.
- name: Use client-python in OpenCTI from same branch
if: ${{ inputs.client_python_local == true }}
run: sed -i 's|^pycti==.*$|pycti @ git+https://github.com/OpenCTI-Platform/opencti@${{ inputs.checkout_ref }}#subdirectory=client-python|' ./opencti-platform/opencti-graphql/src/python/requirements.txt
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17519 +/- ##
==========================================
+ Coverage 34.12% 34.13% +0.01%
==========================================
Files 3376 3376
Lines 137671 137826 +155
Branches 37258 37338 +80
==========================================
+ Hits 46978 47048 +70
- Misses 90693 90778 +85
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # .github/workflows/ci-test-backend.yml
5d3ea9f to
b30624f
Compare
Proposed changes
Note: local client python = false is not used much today, but it will when all the release process will be on github.
Related issues
How to test this PR
No sure... CI is green ?
Checklist
Further comments