-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add HA Yellow image to RPi Imager index update action #3731
Conversation
Update the action to also bump HA Yellow image added in home-assistant/version#402.
📝 Walkthrough📝 WalkthroughWalkthroughThe changes involve an update to the GitHub Actions workflow for bumping the version of Home Assistant OS in the RPi Imager. A new function call to Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub Actions
participant Version Repository
User->>GitHub Actions: Trigger version bump
GitHub Actions->>Version Repository: Clone repository
GitHub Actions->>Version Repository: Validate input
GitHub Actions->>Version Repository: Bump version for "yellow"
GitHub Actions->>Version Repository: Commit changes
GitHub Actions->>Version Repository: Push changes
GitHub Actions->>User: Complete version bump
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
.github/actions/bump-rpi-imager-version/action.yml (1)
86-86
: Consider adding error handling for the new hardware targetWhile the integration looks correct, consider adding specific error handling for the HA Yellow image. This could help diagnose issues if the image is missing or follows a different pattern.
bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "rpi5-64" "RPi 5" + # HA Yellow might follow a different pattern or be missing in some releases + if ! curl --output /dev/null --silent --head --fail "https://github.com/home-assistant/operating-system/releases/download/${INPUTS_VERSION}/haos_yellow-${INPUTS_VERSION}.img.xz"; then + echo "::warning::HA Yellow image not found for version ${INPUTS_VERSION}, skipping..." + else bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "yellow" "HA Yellow" + fi
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/actions/bump-rpi-imager-version/action.yml
(1 hunks)
🔇 Additional comments (1)
.github/actions/bump-rpi-imager-version/action.yml (1)
86-86
: Overall changes look good!
The addition of HA Yellow to the RPi Imager index update action is well-integrated and follows the established patterns. The changes are minimal and maintain the existing workflow structure.
@@ -83,6 +83,7 @@ runs: | |||
bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "rpi3-64" "RPi 3" | |||
bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "rpi4-64" "RPi 4/400" | |||
bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "rpi5-64" "RPi 5" | |||
bump_entry /tmp/version/rpi-imager-haos.json "$INPUTS_VERSION" "${{ steps.validate-input.outputs.date }}" "yellow" "HA Yellow" |
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.
💡 Codebase verification
The verification reveals two critical issues:
- There is no existing HA Yellow entry in the JSON file that matches the expected pattern for HAOS images
- The current Yellow-related entry points to a different URL pattern (
yellow-installer-*
) from a different repository
The bump_entry
function assumes:
- An existing entry to update
- URLs following the pattern
haos_${image_id}-${version}.img.xz
from the operating-system repository
Before this change can work:
- A base entry for HA Yellow needs to be added to the JSON file first
- The entry should follow the same structure as other HAOS entries
- The URL should point to the operating-system repository releases
🔗 Analysis chain
Verify the HA Yellow image URL pattern and JSON structure
The new hardware target has been added correctly, following the same pattern as other entries. However, let's verify two important assumptions:
- The image URL pattern
haos_yellow-${version}.img.xz
matches the actual release artifacts - The JSON file contains an existing entry for HA Yellow that can be updated
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify HA Yellow image URL pattern and JSON structure
# Check if the latest release has the expected HA Yellow image pattern
gh api repos/home-assistant/operating-system/releases/latest | jq -r '.assets[].name' | grep -E 'haos_yellow-.*\.img\.xz'
# Check if the JSON file has an entry for HA Yellow
curl -s https://raw.githubusercontent.com/home-assistant/version/master/rpi-imager-haos.json | \
jq '.os_list[] | select(.name | contains("HA Yellow"))'
Length of output: 300
Script:
#!/bin/bash
# Let's verify the JSON structure more thoroughly by checking its content
# and ensuring it has the expected fields for other entries
curl -s https://raw.githubusercontent.com/home-assistant/version/master/rpi-imager-haos.json | \
jq -r '.os_list[] | "\(.name): \(.url)"'
# Also check the structure of an existing entry to ensure we match it
curl -s https://raw.githubusercontent.com/home-assistant/version/master/rpi-imager-haos.json | \
jq '.os_list[] | select(.name | contains("Raspberry Pi"))' | head -n 1
Length of output: 864
Update the action to also bump HA Yellow image added in home-assistant/version#402.
Summary by CodeRabbit