@@ -39,7 +39,7 @@ activate_venv() {
3939 # Method to activate isolate venv
4040
4141 # Create isolated virtual environment in connector path
42- python -m venv " $1 /$VENV_NAME "
42+ uv venv " $1 /$VENV_NAME "
4343
4444 # Activate virtual environment according to OS
4545 if [ -f " $1 /$VENV_NAME /bin/activate" ]; then
@@ -55,15 +55,15 @@ activate_venv() {
5555 requirements_file=$( find_requirements_txt .)
5656 if [ -n " $requirements_file " ]; then
5757 # -qq: Hides both informational and warning messages, showing only errors.
58- python -m pip install -qq -r " $requirements_file "
58+ uv pip install -qq -r " $requirements_file "
5959 else
6060 # If no requirements.txt, try to install the connector as a package (assuming pyproject.toml exists)
61- python -m pip install .
61+ uv pip install .
6262 fi
6363
6464 # Ensure connectors-sdk is available for script generation
6565 echo " 🔄 Installing connectors-sdk for schema generation..."
66- python -m pip install " connectors-sdk @ git+https://github.com/OpenCTI-Platform/connectors.git@master#subdirectory=connectors-sdk"
66+ uv pip install " connectors-sdk @ git+https://github.com/OpenCTI-Platform/connectors.git@${RELEASE_REF :- master} #subdirectory=connectors-sdk"
6767
6868 # Return to original working directory
6969 popd
@@ -88,16 +88,20 @@ deactivate_venv() {
8888# Find all parents directory of connector with __metadata__ directory
8989connector_directories_path=$( find . -type d -name " $CONNECTOR_METADATA_DIRECTORY " | sed ' s:/*' " $CONNECTOR_METADATA_DIRECTORY " ' $::' | sort -u)
9090
91+ # CircleCI uses a shallow clone by default, so we need to fetch the full history to compare with the base branch
92+ git fetch --unshallow || git fetch --depth=100
93+ git fetch origin " +refs/heads/*:refs/remotes/origin/*"
94+
9195# Loop in each connector directory with infos and regenerate JSON schema if changed
9296for connector_directory_path in $connector_directories_path
9397do
9498 if [ -d " $connector_directory_path " ]; then
9599 # Only generate schema for directory that changed
96100 CIRCLE_BRANCH=${CIRCLE_BRANCH:- " " }
97- if [ " $CIRCLE_BRANCH " = " master" ]; then
101+ if [ " $CIRCLE_BRANCH " = " ${RELEASE_REF :- master} " ]; then
98102 directory_has_changed=$( git diff HEAD~1 HEAD -- " $connector_directory_path " )
99103 else
100- directory_has_changed=$( git diff $( git merge-base master HEAD) HEAD " $connector_directory_path " )
104+ directory_has_changed=$( git diff $( git merge-base origin/ " ${RELEASE_REF :- master} " HEAD) HEAD " $connector_directory_path " )
101105 fi
102106
103107 if [ -z " $directory_has_changed " ] ; then
133137 rm " $connector_directory_path /generate_connector_config_json_schema_tmp.py"
134138
135139 # Generate configurations table in __metadata/CONNECTOR_CONFIG_DOC.md
136- python -m pip install -q --disable-pip-version-check jsonschema_markdown
140+ uv pip install -q jsonschema_markdown
137141 generator_config_doc_path=$( find . -name " generate_connector_config_doc.py.sample" )
138142 cp " $generator_config_doc_path " " $connector_directory_path /generate_connector_config_doc_tmp.py"
139143 python " $connector_directory_path /generate_connector_config_doc_tmp.py"
0 commit comments