Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@VietND96
Copy link
Member

@VietND96 VietND96 commented Dec 27, 2025

User description

Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Enhancement


Description

  • Fix Makefile indentation inconsistency using tabs

  • Add Python virtual environment setup target

  • Make install_python_deps depend on venv creation


Diagram Walkthrough

flowchart LR
  A["Makefile formatting"] --> B["Tab indentation fixed"]
  C["New venv target"] --> D["install_python_venv"]
  D --> E["install_python_deps"]
  E --> F["Python dependencies installed"]
Loading

File Walkthrough

Relevant files
Enhancement
Makefile
Fix indentation and add venv setup target                               

Makefile

  • Fixed indentation in setup_dev_env target from spaces to tabs for
    consistency
  • Added new install_python_venv target to create Python virtual
    environment
  • Made install_python_deps depend on install_python_venv for proper
    initialization order
  • Ensures virtual environment is activated before installing
    dependencies
+7/-3     

@qodo-code-review
Copy link
Contributor

CI Feedback 🧐

A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

Action: Lint scripts format

Failed stage: Lint format [❌]

Failed test name: ""

Failure summary:

The action failed during make lint_format_scripts because the Makefile target install_python_venv
(Makefile:92) ran source .venv/bin/activate under /bin/sh, and /bin/sh does not support the source
builtin.
- Log evidence: /bin/sh: 2: source: not found
- This caused make to exit with Error 127,
and the job failed with exit code 2.

Relevant error logs:
1:  ##[group]Runner Image Provisioner
2:  Hosted Compute Agent
...

46:  ssh-strict: true
47:  ssh-user: git
48:  persist-credentials: true
49:  clean: true
50:  sparse-checkout-cone-mode: true
51:  fetch-depth: 1
52:  fetch-tags: false
53:  show-progress: true
54:  lfs: false
55:  submodules: false
56:  set-safe-directory: true
57:  env:
58:  GH_CLI_TOKEN: ***
59:  GH_CLI_TOKEN_PR: ***
60:  RUN_ID: 20543258434
61:  RERUN_FAILED_ONLY: true
62:  RUN_ATTEMPT: 1
...

128:  git switch -c <new-branch-name>
129:  Or undo this operation with:
130:  git switch -
131:  Turn off this advice by setting config variable advice.detachedHead to false
132:  HEAD is now at d44dead Merge a34bf13a615dec958b3909c9e8d44ff897c47b87 into 3b8e797d9d2e1840de730e87ab07d9014742a1e1
133:  ##[endgroup]
134:  [command]/usr/bin/git log -1 --format=%H
135:  d44dead363db79a875bc04ff165fbd52805bc396
136:  ##[group]Run make lint_format_scripts
137:  �[36;1mmake lint_format_scripts�[0m
138:  shell: /usr/bin/bash -e {0}
139:  env:
140:  GH_CLI_TOKEN: ***
141:  GH_CLI_TOKEN_PR: ***
142:  RUN_ID: 20543258434
143:  RERUN_FAILED_ONLY: true
144:  RUN_ATTEMPT: 1
145:  ##[endgroup]
146:  python3 -m venv .venv ; \
147:  source .venv/bin/activate
148:  /bin/sh: 2: source: not found
149:  make: *** [Makefile:92: install_python_venv] Error 127
150:  ##[error]Process completed with exit code 2.
151:  Post job cleanup.

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Dec 27, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

🔴
Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Venv not applied: The new install_python_venv target activates the venv in its own shell, but
install_python_deps runs in a separate shell so dependencies may still install into the
system environment instead of the created venv.

Referred Code
install_python_deps: install_python_venv
	python3 -m pip install -r tests/requirements.txt --break-system-packages

install_python_venv:
	python3 -m venv .venv ; \
	source .venv/bin/activate

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Dec 27, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Correctly use the virtual environment

Fix the virtual environment usage by removing the ineffective source command and
calling the venv's Python executable directly in install_python_deps. This
allows for the safe removal of the --break-system-packages flag.

Makefile [88-93]

 install_python_deps: install_python_venv
-	python3 -m pip install -r tests/requirements.txt --break-system-packages
+	.venv/bin/python3 -m pip install -r tests/requirements.txt
 
 install_python_venv:
-	python3 -m venv .venv ; \
-	source .venv/bin/activate
+	python3 -m venv .venv
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: This suggestion correctly identifies a fundamental flaw where source is ineffective in a Makefile recipe, causing dependencies to be installed globally. The proposed fix is comprehensive, using the venv's Python executable and removing the now-unnecessary --break-system-packages flag, which significantly improves the correctness and safety of the script.

High
General
Add PHONY declarations

Declare the install_python_venv and install_python_deps targets as .PHONY to
ensure make always executes their recipes regardless of whether files with those
names exist.

Makefile [88]

-install_python_deps: install_python_venv
+.PHONY: install_python_venv install_python_deps
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: This suggestion correctly recommends declaring Makefile targets as .PHONY to prevent conflicts with files of the same name. This is a standard best practice that improves the robustness and predictability of the Makefile.

Low
  • Update

Signed-off-by: Viet Nguyen Duc <[email protected]>
@VietND96 VietND96 merged commit 8efe84e into trunk Dec 28, 2025
82 of 85 checks passed
@VietND96 VietND96 deleted the fix-lint branch December 28, 2025 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants