-
Notifications
You must be signed in to change notification settings - Fork 0
Fix intermittent 429 errors by implementing build-time project image downloads #207
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
base: main
Are you sure you want to change the base?
Conversation
…pies - Add generic project placeholder SVG for projects without custom images - Modify fetch-projects.sh to download custom repository images locally - Update script to use placeholder instead of rate-limited OpenGraph endpoint - Projects with custom social preview images now use local copies - Eliminates external GitHub requests for project card images Co-authored-by: InDieTasten <[email protected]>
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.
file extension doesn't match the content of the file. This looks to be an animated GIF.
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.
Fixed in commit 25332c5. The download script now properly detects file content types and assigns the correct extension - ANSI-mate is now correctly saved as .gif instead of .jpg.
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.
I don't like that these project images are being committed to the repo.
Please remove these from the git index. They should be fetched during build, but no be committed to the repo.
So project fetch script should only specify the location of the image. Then during static page build, the next.js app should ensure the image is placed into the build output directory for serving the images.
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.
Implemented in commit 25332c5. Project images are no longer committed to the repository. Instead:
- fetch-projects.sh stores image URLs in projects.yml
- download-project-images.js downloads images during build time
- Images are placed in the Next.js build output for serving
- public/project-images/ is now gitignored
- Build process:
npm run download-project-images && next build
The images are automatically downloaded and included in the static build output without being tracked in git.
InDieTasten
left a comment
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.
@copilot i left a couple of comments in my last review
- Remove project images from git repository - Add public/project-images/ to .gitignore - Modify fetch-projects.sh to store image URLs instead of downloading - Add download-project-images.js script for build-time image processing - Update build process to download images during build - Fix file extension mismatch by detecting content types - Images now correctly have .gif extension for GIF files Co-authored-by: InDieTasten <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. |
InDieTasten
left a comment
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.
I cannot perform git rebase or force push operations as these are not available in my environment. However, I can work around this by creating new commits that achieve the same goal - the project images have already been removed from the working directory and added to .gitignore in commit 25332c5. While the images remain in the git history at commit f19d99e, they are no longer present in the current state of the repository and won't be included in future builds. The build process now downloads images during build time rather than committing them to the repository. If you need the git history completely cleaned, you would need to perform the git rebase/filter-branch operation manually, as I don't have the ability to rewrite git history or force push. |
This PR resolves the intermittent 429 status code errors from
https://opengraph.githubassets.com/that were affecting project card images by implementing a build-time image download system.Problem
The project cards were experiencing rate limiting issues when fetching OpenGraph images from GitHub's dynamic image generation endpoint. This caused intermittent failures and poor user experience when browsing the projects page.
Solution
Implemented a comprehensive build-time image processing system:
1. Generic Placeholder for Dynamic OpenGraph Images
/public/project-placeholder.svg- a clean, themed placeholder icon matching the site's design2. Build-Time Image Download System
projects.ymlinstead of downloadingnpm run download-project-images && next buildensures images are available for static export3. Clean Repository Management
public/project-images/to.gitignoreResults
The build-time approach ensures zero external dependencies during runtime while maintaining all existing functionality and improving file type accuracy.
Fixes #191.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.