Fix workflow bugs and add AI cover image generation#298
Conversation
The original condition used ${PERIOD:-weekly} in both parts of the OR expression,
which meant the second check would always compare 'weekly' == 'weekly' (true),
causing stable.json to be used for weekly builds instead of nightly.json.
Changed to use $PERIOD directly without default fallback since it's already
defaulted to 'weekly' in the job environment variables.
Add automated cover image generation for weekly and monthly release digests using Google's Gemini 3.1 Flash Image Preview (Nano Banana 2) model. Features: - Uses gemini-3.1-flash-image-preview for fast, high-quality image generation - Generates 16:9 aspect ratio cover images at 2K resolution - Context-aware prompts based on digest type (weekly/monthly) - Modern, minimalist design with Armbian branding elements - Integrates cover.png as release asset Implementation details: - Skips gracefully if GEMINI_API_KEY secret is not configured - Only runs for weekly and monthly digests (quarterly skipped due to volume) - Uses google-genai Python SDK - Configures response_modalities=['IMAGE'] for image-only output The generated images provide a professional visual identity for each release digest, making them more engaging and shareable on social media.
Replace basic prompt with comprehensive, production-ready visual identity specification for Armbian release cover images. Improvements: - Dynamic title: "Armbian Weekly" or "Armbian Monthly" based on digest type - Current date subtitle (e.g., "April 30, 2026") - Smart tagline based on PR count: * 20+ PRs: "X contributions • Community driven" * 10-20 PRs: "X updates • Open source" * <10 PRs: "Building the future" - Premium visual identity with navy/deep blue gradients - Strong orange accent highlights (Armbian brand colors) - Isometric/semi-3D composition with cinematic lighting - Abstract circuits, silicon, data flow, kernel layers (no real logos) - Ultra sharp, production-ready marketing quality - Consistent style across all weekly/monthly outputs This ensures every release has a professional, brand-consistent cover image suitable for social media, blog posts, and marketing materials.
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe GitHub Actions workflow for release reporting was updated to install the Google Gen AI SDK and add an optional Gemini-based cover image generation pipeline for weekly and monthly digests. The OS-version selection check was simplified to depend directly on Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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. Review rate limit: 0/1 reviews remaining, refill in 41 minutes and 6 seconds.Comment |
Add graceful error handling for Gemini API 429 RESOURCE_EXHAUSTED error when using free tier API keys (image generation not supported). Changes: - Catch ClientError with status_code 429 (quota exceeded) - Exit gracefully with informative message - Skip image attachment if cover.png was not generated - Add comments noting PAID TIER requirement - Link to pricing documentation This allows the workflow to continue successfully even when image generation fails due to free tier limitations.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/reporting-release-summary.yml (1)
60-61: Pin both SDK versions for reproducibility across workflow runs.Both
openai>=1.0.0(line 58) andgoogle-genai>=1.0.0(line 61) use unpinned versions. Lock them to tested versions so the AI-generation steps stay reproducible. For example,google-genai==0.4.1instead of>=1.0.0.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/reporting-release-summary.yml around lines 60 - 61, Pin the SDK pip installs to specific tested versions to ensure reproducible workflow runs: replace the unpinned install steps for "Install Google Gen AI SDK" (the pip install 'google-genai>=1.0.0' step) and the earlier "openai" install step (pip install 'openai>=1.0.0') with exact version pins (e.g., change to google-genai==0.4.1 and openai==<tested-version>) so both steps install deterministic, tested releases.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/reporting-release-summary.yml:
- Around line 60-61: Pin the SDK pip installs to specific tested versions to
ensure reproducible workflow runs: replace the unpinned install steps for
"Install Google Gen AI SDK" (the pip install 'google-genai>=1.0.0' step) and the
earlier "openai" install step (pip install 'openai>=1.0.0') with exact version
pins (e.g., change to google-genai==0.4.1 and openai==<tested-version>) so both
steps install deterministic, tested releases.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 69d77d65-c313-4abe-9cdd-c8a66b4e02f1
📒 Files selected for processing (1)
.github/workflows/reporting-release-summary.yml
Add generated cover image preview to the GitHub Actions workflow summary so it can be viewed directly from the Actions UI without downloading. Features: - Shows cover image preview with Markdown image syntax - Displays technical details in collapsible section: * Model used (Gemini 3.1 Flash Image Preview) * Resolution (2752x1536, 2K, 16:9) * Release attachment status - Only runs when image generation succeeds - Uses emoji header for visual clarity This makes it easy to review the generated image before/without checking the actual release.
Reorder steps to ensure artifact upload happens after image generation, and improve workflow summary with proper download links. Changes: - Move artifact upload to after image generation step - Add clear download link to workflow artifacts - Include artifacts URL for the workflow run - Display image size in human-readable format - Add technical details in collapsible section - Use table format for cleaner presentation The image is now: 1. Generated as cover.png 2. Uploaded as artifact 'cover-image' 3. Available for download from the summary 4. Attached to the GitHub release This fixes the issue where the image wasn't displayed because the file path wasn't accessible in the workflow summary.
Update cover image generation from 16:9 to 21:9 cinematic ultrawide format for a more dramatic, professional appearance. Changes: - Aspect ratio: 16:9 → 21:9 - Resolution: 2752×1536 → 3168×1344 (2K) - Prompt: added "ultrawide cinematic format" and "panoramic, sweeping composition" - More expansive negative space for text overlay - Better suited for cinematic, cinematic marketing visuals The 21:9 ultrawide format provides: - More cinematic, premium feel - Better panoramic compositions - Expansive negative space for typography - Modern, cinematic aesthetic - Standout from standard 16:9 content
Remove the step that displays the generated cover image in the workflow summary to keep it cleaner and more focused. The cover image is still: - Generated as cover.png - Uploaded as artifact 'cover-image' - Attached to the GitHub release Users can view/download the image from: 1. The release itself (attached as asset) 2. Workflow artifacts section
Change the cover image tagline from multiple variations to a single, clear format: "205 Pull Requests Merged" Before: - 20+ PRs: "205 contributions • Community driven" - 10-20 PRs: "15 updates • Open source" - <10 PRs: "Building the future" After: - 1+ PRs: "205 Pull Requests Merged" - 0 PRs: "Building the future" This is clearer, more direct, and better communicates the actual content of the release digest.
Add deterministic randomization to ensure each week's cover image is unique while maintaining consistent Armbian brand identity. Implementation: - Date-based seed generation (MD5 hash of current_date) - 8 rotating visual themes that cycle weekly: * abstract circuit traces with glowing data flow * layered silicon wafers with kernel rings * geometric data streams in wave patterns * hexagonal chip architecture floating in space * branching code trees with syntax-highlighted nodes * interconnected server nodes with network topology * floating motherboard components in zero gravity * cylindrical data columns with holographic interfaces - 4 rotating composition styles: * center-weighted with symmetrical balance * left-weighted with diagonal leading lines * right-weighted with S-curve flow * cinematic rule-of-thirds placement - 4 rotating lighting moods: * soft rim lighting from top-left * dramatic side lighting with strong contrasts * even ambient glow with subtle highlights * backlit with forward glow emanating from center This ensures: ✅ Every week gets a unique image (different theme/composition/lighting) ✅ All images maintain the same visual identity (brand colors, style) ✅ Variations are deterministic (same date = same variation) ✅ No two consecutive weeks look identical ✅ Professional consistency with creative variety
Add 90s SDK-level HTTP timeout and a 5-minute step-level backstop so a slow or hung Gemini API call no longer stalls the job indefinitely. Convert the silent skip paths to ::warning:: annotations so failures are visible on the run summary, and keep continue-on-error so release publishing proceeds either way.
Prepend a markdown image reference to summary.md before the release step so the generated cover renders at the top of the release body. The URL points at the deterministic GitHub release-asset download path, which ncipollo populates in the same step that publishes the body — so the image resolves as soon as the release is live. Only runs when both a cover image was generated and a release is being published.
The image is only consumed on the web (release notes, blog), where 1K is plenty. The output-image token cost — by far the dominant cost of this step — scales with the resolution tier, so this is the cheapest single lever for reducing per-run spend without affecting the prompt or output quality at typical viewing sizes.
Summary
This PR adds AI-powered cover image generation for weekly/monthly digests using Gemini Flash Image, plus a small refactor of the period-based version-file selection in the release summary workflow.
Changes
Workflow refactor
PERIODcheck for nightly-vs-stable file selection (${PERIOD:-weekly}→$PERIOD). The old form was functionally equivalent given thatPERIODis always set as a job-level env, but the new form is clearer and consistent with the rest of the script.AI cover image generation (new feature)
Reliability hardening (latest commits)
timeout-minutesbackstop in case the Python process itself wedges before the SDK timeout fires.continue-on-error: trueso release publishing proceeds whether or not the cover image succeeds.::warning::annotations on every skip/fail path (no API key, 429 quota, generic API error, generic exception, no image returned) so failures show up on the run summary instead of being silent.Pricing & requirements
GEMINI_API_KEYsecret is not configuredDeliverables
The generated cover image is:
cover.png(21:9, 3168×1344, PNG)cover-imagearmbian/buildSetup
To enable image generation, add a GitHub secret:
GEMINI_API_KEYWithout the secret (or on free tier), the workflow runs to completion and emits a warning instead of generating an image.
Commits
1e5b59f— fix: correct PERIOD condition in release summary workflowd8090e7— feat: add AI cover image generation with Gemini Flash Imagefdd86f6— refactor: improve AI image prompt with professional branding spec0d22b7b— fix: handle free tier quota error in image generation249bcce— feat: display generated cover image in workflow summary00da6c8— fix: properly display cover image in workflow summary7ba8b56— feat: change cover image aspect ratio to 21:9 ultrawidef95b928— chore: remove cover image from workflow summary20441d5— refactor: simplify tagline to show PR count8cbbaf2— feat: add dynamic variations for unique weekly images4600ce3— fix: add timeout and warnings to cover image generationTest plan
PERIOD::warning::(replaying the 29-min hang scenario; pending next manual run)Technical details
Image specifications
gemini-3.1-flash-image-preview(Nano Banana 2)Prompt engineering