Skip to content

Fix workflow bugs and add AI cover image generation#298

Merged
igorpecovnik merged 13 commits intomainfrom
fix/period-condition-bug
May 1, 2026
Merged

Fix workflow bugs and add AI cover image generation#298
igorpecovnik merged 13 commits intomainfrom
fix/period-condition-bug

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

@igorpecovnik igorpecovnik commented Apr 30, 2026

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

  • Simplify PERIOD check for nightly-vs-stable file selection (${PERIOD:-weekly}$PERIOD). The old form was functionally equivalent given that PERIOD is 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)

cover
  • Automated cover image generation using Gemini 3.1 Flash Image Preview (Nano Banana 2)
  • 21:9 ultrawide cinematic images at 3168×1344 (2K) resolution
  • Visual identity:
    • Premium, minimalistic, futuristic aesthetic
    • Navy/deep blue gradients with orange accents (Armbian brand)
    • Abstract circuits, silicon, data flow patterns
    • Dynamic titles ("Armbian Weekly" / "Armbian Monthly")
    • Current date subtitle (e.g., "April 30, 2026")
    • Tagline based on PR count ("205 Pull Requests Merged")
    • Panoramic, sweeping compositions
  • Deterministic weekly variation: date-seeded rotation across 8 visual themes × 4 compositions × 4 lighting moods so consecutive weeks differ while overall identity stays consistent.

Reliability hardening (latest commits)

  • 90s SDK-level HTTP timeout on the Gemini call so a slow or hung API request fails cleanly instead of stalling the runner. (Motivated by a real 29-minute hang seen on a manual run today.)
  • 5-minute step-level timeout-minutes backstop in case the Python process itself wedges before the SDK timeout fires.
  • continue-on-error: true so 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

  • Paid tier required: Gemini 3.1 Flash Image Preview is not available on the free tier (image quota: 0).
  • Requires a paid-tier API key from Google AI Studio.
  • Workflow degrades gracefully (warning + skip, no failure) when:
    • GEMINI_API_KEY secret is not configured
    • A free-tier key is used (catches 429)
    • The API errors out or times out

Deliverables

The generated cover image is:

  • Created as cover.png (21:9, 3168×1344, PNG)
  • Uploaded as workflow artifact cover-image
  • Attached to the GitHub release on armbian/build

Setup

To enable image generation, add a GitHub secret:

Without the secret (or on free tier), the workflow runs to completion and emits a warning instead of generating an image.

Commits

  1. 1e5b59f — fix: correct PERIOD condition in release summary workflow
  2. d8090e7 — feat: add AI cover image generation with Gemini Flash Image
  3. fdd86f6 — refactor: improve AI image prompt with professional branding spec
  4. 0d22b7b — fix: handle free tier quota error in image generation
  5. 249bcce — feat: display generated cover image in workflow summary
  6. 00da6c8 — fix: properly display cover image in workflow summary
  7. 7ba8b56 — feat: change cover image aspect ratio to 21:9 ultrawide
  8. f95b928 — chore: remove cover image from workflow summary
  9. 20441d5 — refactor: simplify tagline to show PR count
  10. 8cbbaf2 — feat: add dynamic variations for unique weekly images
  11. 4600ce3 — fix: add timeout and warnings to cover image generation

Test plan

  • Verify version file selection (nightly.json vs stable.json) for each PERIOD
  • Generate image successfully with paid-tier API key (verified on a prior manual run)
  • Verify graceful skip / 429 path with free-tier API key
  • Verify image is uploaded as artifact and attached to release
  • Verify the new 90s SDK timeout fires as a ::warning:: (replaying the 29-min hang scenario; pending next manual run)
  • Verify the 5-minute step-level backstop does not fire under normal generation (~10–30s typical)

Technical details

Image specifications

  • Model: gemini-3.1-flash-image-preview (Nano Banana 2)
  • Aspect ratio: 21:9 (ultrawide cinematic)
  • Resolution: 3168×1344 (2K)
  • Format: PNG

Prompt engineering

  • Context-aware based on digest type (weekly vs. monthly)
  • PR-count-driven tagline
  • Brand-consistent visual language
  • Date-seeded rotation across themes / composition / lighting for weekly variety

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.
@github-actions github-actions Bot added size/medium PR with more then 50 and less then 250 lines 05 Milestone: Second quarter release GitHub Actions GitHub Actions code Needs review Seeking for review labels Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@igorpecovnik has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 41 minutes and 6 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: faf84fcc-58e7-4bf7-84b4-731127faf8af

📥 Commits

Reviewing files that changed from the base of the PR and between 4600ce3 and ceb7a94.

📒 Files selected for processing (1)
  • .github/workflows/reporting-release-summary.yml

Walkthrough

The 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 PERIOD. After producing summary.md, the workflow conditionally calls Gemini (using GEMINI_API_KEY) to produce cover.png—skipping gracefully if the key or image generation is unavailable—and only uploads and attaches cover.png to the release when the file exists.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the two main changes: fixing workflow bugs (the PERIOD condition) and adding AI cover image generation, matching the core objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description comprehensively documents the changes, including the PERIOD condition refactor and the new Gemini-based cover image generation feature with full technical details and setup instructions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/period-condition-bug

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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 41 minutes and 6 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

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.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 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) and google-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.1 instead 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

📥 Commits

Reviewing files that changed from the base of the PR and between 73165c9 and fdd86f6.

📒 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.
@igorpecovnik igorpecovnik merged commit 5575e41 into main May 1, 2026
6 checks passed
@igorpecovnik igorpecovnik deleted the fix/period-condition-bug branch May 1, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release GitHub Actions GitHub Actions code Needs review Seeking for review size/medium PR with more then 50 and less then 250 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant