-
Notifications
You must be signed in to change notification settings - Fork 0
Revert "CI: rework caching and build/test environment" #31
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
Conversation
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.
Summary of Changes
Hello @Harvester57, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request is a direct revert of a previous change that aimed to rework the CI's caching and build/test environment. Its purpose is to undo those specific modifications, restoring the CI setup to its state prior to the reverted pull request, thereby rolling back the recent changes to the CI workflow.
Highlights
- CI Configuration Reversion: This pull request reverts changes made to the CI's Python and Poetry setup, including the caching strategy for dependencies. It undoes the modifications introduced by the original PR #29, restoring the previous configuration.
- Poetry Installation Method Reverted: The method for installing Poetry has been reverted from using
pipx install poetryback to utilizing theabatilo/actions-poetryGitHub Action. - Dependency Caching Strategy Reverted: The custom caching strategy for Poetry dependencies, which involved using
actions/setup-pythonwithcache: poetryandcache-dependency-path, has been removed. The CI now relies on the previously established dedicatedactions/cachestep for~/.cache/pypoetrywith conditional dependency installation.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request reverts changes to the CI workflow for setting up the build and test environment. The restored code uses a manual caching approach with actions/cache. My review of the restored workflow file has identified a few issues that should be addressed to improve its correctness and robustness, including a Poetry version mismatch, a hardcoded cache path for Linux that will fail on Windows, and flawed logic for dependency installation.
| id: cache-deps | ||
| uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | ||
| with: | ||
| path: ~/.cache/pypoetry |
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.
The cache path is hardcoded to ~/.cache/pypoetry, which is the default for Linux. This will not work correctly on Windows runners, where the path is typically %LOCALAPPDATA%\pypoetry\Cache. Since this workflow is designed to support Windows, this will cause caching to fail on that platform.
To fix this, you should dynamically determine the cache directory after Poetry is installed. For example, you could add a step before this one to get the path:
- name: Get poetry cache directory
id: poetry-cache
run: echo "dir=$(poetry config cache-dir)" >> $GITHUB_OUTPUT
shell: bashThen, you can use path: ${{ steps.poetry-cache.outputs.dir }} in this step.
| - name: Install dependencies | ||
| run: poetry install --no-interaction --no-root | ||
| shell: ${{ env.shellos }} | ||
| if: steps.cache-deps.outputs.cache-hit != 'true' |
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.
This if condition causes the dependency installation to be skipped on a cache hit. However, the cache being used stores downloaded package artifacts, not the fully installed virtual environment. poetry install is still required to create the venv and install dependencies into it, even if the packages are already cached.
This logic is flawed:
- On a cache hit, this step is skipped, and the subsequent
Install projectstep must install all dependencies. - On a cache miss,
poetry installruns here and again in the next step, which is inefficient.
Consider removing this condition to make the workflow more robust and efficient.
| - name: Install Poetry | ||
| uses: abatilo/actions-poetry@65c61eae400c65c9510a584af85138c1ae19bbc0 # v3.0.2 | ||
| with: | ||
| poetry-version: 2.1.3 |
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.
The poetry.lock file indicates it was generated with Poetry version 2.1.1, but this step installs version 2.1.3. Using a different version of Poetry than the one used to generate the lock file can lead to unexpected behavior or dependency resolution issues. It's best practice to use the same version to ensure consistency and avoid potential problems.
poetry-version: 2.1.1
Reverts #29