Avatar url#8
Conversation
|
Warning Review limit reached
More reviews will be available in 48 minutes and 47 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughBumps the project to v1.0.5, adds a manual release trigger and release SHA/tag extraction in GitHub Actions with a Scoop updater job, refreshes AUR/Homebrew/Scoop manifests and bundled resources, and simplifies avatar cache refresh to re-download when stale without URL-change checks. ChangesVersion 1.0.5 Release and Package Manager Updates
Avatar Cache Refresh Simplification
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
hubfetch/cache.py (1)
66-66: ⚡ Quick winReplace the inline profane comment with neutral rationale.
Line 66 uses profanity; please swap it for a short professional note describing why unconditional refresh is intentional.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@hubfetch/cache.py` at line 66, Replace the profane inline comment "turns out GitHub avatar urls don't change so fuck this shit honestly" in hubfetch/cache.py with a short, neutral rationale explaining that GitHub avatar URLs are stable so an unconditional refresh is intentional (e.g., "GitHub avatar URLs are stable; skip conditional refresh to simplify caching"). Update the comment near the existing avatar/cache logic to briefly state the reason for the unconditional refresh and maintain professional tone.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build.yml:
- Around line 7-12: The workflow defines workflow_dispatch.inputs.version but
the release step (softprops/action-gh-release@v2) doesn't use it, so the action
falls back to github.ref_name; update the release step to pass the user-provided
input as the tag by setting the action input tag_name to the dispatch input (use
github.event.inputs.version), e.g. add tag_name: ${{ github.event.inputs.version
}} (and optionally use the same input for name/release_name) so the created
release uses the chosen version.
In `@contrib/scoop/hubfetch.json`:
- Line 8: The Scoop manifest contains an empty "hash" field which disables
integrity validation; compute the correct SHA256 of the distributed hubfetch.exe
(the released binary referenced by the manifest) and replace the empty string in
the "hash" JSON property with that hex SHA256 value so the manifest's "hash"
entry contains the correct checksum for hubfetch.exe.
In `@hubfetch/cache.py`:
- Around line 67-70: The code updates cache metadata (meta.update and _save_json
with META_FILE) immediately after calling _download_avatar(current_avatar_url,
dest), which means a failed download still marks avatar_last_checked and
suppresses retries; change this so the metadata is only updated when
_download_avatar succeeds: wrap the download call to detect success (either by
its return value or by catching exceptions from _download_avatar), log or handle
the failure without touching meta, and only perform meta.update({"avatar_url":
current_avatar_url, "avatar_last_checked": now}) and _save_json(META_FILE, meta)
when the download completed successfully (referencing _download_avatar,
meta.update, _save_json, META_FILE, avatar_last_checked, current_avatar_url).
---
Nitpick comments:
In `@hubfetch/cache.py`:
- Line 66: Replace the profane inline comment "turns out GitHub avatar urls
don't change so fuck this shit honestly" in hubfetch/cache.py with a short,
neutral rationale explaining that GitHub avatar URLs are stable so an
unconditional refresh is intentional (e.g., "GitHub avatar URLs are stable; skip
conditional refresh to simplify caching"). Update the comment near the existing
avatar/cache logic to briefly state the reason for the unconditional refresh and
maintain professional tone.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ec8396da-cb32-41cd-9d7a-90354103e2e6
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
.github/workflows/build.ymlcontrib/aur/PKGBUILDcontrib/homebrew/homebrew.rbcontrib/scoop/hubfetch.jsonhubfetch/cache.pypyproject.toml
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.github/workflows/build.yml (1)
58-81: ⚡ Quick winConsider adding error handling and validation to the Scoop update job.
The
update-scoopjob runs unconditionally after the release job succeeds, but it doesn't validate that:
- The jq patch succeeded
- The modified JSON is valid
- There are actual changes to commit (git commit will fail if nothing changed)
♻️ Proposed improvements
- name: Patch hubfetch.json run: | TAG="${{ needs.release.outputs.tag }}" jq --arg ver "${TAG#v}" \ --arg url "https://github.com/PranavU-Coder/hubfetch/releases/download/${TAG}/hubfetch.exe" \ --arg sha "${{ needs.release.outputs.sha256 }}" \ '.version=$ver | .architecture."64bit".url=$url | .architecture."64bit".hash=$sha' \ bucket/hubfetch.json > tmp.json && mv tmp.json bucket/hubfetch.json + # Validate the patched JSON + jq empty bucket/hubfetch.json - run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]`@users.noreply.github.com`" git add bucket/hubfetch.json - git commit -m "update hubfetch to ${{ needs.release.outputs.tag }}" + # Only commit if there are changes + git diff --staged --quiet || git commit -m "update hubfetch to ${{ needs.release.outputs.tag }}" git push🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/build.yml around lines 58 - 81, The update-scoop job's Patch hubfetch.json step should add explicit error handling and validation: ensure the jq patch command (invoked in the "Patch hubfetch.json" step) exits successfully and aborts the job if it fails, validate the resulting JSON (e.g., run jq . on the produced bucket/hubfetch.json to confirm it's well-formed) and only attempt git add/commit/push if there are actual changes (check with git diff --quiet or git status to skip the commit when nothing changed); modify the commands around the jq invocation and the git commit block to perform these checks and bail out with a clear error if validation fails.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build.yml:
- Line 50: Check for the existence of the Windows artifact before computing its
hash: wrap the sha256sum invocation for "artifacts/hubfetch.exe" in a
conditional that tests the file (e.g., using a POSIX test like [ -f
"artifacts/hubfetch.exe" ]) and only run the echo "sha256=..." >>
"$GITHUB_OUTPUT" when the file exists; if missing, either skip writing the
output or write a safe fallback value so the workflow step does not fail. Target
the step that currently runs echo "sha256=$(sha256sum artifacts/hubfetch.exe |
awk '{print $1}')" and add the existence check around that command.
- Around line 47-49: The TAG selection currently favors github.ref_name and
unquotes template expansions, causing wrong tags for manual dispatch and a
template-injection risk; change logic to prefer the workflow_dispatch input when
present (set TAG to github.event.inputs.version if non-empty, otherwise to
github.ref_name) and always quote the expanded expressions to avoid injection
(use quoted expansions for TAG and when writing to GITHUB_OUTPUT), referencing
the TAG variable, github.event.inputs.version, github.ref_name and GITHUB_OUTPUT
from the diff.
- Around line 69-74: The job is injecting GitHub expression values into the
shell unquoted; assign them to quoted shell variables (e.g. TAG and SHA) using
TAG="${{ needs.release.outputs.tag }}" and SHA="${{ needs.release.outputs.sha256
}}", then reference the variables in the jq call with quoted expansions (e.g.
--arg ver "${TAG#v}" --arg url "https://.../${TAG}/hubfetch.exe" --arg sha
"${SHA}"), so all template expansions are protected from shell word-splitting
and injection.
- Line 80: The commit command embeds the output directly which can lead to
template/argument injection; update the git commit invocation (the line
containing git commit -m "update hubfetch to ${{ needs.release.outputs.tag }}")
to safely quote and terminate options, e.g. include the tag inside single quotes
within the message and add -- to end options: git commit -m "update hubfetch to
'${{ needs.release.outputs.tag }}'" -- so the tag is treated as data, not
shell/cli input.
---
Nitpick comments:
In @.github/workflows/build.yml:
- Around line 58-81: The update-scoop job's Patch hubfetch.json step should add
explicit error handling and validation: ensure the jq patch command (invoked in
the "Patch hubfetch.json" step) exits successfully and aborts the job if it
fails, validate the resulting JSON (e.g., run jq . on the produced
bucket/hubfetch.json to confirm it's well-formed) and only attempt git
add/commit/push if there are actual changes (check with git diff --quiet or git
status to skip the commit when nothing changed); modify the commands around the
jq invocation and the git commit block to perform these checks and bail out with
a clear error if validation fails.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3ded8b28-5c3f-419a-90d6-4db1b815e409
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
.github/workflows/build.ymlcontrib/aur/PKGBUILDcontrib/homebrew/homebrew.rbcontrib/scoop/hubfetch.jsonhubfetch/cache.pypyproject.toml
✅ Files skipped from review due to trivial changes (1)
- pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (1)
- hubfetch/cache.py
|
I don't have the patience to deal with these bullshit rate limits, go fuck yourself @coderabbitai |
|
Tip For best results, initiate chat on the files or code changes.
If there's anything I can help with on this PR — the avatar URL caching changes, the workflow updates, or anything else — just let me know when you're ready. I'm here to help. 🐇 (´• ω •`) ♡ |
Please describe the changes this PR makes and why it should be merged:
Status and versioning classification:
Summary by CodeRabbit
Bug Fixes
Chores