-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Generate list of built-in containers in GH build summary #4247
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
Conversation
Add list of hassio components from version.json that are built-in in the data partition to the GH step summary. For landingpage, get the latest stable release at the time of the build, as it's what should be published as homeassistant:landingpage by that time. Closes #4242
📝 WalkthroughWalkthroughExtends the GitHub Actions OS build workflow to generate a “Built-in OS components” section in the job summary, extracting versions for Supervisor, core plugins, and landing page from version.json and GitHub API, and presenting them in a two-column table with links. The existing “Artifacts” section remains unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant GH as GitHub Actions (Build Workflow)
participant FS as Workspace FS
participant API as GitHub API
Dev->>GH: Push/dispatch build
GH->>FS: Build OS artifacts
GH->>FS: Read output/build/hassio-*/version.json
GH->>GH: Resolve hassio_channel + hassio_channel_option
GH->>GH: Prepare "Built-in OS components" table
GH->>GH: Add Supervisor + plugin versions from version.json
GH->>API: GET latest landingpage release tag
API-->>GH: Return tag (e.g., vX.Y.Z)
GH->>GH: Add landingpage row with link
GH->>GH: Append existing "Artifacts" section
GH-->>Dev: Publish job summary
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Assessment against linked issues
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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: 0
🧹 Nitpick comments (4)
.github/workflows/build.yaml (4)
342-342: Use resolved channel instead of input to avoid empty value on release runsOn release-triggered runs,
inputs.hassio_channelis unset and renders as an empty string in the summary. Use the resolved channel fromprepareoutputs for a consistent, user-facing value.Apply this diff:
- echo "Release channel: ${{ inputs.hassio_channel }} (${{ needs.prepare.outputs.hassio_channel_option }})" >> $GITHUB_STEP_SUMMARY + echo "Release channel: ${{ needs.prepare.outputs.channel }} (${{ needs.prepare.outputs.hassio_channel_option }})" >> $GITHUB_STEP_SUMMARY
345-352: Harden version discovery: single-match selection, null-safe jq, quoting, and graceful fallbacks
- The glob
output/build/hassio-*/version.jsoncould match multiple files;jqwould print multiple lines, breaking the table.- Missing keys in
version.jsonproducenull; those links become.../tag/null.- Unquoted variables risk word-splitting if versions ever contain unexpected characters.
- Provide “N/A”/“unknown” fallbacks so the step remains informative when a value isn’t available.
Apply this diff to make the section robust:
- supervisor_version=$(jq -r ".supervisor" output/build/hassio-*/version.json) - landingpage_version=$(curl -fsSL https://api.github.com/repos/home-assistant/landingpage/releases/latest | jq -r '.tag_name') - echo "| supervisor | [${supervisor_version}](https://github.com/home-assistant/supervisor/releases/tag/${supervisor_version}) |" >> $GITHUB_STEP_SUMMARY - echo "| landingpage | [${landingpage_version}](https://github.com/home-assistant/landingpage/releases/tag/${landingpage_version}) |" >> $GITHUB_STEP_SUMMARY - for plugin in dns audio cli multicast observer; do - version=$(jq -r ".${plugin}" output/build/hassio-*/version.json) - echo "| plugin-${plugin} | [${version}](https://github.com/home-assistant/plugin-${plugin}/releases/tag/${version}) |" >> $GITHUB_STEP_SUMMARY - done + shopt -s nullglob + files=(output/build/hassio-*/version.json) + if [ ${#files[@]} -eq 0 ]; then + echo "::warning::No version.json found under output/build/hassio-*/. Skipping Built-in OS components section." + else + vfile="${files[0]}" + supervisor_version="$(jq -r '.supervisor // empty' "$vfile")" + if [ -n "$supervisor_version" ]; then + echo "| supervisor | [${supervisor_version}](https://github.com/home-assistant/supervisor/releases/tag/${supervisor_version}) |" >> "$GITHUB_STEP_SUMMARY" + else + echo "| supervisor | N/A |" >> "$GITHUB_STEP_SUMMARY" + fi + + # Latest stable landingpage release (API call hardened; see next comment for auth headers) + landingpage_version="$(curl -fsSL -H "Authorization: Bearer ${{ github.token }}" -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/home-assistant/landingpage/releases/latest | jq -r '.tag_name // empty')" + if [ -n "$landingpage_version" ]; then + echo "| landingpage | [${landingpage_version}](https://github.com/home-assistant/landingpage/releases/tag/${landingpage_version}) |" >> "$GITHUB_STEP_SUMMARY" + else + echo "| landingpage | unknown |" >> "$GITHUB_STEP_SUMMARY" + fi + + for plugin in dns audio cli multicast observer; do + version="$(jq -r --arg p "$plugin" '.[$p] // empty' "$vfile")" + if [ -n "$version" ]; then + echo "| plugin-${plugin} | [${version}](https://github.com/home-assistant/plugin-${plugin}/releases/tag/${version}) |" >> "$GITHUB_STEP_SUMMARY" + else + echo "| plugin-${plugin} | N/A |" >> "$GITHUB_STEP_SUMMARY" + fi + done + fi
346-346: Authenticate GitHub API request and add headers to avoid rate limits and enhance reliabilityUnauthenticated
curlto the GitHub API is limited (60 req/h per IP) and can intermittently fail under parallel matrix builds or forks. AddAuthorization,Accept, andX-GitHub-Api-Versionheaders and handle empty responses gracefully.The previous comment’s diff already shows the change, but if you prefer a minimal patch here:
- landingpage_version=$(curl -fsSL https://api.github.com/repos/home-assistant/landingpage/releases/latest | jq -r '.tag_name') + landingpage_version=$(curl -fsSL \ + -H "Authorization: Bearer ${{ github.token }}" \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/home-assistant/landingpage/releases/latest | jq -r '.tag_name // empty')
349-352: Future-proof plugin listing against new componentsHard-coding the plugin list risks drift if a new built-in plugin is added to
version.json. Option: derive plugins dynamically and exclude known non-plugin keys.Example tweak (replace the static
for plugin in …loop):- for plugin in dns audio cli multicast observer; do - version=$(jq -r ".${plugin}" output/build/hassio-*/version.json) + # Discover plugins from version.json; exclude supervisor (and any other non-plugin keys if present) + for plugin in $(jq -r 'keys[] | select(. != "supervisor")' "$vfile"); do + version="$(jq -r --arg p "$plugin" '.[$p] // empty' "$vfile")" echo "| plugin-${plugin} | [${version}](https://github.com/home-assistant/plugin-${plugin}/releases/tag/${version}) |" >> $GITHUB_STEP_SUMMARY doneIf
version.jsoncontains extra non-plugin fields, add them to theselect()exclusion.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/build.yaml(1 hunks)
agners
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.
Nice! LGTM!

Add list of hassio components from version.json that are built-in in the data partition to the GH step summary. For landingpage, get the latest stable release at the time of the build, as it's what should be published as homeassistant:landingpage by that time.
Closes #4242
Summary by CodeRabbit