Skip to content

Conversation

@Powlinett
Copy link
Member

@Powlinett Powlinett commented Dec 10, 2025

💡 Note:

This PR is made to handle the generation of the config JSON schema for connectors like dragos: #5374
This PR should be merged first to avoid any issue with the CI

Proposed changes

  • handle connectors developed with pyproject.toml in bash scripts
  • handle connectors developed with pyproject.toml in powershell scripts

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

@Powlinett
Copy link
Member Author

I don't link the issue to avoid closing it at merge (still opened for other PRs)

@Powlinett Powlinett force-pushed the fix/4857-update-config-json-schema-generation-scripts branch from 93e493e to b54cfa3 Compare January 5, 2026 11:24
jabesq
jabesq previously approved these changes Jan 5, 2026
Copy link
Member

@jabesq jabesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly just some nitpicking. I've reviewed only the bash scripts because I've no knowledge with batch scripting

echo -e "\033[32mFound pydantic-settings and/or connectors-sdk in requirements. Proceeding with schema generation...\033[0m"
# If not found in requirements.txt and pyproject.toml exists, try to find connectors-sdk in pyproject.toml
has_required_dependency=false
if grep -qE 'pydantic-settings|connectors-sdk' "$requirements_file"; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: requirements.txt could not be present if all the requirements are defined in the pyproject.toml

Suggested change
if grep -qE 'pydantic-settings|connectors-sdk' "$requirements_file"; then
if [[ -n "$requirements_file" ]] &&grep -qE 'pydantic-settings|connectors-sdk' "$requirements_file"; then

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, every connectors must have a requirements.txt to be compatible with our CI. Plus, the presence of requirements.txt is already checked on line 233.

# Check if requirements file contains pydantic-settings or connectors-sdk dependency
# If not found in requirements.txt and pyproject.toml exists, try to find connectors-sdk in pyproject.toml
has_required_dependency=false
if grep -qE 'pydantic-settings|connectors-sdk' "$requirements_file"; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: requirements.txt could not be present if all the requirements are defined in the pyproject.toml

Suggested change
if grep -qE 'pydantic-settings|connectors-sdk' "$requirements_file"; then
if [[ -n "$requirements_file" ]] && grep -qE 'pydantic-settings|connectors-sdk' "$requirements_file"; then

Copy link
Member Author

@Powlinett Powlinett Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, every connectors must have a requirements.txt to be compatible with our CI.

python -m pip install -qq -r "$requirements_file"

# Return to original working directory
cd "$original_dir"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: If you navigate within a single directory, you can use cd - to return to the previous folder without storing the path in a variable. If you navigate to multiple folders, you can use the pushd and popd commands.

jabesq
jabesq previously approved these changes Jan 7, 2026
Copy link
Member

@jabesq jabesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Powlinett Powlinett force-pushed the fix/4857-update-config-json-schema-generation-scripts branch from e0fdf89 to 88d68a0 Compare January 7, 2026 13:14
jabesq
jabesq previously approved these changes Jan 7, 2026
@Powlinett Powlinett added the do not merge Do not merge this PR until this tag will be removed label Jan 7, 2026
@Powlinett Powlinett dismissed jabesq’s stale review January 7, 2026 16:17

I was wrong, some connectors don't have requirements.txt file, need to rework my fixes.

@Powlinett Powlinett force-pushed the fix/4857-update-config-json-schema-generation-scripts branch from 4fa98ec to fa9ff73 Compare January 8, 2026 10:48
@Powlinett Powlinett force-pushed the fix/4857-update-config-json-schema-generation-scripts branch from fa9ff73 to a72510f Compare January 8, 2026 12:24
@Powlinett Powlinett removed the do not merge Do not merge this PR until this tag will be removed label Jan 8, 2026
@Powlinett Powlinett requested a review from jabesq January 8, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

composer filigran team use to identify PR from the Filigran team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants