-
Notifications
You must be signed in to change notification settings - Fork 808
chore(ci): reduce disk space usage #3288
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
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Caution Review failedThe pull request is closed. WalkthroughConfigures Poetry for CI, adds caching for Poetry, Nx, and optional pip, extends cache keys (OS and Python), and adds cleanup steps to remove Python bytecode/artifacts across CI jobs and release workflows. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Job as GitHub Actions Job
participant Node as Node setup
participant Po as Poetry
participant Cache as Cache service
participant Python as Python setup / pip
participant Steps as Lint/Build/Test
Job->>Po: Install Poetry
Job->>Po: Configure Poetry (virtualenvs disabled)
Job->>Node: Setup Node
Job->>Cache: Restore Nx cache (.nx/cache)
Job->>Cache: Restore Poetry cache (~/.cache/pypoetry)
Job->>Python: Setup Python (matrix)
Job->>Cache: Restore pip cache (~/.cache/pip) [tests only]
Job->>Po: Install dependencies (poetry install)
Job->>Steps: Run lint/build/test
Job->>Cache: Save/update caches (Poetry, Nx, pip)
Job->>Job: Cleanup artifacts (*.pyc, __pycache__) (always)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Important
Looks good to me! 👍
Reviewed everything up to 266a65a in 48 seconds. Click for details.
- Reviewed
239
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
4
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/ci.yml:41
- Draft comment:
Consider extracting the repeated 'Configure Poetry for CI optimization' commands into a reusable workflow or action to reduce duplication. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
2. .github/workflows/ci.yml:71
- Draft comment:
The 'Clean up build artifacts' step is duplicated in multiple jobs. Consider centralizing this cleanup logic to simplify maintenance. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
3. .github/workflows/release.yml:66
- Draft comment:
The 'Configure Poetry for CI optimization' step is repeated here. Consider abstracting it into a shared reusable step to avoid repetition. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
4. .github/workflows/release.yml:162
- Draft comment:
The 'Clean up build artifacts' step is repeated in the release job. Consider reusing a centralized cleanup action to reduce redundancy. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
Workflow ID: wflow_WY4puMgTutu7qage
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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.
Actionable comments posted: 4
🔭 Outside diff range comments (1)
.github/workflows/ci.yml (1)
210-216
: Don’t clear Poetry cache here either (will defeat caching)Clearing ~/.cache/pypoetry before the cache is saved negates cache benefits.
find . -name "*.pyc" -delete find . -name "__pycache__" -type d -exec rm -rf {} + || true - poetry cache clear pypi --all || true
🧹 Nitpick comments (3)
.github/workflows/release.yml (2)
71-78
: Include Python version in Poetry cache key for future-proofingWhile this job pins Python to 3.11, including the interpreter version in the cache key avoids accidental reuse if the runner’s Python version changes later.
Apply this diff:
- key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - poetry-${{ runner.os }}- + key: poetry-${{ runner.os }}-3.11-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ runner.os }}-3.11- + poetry-${{ runner.os }}-
137-144
: Include Python version in Poetry cache key (SDK release)Same reasoning as for instrumentations: safer to include the interpreter version.
- key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - poetry-${{ runner.os }}- + key: poetry-${{ runner.os }}-3.11-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ runner.os }}-3.11- + poetry-${{ runner.os }}-.github/workflows/ci.yml (1)
46-53
: Consider adding the Python version to the Poetry cache key for consistencyThe other jobs include Python version in the cache key. Adding it here improves consistency and prevents cross-interpreter reuse if the Python version changes.
- key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} - restore-keys: | - poetry-${{ runner.os }}- + key: poetry-${{ runner.os }}-3.11-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ runner.os }}-3.11- + poetry-${{ runner.os }}-
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.github/workflows/ci.yml
(5 hunks).github/workflows/release.yml
(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-17T15:06:48.093Z
Learnt from: CR
PR: traceloop/openllmetry#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T15:06:48.093Z
Learning: Use Poetry as the package manager; run all commands via `poetry run <command>`
Applied to files:
.github/workflows/release.yml
.github/workflows/ci.yml
🔇 Additional comments (13)
.github/workflows/release.yml (4)
66-70
: Poetry config for CI looks goodDisabling Poetry-managed venvs in CI aligns with our preference to run tools directly and keeps environments simpler.
83-90
: Nx cache is fineKeying by OS and lockfile + nx.json is reasonable for artifact reuse between runs.
132-136
: Poetry config for CI looks good (SDK release)Same comment as above; good call disabling Poetry venvs for CI jobs.
149-156
: Nx cache is fine (SDK release)Configuration mirrors the instrumentations job; looks good.
.github/workflows/ci.yml (9)
41-45
: Poetry config for CI is appropriateDisabling Poetry venv creation keeps jobs lightweight and avoids nested env issues.
58-65
: Nx cache setup looks goodSolid choice of keys for restoring Nx local cache.
97-101
: Poetry config for CI is appropriate (Build Packages)Matches the pattern used elsewhere; good.
102-110
: Poetry cache key includes Python version — goodThis granularity prevents cross-version cache collisions.
115-122
: Nx cache setup looks good (Build Packages)No issues spotted.
164-168
: Poetry config for CI is appropriate (Test Packages)Consistent with other jobs.
169-177
: Poetry cache key includes Python version — goodLooks correct.
178-185
: Pip cache configuration looks fineGood to see OS + Python version + pyproject fingerprinting.
190-197
: Nx cache setup looks good (Test Packages)Keying logic matches other jobs; OK.
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.
Caution
Changes requested ❌
Reviewed f4532ed in 1 minute and 7 seconds. Click for details.
- Reviewed
48
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/release.yml:96
- Draft comment:
Check if cleanup should run on failures; removingif: always()
may leave build artifacts when earlier steps fail. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_mtItHI3CNanCfbgk
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
- run: npx nx affected -t install --with dev | ||
- run: npx nx affected -t lint --parallel=3 | ||
|
||
- name: Clean up build artifacts |
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.
Removing if: always()
may prevent cleanup from running on failure, leaving artifacts that can increase disk usage.
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.
Important
Looks good to me! 👍
Reviewed b274fc0 in 56 seconds. Click for details.
- Reviewed
45
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/ci.yml:73
- Draft comment:
Removed 'poetry cache clear pypi --all' from cleanup steps. Ensure that keeping the Poetry cache won’t lead to stale dependencies or unexpected disk buildup. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
2. .github/workflows/release.yml:97
- Draft comment:
Removed 'poetry cache clear pypi --all' from release jobs cleanup. Confirm that the caching strategy remains effective and that stale artifacts aren’t retained. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold50%
None
Workflow ID: wflow_RbaCNH0OeMqwjGjL
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
This reverts commit b0dfd92.
Important
Optimized CI and release workflows by adding caching and cleanup to reduce disk space usage and improve efficiency.
.github/workflows/ci.yml
to reduce setup time..pyc
files and__pycache__
directories post-build..github/workflows/release.yml
.This description was created by
for b274fc0. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit