Skip to content

fix(gifs): host celebration GIFs in repo to fix GitHub proxy rendering#1045

Merged
muddlebee merged 4 commits intomainfrom
fix/celebration-gifs-and-messages
Apr 28, 2026
Merged

fix(gifs): host celebration GIFs in repo to fix GitHub proxy rendering#1045
muddlebee merged 4 commits intomainfrom
fix/celebration-gifs-and-messages

Conversation

@muddlebee
Copy link
Copy Markdown
Collaborator

Fixes #

Community: Contributors hang out on Discord — OpenSRE (#contribute) for questions, reviews, and roadmap chatter.

Describe the changes you have made in this PR -

Follow-up to #1039. GitHub's camo image proxy inconsistently blocks Giphy hotlinks, causing GIFs to silently fail in bot comments.

  • 4 GIFs committed to .github/assets/celebrations/ — served directly by raw.githubusercontent.com (GitHub's own CDN, always reliable)
  • Dropped all Giphy URLs — no external dependency
  • Removed duplicate GIF (xT9IgG50Lg7russbCY == zGnnFpOB6s5oNa5VlZ, identical bytes)
  • 9 polished message templates — fun, varied, no weak/generic lines
  • Cleaner Discord footer — "hang out, contribute, or hunt for features and issues"

Demo/Screenshot for feature changes and bug fixes -

GIF assets live on this branch:


Code Understanding and AI Usage

Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?

  • Yes, I used AI assistance (continue below)

If you used AI assistance:

  • I have reviewed every single line of the AI-generated code
  • I can explain the purpose and logic of each function/component I added
  • I have tested edge cases and understand how the code handles them
  • I have modified the AI output to follow this project's coding standards and conventions

Explain your implementation approach:

Python script picks a random template + random GIF path and writes comment.md. The workflow posts it via gh pr comment. GIFs are committed to the repo so GitHub's own CDN serves them reliably.


Checklist before requesting a review

  • I have added proper PR title and linked to the issue
  • I have performed a self-review of my code
  • I can explain the purpose of every function, class, and logic block I added
  • I understand why my changes work and have tested them thoroughly
  • I have considered potential edge cases and how my code handles them
  • My code follows the project's style guidelines and conventions

Note: Please check Allow edits from maintainers if you would like us to assist in the PR.

Made with Cursor

- Add 4 GIFs under .github/assets/celebrations/ served via GitHub CDN
- Drop all Giphy URLs — GitHub camo proxy inconsistently blocks them
- Polish message templates (9 fun varied lines, removed weak ones)
- Clearer Discord footer copy

Made-with: Cursor
@muddlebee muddlebee changed the title fix(github): host celebration GIFs in repo to fix GitHub proxy rendering fix(gifs): host celebration GIFs in repo to fix GitHub proxy rendering Apr 28, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR fixes unreliable GIF rendering in bot merge-celebration comments by replacing Giphy hotlinks with four GIF assets committed directly to the repo and served via raw.githubusercontent.com. The Python script is updated to build URLs pointing to the new assets, and message templates are refreshed.

Confidence Score: 5/5

Safe to merge — only a minor GIF duplication and stale comment to clean up, no functional breakage.

The single finding is a P2 cosmetic/distribution issue: party.gif appears twice in the list, skewing its selection weight and leaving the probability comment inaccurate. Nothing breaks at runtime; the feature works correctly regardless. All other changes (binary GIF assets, URL swap) are straightforward.

.github/scripts/merged_pr_celebration_message.py — remove the duplicate party.gif entry and update the probability comment.

Important Files Changed

Filename Overview
.github/scripts/merged_pr_celebration_message.py Replaces Giphy hotlinks with self-hosted CDN URLs; introduces unintentional duplicate party.gif entry and an inaccurate probability comment.
.github/assets/celebrations/party.gif New binary asset — party celebration GIF committed to repo for CDN hosting.
.github/assets/celebrations/celebrate.gif New binary asset — celebrate GIF committed to repo for CDN hosting.
.github/assets/celebrations/ship.gif New binary asset — ship GIF committed to repo for CDN hosting.
.github/assets/celebrations/merge.gif New binary asset — merge GIF committed to repo for CDN hosting.

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions
    participant Script as merged_pr_celebration_message.py
    participant CDN as raw.githubusercontent.com
    participant PR as PR Comment

    GHA->>Script: Run after merge (CONTRIBUTOR_LOGIN, DISCORD_INVITE_URL)
    Script->>Script: random.choice(templates) + random.choice(gif_blocks)
    Script->>Script: Write body to comment.md
    GHA->>PR: gh pr comment --body-file comment.md
    PR->>CDN: Fetch GIF from /main/.github/assets/celebrations/*.gif
    CDN-->>PR: Serve GIF (always reliable, no proxy)
Loading

Reviews (1): Last reviewed commit: "fix(github): host celebration GIFs in re..." | Re-trigger Greptile

f"\n\n![]({_base}/celebrate.gif)",
f"\n\n![]({_base}/ship.gif)",
f"\n\n![]({_base}/merge.gif)",
f"\n\n![]({_base}/party.gif)",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Duplicate party.gif entry skews distribution

party.gif appears twice in gif_blocks (lines 52 and 56), giving it a 2-in-7 (~28.6%) chance versus 1-in-7 (~14.3%) for the other three GIFs. This also makes the inline comment inaccurate — with 7 items the emoji-only probability is ~28.6%, not ~22% (which would be 2-in-9, matching the old list). Likely unintentional given the PR description says all 4 committed GIFs were meant to be distinct options.

Suggested change
f"\n\n![]({_base}/party.gif)",
f"\n\n![]({_base}/merge.gif)",
]

- hooray.gif   85KB  — arms-up cheer
- success.gif  482KB — success reaction
- shipped.gif  439KB — ship it
- cheers.gif   980KB — celebration cheer
- fireworks.gif 1.2MB — fireworks burst
- confetti.gif  1.5MB — confetti drop

Made-with: Cursor
7 GIFs total: party, celebrate, ship, merge, shipped, success, fireworks

Made-with: Cursor
@muddlebee
Copy link
Copy Markdown
Collaborator Author

note to maintainers -> moved gif to github CDN since giphy doesn't work well..

@muddlebee muddlebee merged commit 4be0ead into main Apr 28, 2026
3 checks passed
@muddlebee muddlebee deleted the fix/celebration-gifs-and-messages branch April 28, 2026 15:49
@github-actions
Copy link
Copy Markdown
Contributor

LGTM → Merged. @muddlebee, your work is in. Every commit counts — thank you for this one.


👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome.

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.

1 participant