fix(opentabletdriver): fix opentabletdriver recipe#343
Conversation
The recipe failed to extract the downloaded tar.gz properly and the rules never got placed which is why the cp of the rules didn't succeed -> recipe couldn't find the actual udev rule
📝 WalkthroughWalkthroughThe PR modifies the OpenTabletDriver installation recipe in ChangesOpenTabletDriver Release Download
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 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. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes the install-opentabletdriver Just recipe so it can successfully download and extract the OpenTabletDriver release tarball and then copy the bundled udev rules, addressing the extraction failure reported in #342.
Changes:
- Adjusts the GitHub release asset selection and download pipeline (switches from
wgettocurlviaxargs). - Continues to extract the downloaded
tar.gzstream into a temp directory for subsequent udev rules installation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
system_files/shared/usr/share/ublue-os/just/apps.just (1)
29-30: ⚡ Quick winAdd safeguard to ensure only one archive URL is selected.
The jq filter outputs all asset URLs matching
opentabletdriver.*tar.gz$. If a release contains multiple matching tar.gz files (e.g., for different architectures),xargs curlwill download all of them, and the concatenated output to tar will fail with "invalid compressed data"—the symptom from issue#342.While current releases appear to have only one matching file, adding an explicit safeguard prevents future breakage if the release structure changes.
Proposed safeguard
curl -s "https://api.github.com/repos/OpenTabletDriver/OpenTabletDriver/releases/latest" \ | jq -r '.assets[] | select(.name | test("opentabletdriver.*tar.gz$")) | .browser_download_url' \ + | head -n1 \ | xargs curl -L -s \🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@system_files/shared/usr/share/ublue-os/just/apps.just` around lines 29 - 30, The jq filter currently emits all matching asset URLs and pipes them to xargs curl; change it so exactly one URL is selected (and fail if not) to avoid downloading/concatenating multiple archives. Replace the pipeline that uses jq -r '.assets[] | select(.name | test("opentabletdriver.*tar.gz$")) | .browser_download_url' | xargs curl -L -s with a jq expression that produces a single URL or errors (for example build an array and require length==1: '[.assets[] | select(.name|test("opentabletdriver.*tar.gz$")) | .browser_download_url] | if length==1 then .[0] else error("expected exactly one opentabletdriver tar.gz asset") end' ) and feed that single URL to curl; reference the existing jq expression and the xargs curl usage when making the edit.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@system_files/shared/usr/share/ublue-os/just/apps.just`:
- Around line 29-30: The jq filter currently emits all matching asset URLs and
pipes them to xargs curl; change it so exactly one URL is selected (and fail if
not) to avoid downloading/concatenating multiple archives. Replace the pipeline
that uses jq -r '.assets[] | select(.name | test("opentabletdriver.*tar.gz$")) |
.browser_download_url' | xargs curl -L -s with a jq expression that produces a
single URL or errors (for example build an array and require length==1:
'[.assets[] | select(.name|test("opentabletdriver.*tar.gz$")) |
.browser_download_url] | if length==1 then .[0] else error("expected exactly one
opentabletdriver tar.gz asset") end' ) and feed that single URL to curl;
reference the existing jq expression and the xargs curl usage when making the
edit.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a9900fa2-a4e9-4216-94ec-6403bdd1e77d
📒 Files selected for processing (1)
system_files/shared/usr/share/ublue-os/just/apps.just
The recipe failed to extract the downloaded tar.gz properly and the rules never got placed which is why the cp of the rules didn't succeed -> recipe couldn't find the actual udev rule
Closed #342
Summary by CodeRabbit