Skip to content

aider: Add Playwright support and cleanup logic #6

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

Merged
merged 5 commits into from
Dec 20, 2024

Conversation

ivy
Copy link
Owner

@ivy ivy commented Dec 20, 2024

This pull request enables Aider's web scraping functionality by installing Playwright and its browser dependencies. Users can enable or disable Playwright install and select which browsers they want to install, if any.

Changes

  1. Playwright Support:
    • Introduced Playwright installation logic in install.sh.
    • Enabled configuration of Playwright and browser selection via devcontainer-feature.json.
  2. Improved Installation Script:
    • Refactored logic to improve modularity and maintainability.
    • Implemented OS-specific and user-detection logic.
  3. Testing:
    • Expanded scenarios.json to include tests for Playwright and browser installs.
    • Added new scripts:
      • without_playwright.sh to test that Playwright install can be disabled.
      • with_playwright_browsers.sh to validate the successful installation of specific browsers.
  4. Cache Management:
    • Added a clean_up function and Debian/Ubuntu detection to purge apt lists and pipx cache.
  5. Changelog Introduction:
    • Added a CHANGELOG.md following the Keep a Changelog format for better documentation and release tracking.

- Added a changelog (`CHANGELOG.md`) using the Keep a Changelog format.
- Introduced support for Playwright installation and browser selection
  in `devcontainer-feature.json`.
- Updated `install.sh` to include:
  - Installation of Playwright and specified browsers.
  - Cleanup of caches and temporary files for improved efficiency.
  - Refactored logic for user detection and OS-specific adjustments.
- Improved modularity and maintainability of the installation script.
@ivy ivy requested a review from Copilot December 20, 2024 06:44
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • src/aider/devcontainer-feature.json: Language not supported
  • src/aider/install.sh: Language not supported

ivy added 4 commits December 20, 2024 06:51
- Adjusted `as_user` function to ensure `pipx` commands work reliably by
  consistently sourcing the user's bash configuration with `PS1=true`.
- Replaced redundant comments with a single, consolidated explanation of
  the `PS1=true` workaround.
- Addressed a bug from the previous refactoring that caused inconsistent
  behavior in non-root installations.

This change ensures reliable execution of Aider installation in non-interactive environments.
This path is actually where browsers are downloaded and stored, so it
shouldn't be removed.
- Updated `install.sh` to handle Playwright browser installation
  more robustly:
  - Added logic to split `INSTALLPLAYWRIGHTBROWSERS` into an array.
- Enhanced test coverage:
  - Modified `scenarios.json` to include a new test case for Playwright
    browser installation (`with_playwright_browsers`).
  - Added `with_playwright_browsers.sh` to validate the installation of
    specified browsers (e.g., Chromium, Firefox).
@ivy ivy merged commit 069a8ce into main Dec 20, 2024
6 checks passed
@ivy ivy deleted the feature/playwright-support branch December 20, 2024 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant