-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Ci/setup pipeline #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Ci/setup pipeline #149
Conversation
- Add Black and isort hooks for Python formatting on commit - Add YAML linting via adrienverge/yamllint (commit stage) - Configure flake8 and mypy to run on push - Update installation scripts to include development dependencies - Add GitHub Actions workflow (`.github/workflows/ci.yml`) for automated CI
- Run pre-commit hooks to auto-format and lint existing files - Apply Black formatting and isort import sorting - Fix trailing whitespace, EOF newlines and YAML style issues - Ensure codebase consistency after integrating new hooks
- Update GitHub Actions CI workflow (.github/workflows/ci.yaml) - Refine pre-commit hooks (.pre-commit-config.yaml) - Add YAML linting config (.yamllint) - Add Black/isort settings in pyproject.toml - Update development dependencies (requirements-dev.txt) - Adjust API and CLI entrypoints (api.py, cli.py) - Tweak Docker setup (docker-compose.yml) - Refactor LLM provider integration (sources/llm_provider.py)
Before to run the new CI and pre-commit setup, please be aware that our codebase currently has a number of outstanding lint issues.
Running the full CI pipeline will almost certainly cause builds to fail initially. I’ll be cleaning up long lines, removing dead code, and fixing tests in follow-up commits. Thanks for your patience! |
ooooohjhhhh this is git saboteur |
@itJunky Why do you say ‘git saboteur’? I’d appreciate better feedback on the PR and the discussion constructive |
Review SummarySkipped posting 18 drafted comments based on your review threshold. Feel free to update them here. Draft CommentsDockerfile.backend:48-48
Scores:
Reason for filtering: The issue of missing a newline at the end of a Dockerfile is a minor style concern with minimal production impact. While it follows best practices, it doesn't affect functionality in most cases. Analysis: This comment addresses a style issue with a clear fix but has minimal production impact. Missing a newline at the end of a Dockerfile rarely causes actual problems in production environments. The fix is very specific and easy to implement, but the urgency is very low as this won't affect system functionality. With a total score of 7, which is below the threshold of 13, this comment should be removed. cli.py:108-109
Scores:
Reason for filtering: This comment addresses a minor style issue with no significant production impact. Missing a newline at the end of a file is a formatting convention that most modern tools handle gracefully. Analysis: The issue is purely stylistic with minimal production impact. While the fix is very clear and specific, the urgency is very low as this won't affect functionality. Total score of 7 falls below the required threshold of 13. frontend/agentic-seek-front/public/index.html:14-15
Scores:
Reason for filtering: The comment about missing a newline at the end of file is a minor style issue with minimal production impact, clear but trivial fix, and very low urgency. The total score is below the threshold of 13. Analysis: Missing newline at EOF is a style convention that won't affect functionality. The fix is extremely clear (add a newline), but this is purely cosmetic with no real production impact or urgency. Total score of 7 is well below the threshold of 13. sources/agents/agent.py:157-157
Scores:
Reason for filtering: This is a simple typo correction with minimal production impact that doesn't meet the threshold score for inclusion. Analysis: The comment addresses a simple spelling error in a user-facing message. While the fix is very specific and straightforward, the typo has minimal impact on production functionality and very low urgency. The total score of 7 falls well below the required threshold of 13 for inclusion. sources/agents/browser_agent.py:406-413
Scores:
Reason for filtering: The total score is below the threshold of 13 required for inclusion Analysis: While using 'is None' is more Pythonic than '== None', the actual production impact is low as most strings won't have custom eq methods that would cause issues. The fix is very specific and directly applicable, but the urgency is low since this is primarily a code style improvement with minimal risk of actual runtime issues. sources/memory.py:181-181
Scores:
Reason for filtering: The comment identifies a legitimate bug where string.replace() doesn't modify the original string in-place, which could lead to functional issues. Analysis: This is a correctness issue that would cause the summarize method to not work as intended. The bug is that string.replace() returns a new string rather than modifying in-place, so the summary variable isn't being updated. The fix is clear and directly applicable (assign the result back to the variable). This would likely cause functional issues in production as the summary text wouldn't be properly processed, affecting downstream functionality. sources/memory.py:108-108
Scores:
Reason for filtering: The comment identifies a legitimate bug with mutable default arguments in Python that can cause unexpected behavior Analysis: This is a well-known Python pitfall where mutable default arguments are initialized once at function definition time, not at each call. This can cause unexpected behavior when the default list is modified across multiple calls, potentially leading to data corruption or unexpected state. The fix is specific, correct, and immediately applicable. While not causing immediate crashes, this issue can lead to subtle bugs that are hard to debug in production. sources/memory.py:109-110
Scores:
Reason for filtering: The comment identifies a legitimate bug where the reset method doesn't handle None values for memory parameter, which could lead to runtime errors. Analysis: This is a correctness issue that could cause runtime errors when memory is None. The fix is clear, specific and directly applicable. The issue should be addressed soon to prevent potential crashes when the reset method is called with None. sources/memory.py:28-29
Scores:
Reason for filtering: The comment identifies a valid code issue with a clear fix Analysis: The issue is a redundant initialization that doesn't affect functionality but creates unnecessary code. The fix is extremely clear and directly applicable. While it's not causing production issues, it's a legitimate code improvement. However, the total score of 9 is below the threshold of 13, so this comment would be filtered out under the current rules. sources/schemas.py:46-76
Scores:
Reason for filtering: This is a style-only issue with minimal production impact. The comment addresses Python naming conventions (PEP 8) for class names, which should use CamelCase. While the fix is clear and specific, this type of style issue has no impact on functionality or production stability. Analysis: The comment addresses a PEP 8 style violation for class naming. While the fix is extremely clear and specific (changing 'executorResult' to 'ExecutorResult'), this is purely a style issue with no functional impact on production systems. The urgency is very low as this is just a cosmetic improvement. With a total score of 7, which is below the threshold of 13, this comment should be removed. sources/speech_to_text.py:331-332
Scores:
Reason for filtering: The issue is a minor formatting problem with no functional impact on the code. The missing newline at the end of file is a stylistic convention but doesn't affect code execution or functionality. Analysis: This comment addresses a missing newline at the end of file, which is purely stylistic. While the fix is very specific and clear, it has minimal production impact and very low urgency. The total score of 7 falls below the required threshold of 13. sources/tools/BashInterpreter.py:29-43
Scores:
Reason for filtering: The comment identifies a legitimate issue with duplicate entries in a list that could cause redundant checks and inefficiency. Analysis: The duplicate entries for 'rustc' and 'rustc++' in the list will cause redundant checks when detecting language execution attempts, which could lead to inefficiency but not critical failures. The fix is extremely clear and directly applicable - simply remove the duplicate entries. While this is a correctness issue, it's not likely to cause immediate system failures, just unnecessary processing. With a total score of 11, this falls below the threshold of 13 required to be included. sources/tools/__init__.py:5-14
Scores:
Reason for filtering: The total score is below the threshold of 13 required for inclusion Analysis: Duplicate entry in all causes a warning but not a critical failure. The fix is extremely clear and specific. While this should be fixed, it's not urgent as it only causes a warning at runtime and minor confusion for module users. sources/tools/fileFinder.py:64-74
Scores:
Reason for filtering: The issue is a minor duplication in a list of file extensions that would only cause redundant checks during filtering, with minimal production impact. Analysis: The duplicate '.so' entry in the excluded_files list would only cause redundant checks during file filtering, which is inefficient but would not cause any functional issues or crashes in production. The fix is extremely clear and specific (just remove the duplicate entry). However, this is a very low urgency issue as the redundant check would have minimal performance impact and wouldn't cause any system failures. With a total score of 7, this falls well below the threshold of 13 required for inclusion. sources/tools/safety.py:87-89
Scores:
Reason for filtering: The total score is below the threshold of 13 required to keep the comment Analysis: This is a minor style issue about missing a newline at the end of a file. While the fix is very clear and specific (adding a newline), it has minimal production impact and very low urgency. Most modern tools handle this gracefully, and it won't cause functional problems in the code execution. sources/tools/webSearch.py:32-39
Scores:
Reason for filtering: The issue is a minor style concern about a trailing comma in a Python list, which has no functional impact in Python 3. The total score is below the required threshold of 13. Analysis: This is a purely stylistic issue with trailing commas in Python lists. Python 3 fully supports trailing commas, so there's no functional impact. The fix is very clear and specific, but the urgency and production impact are minimal as this won't cause any runtime issues. sources/tools/webSearch.py:87-91
Scores:
Reason for filtering: The comment addresses a trailing comma in a Python dictionary which is valid syntax in all modern Python versions and is a minor style issue with no production impact. Analysis: Trailing commas in dictionaries are valid in Python 2.7+ and actually considered good practice in many style guides as they make diffs cleaner when adding new items. This is purely a style preference with no functional impact. The fix is very specific but addresses a non-issue that doesn't affect production or require urgent attention. sources/tools/webSearch.py:93-93
Scores:
Reason for filtering: This comment addresses a minor style issue with no functional impact. The suggested change from 'if not "OK" in status:' to 'if "OK" not in status:' is purely stylistic and doesn't affect program behavior. Analysis: This is a purely stylistic change with no impact on functionality. While the fix is very clear and specific (5), it has minimal production impact (1) and very low urgency (1). The total score of 7 is well below the threshold of 13, so this comment should be removed. |
WalkthroughThis PR focuses on codebase quality, maintainability, and developer tooling. It introduces a comprehensive CI pipeline, standardizes code formatting and linting via pre-commit and related tools, and applies extensive code style refactoring across Python, JavaScript, and documentation files. Minor logic improvements and bug fixes are included in agent and browser modules, while most changes are non-functional, targeting whitespace, import order, and formatting. New configuration files for development and CI are added, and installation scripts are updated to support dev dependencies, enhancing the developer experience and code consistency. Changes
Sequence DiagramThis diagram shows the interactions between components: sequenceDiagram
title API Key Configuration and Usage Flow
actor User
participant App as "Application"
participant Config as "Configuration Service"
participant SearxNG as "SearxNG Search Service"
participant OpenAI as "OpenAI API"
participant DeepSeek as "DeepSeek API"
User->>App: Make request
App->>Config: Load configuration
activate Config
Config-->>App: Return API endpoints and keys
deactivate Config
Note over App,Config: Configuration now includes:<br/>- SEARXNG_BASE_URL<br/>- OPENAI_API_KEY<br/>- DEEPSEEK_API_KEY (moved in PR)
alt Search request
App->>SearxNG: Query(SEARXNG_BASE_URL)
SearxNG-->>App: Search results
else OpenAI request
App->>OpenAI: API call with OPENAI_API_KEY
OpenAI-->>App: AI response
else DeepSeek request
App->>DeepSeek: API call with DEEPSEEK_API_KEY
DeepSeek-->>App: AI response
end
App-->>User: Return response
Note for WindsurfPlease change the default marketplace provider to the following in the windsurf settings:Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts belowEmoji Descriptions:
Interact with the Bot:
Also you can trigger various commands with the bot by doing The current supported commands are
More commands to be added soon. |
tests: | ||
runs-on: ubuntu-latest | ||
needs: pre-commit | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install pytest | ||
|
||
- name: Run tests | ||
run: | | ||
pytest --maxfail=1 --disable-warnings -q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: The tests
job is missing proper YAML indentation, causing it to be parsed as a top-level key rather than a job under the jobs
section.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
tests: | |
runs-on: ubuntu-latest | |
needs: pre-commit | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install pytest | |
- name: Run tests | |
run: | | |
pytest --maxfail=1 --disable-warnings -q | |
tests: | |
runs-on: ubuntu-latest | |
needs: pre-commit | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install pytest | |
- name: Run tests | |
run: | | |
pytest --maxfail=1 --disable-warnings -q |
tests: | ||
runs-on: ubuntu-latest | ||
needs: pre-commit | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install pytest | ||
|
||
- name: Run tests | ||
run: | | ||
pytest --maxfail=1 --disable-warnings -q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: The tests
job needs to be properly indented under the jobs
section to be recognized as a GitHub Actions job.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
tests: | |
runs-on: ubuntu-latest | |
needs: pre-commit | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install pytest | |
- name: Run tests | |
run: | | |
pytest --maxfail=1 --disable-warnings -q | |
tests: | |
runs-on: ubuntu-latest | |
needs: pre-commit | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install pytest | |
- name: Run tests | |
run: | | |
pytest --maxfail=1 --disable-warnings -q |
- name: Checkout code | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install pre-commit dependencies | ||
run: pip install -r requirements-dev.txt | ||
|
||
- name: Run all hooks | ||
uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --all-files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: The pre-commit
job steps need proper indentation to conform to GitHub Actions YAML syntax requirements.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Install pre-commit dependencies | |
run: pip install -r requirements-dev.txt | |
- name: Run all hooks | |
uses: pre-commit/[email protected] | |
with: | |
extra_args: --all-files | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Install pre-commit dependencies | |
run: pip install -r requirements-dev.txt | |
- name: Run all hooks | |
uses: pre-commit/[email protected] | |
with: | |
extra_args: --all-files |
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: trailing-whitespace # remove trailing whitespace | ||
stages: [pre-commit] | ||
- id: end-of-file-fixer # ensure a newline at end of file | ||
stages: [pre-commit] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security: The TruffleHog secret scanning hook has been completely removed, which eliminates an important security check that was previously running on both commit and push stages.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
# General quick fixes before every commit | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v5.0.0 | |
hooks: | |
- id: trailing-whitespace # remove trailing whitespace | |
stages: [pre-commit] | |
- id: end-of-file-fixer # ensure a newline at end of file | |
stages: [pre-commit] | |
# Secret scanning to prevent accidental credential leaks | |
- repo: https://github.com/trufflesecurity/trufflehog | |
rev: v3.63.2 | |
hooks: | |
- id: trufflehog # detect secrets in your data | |
stages: [commit, push] | |
args: [--only-verified] |
return JSONResponse(status_code=200, content=query_resp_history[-1]) | ||
return JSONResponse(status_code=404, content={"error": "No answer available"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: The get_latest_answer
function has two return statements in sequence, making the second one unreachable. The second return statement should be inside the else branch of the preceding if condition.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
return JSONResponse(status_code=200, content=query_resp_history[-1]) | |
return JSONResponse(status_code=404, content={"error": "No answer available"}) | |
return JSONResponse(status_code=200, content=query_resp_history[-1]) | |
else: | |
return JSONResponse(status_code=404, content={"error": "No answer available"}) |
with open(self.cache_file, "r") as f: | ||
self.cache = set(json.load(f)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: The cache is initialized as a set
from a JSON list, but later saved back as a set which is not JSON serializable. This will cause a TypeError: Object of type set is not JSON serializable
when _save()
is called.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
with open(self.cache_file, "r") as f: | |
self.cache = set(json.load(f)) | |
with open(self.cache_file, "r") as f: | |
self.cache = json.load(f) |
except AuthenticationError: | ||
raise AuthenticationError("Authentication failed. Please check your token.") from e | ||
raise AuthenticationError( | ||
"Authentication failed. Please check your token." | ||
) from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: Missing e
variable in except AuthenticationError:
block which causes a NameError when this exception is raised. The exception handler references e
but it's not captured in the except clause.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
except AuthenticationError: | |
raise AuthenticationError("Authentication failed. Please check your token.") from e | |
raise AuthenticationError( | |
"Authentication failed. Please check your token." | |
) from e | |
except AuthenticationError as e: | |
raise AuthenticationError( | |
"Authentication failed. Please check your token." | |
) from e |
result = { | ||
"filename": os.path.basename(file_path), | ||
"path": file_path, | ||
"type": file_type, | ||
"read": content, | ||
"permissions": permissions | ||
"permissions": permissions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: The permissions
variable is used in the result dictionary but is not defined anywhere in the get_file_info
method.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
"permissions": permissions, | |
"permissions": stat.filemode(stats.st_mode), |
def execute(self, blocks: str, safety: bool = True) -> str: | ||
if self.api_key is None: | ||
return "Error: No AviationStack API key provided." | ||
|
||
for block in blocks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: The execute
method is iterating over blocks
as if it's a list of strings, but the parameter is defined as a string. This will cause a TypeError at runtime when trying to iterate over a string character by character.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
def execute(self, blocks: str, safety: bool = True) -> str: | |
if self.api_key is None: | |
return "Error: No AviationStack API key provided." | |
for block in blocks: | |
def execute(self, blocks: list[str], safety: bool = True) -> str: | |
if self.api_key is None: | |
return "Error: No AviationStack API key provided." | |
for block in blocks: |
def set_allow_language_exec_bash(value: bool) -> None: | ||
self.allow_language_exec_bash = value | ||
|
||
self.allow_language_exec_bash = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correctness: The set_allow_language_exec_bash
method is missing the self
parameter, which will cause a runtime error when called. The method needs self
as its first parameter since it's an instance method.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
def set_allow_language_exec_bash(value: bool) -> None: | |
self.allow_language_exec_bash = value | |
self.allow_language_exec_bash = value | |
def set_allow_language_exec_bash(self, value: bool) -> None: | |
self.allow_language_exec_bash = value |
This is the project’s continuous integration and code quality checks: