Skip to content

Fix command substitution syntax in workflow#8891

Closed
BKSteve wants to merge 12 commits intodevelopfrom
BKSteve-patch-1
Closed

Fix command substitution syntax in workflow#8891
BKSteve wants to merge 12 commits intodevelopfrom
BKSteve-patch-1

Conversation

@BKSteve
Copy link
Copy Markdown
Collaborator

@BKSteve BKSteve commented Apr 21, 2026

Fixes # Docker Image Test

Proposed changes in this pull request:

  • PR is based on the DEVELOP branch

  • Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review

  • Read contribution guide

Summary by CodeRabbit

  • Chores
    • Made CI/Docker health checks more reliable and diagnostic to reduce flakiness in tests.
    • Tightened packaging dependency to require a newer minimum version for improved compatibility.
    • Updated container runtime to Python 3.11, adjusted startup to show a startup message and basic failure handling, and simplified the health check.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Updated CI Docker health check to capture curl output into a shell variable and compare it to "{}"; tightened the packaging dependency lower bound in pyproject.toml to >=24.2; bumped Docker base image to python:3.11-slim-bookworm, added EXPOSE 8081, and changed the container startup CMD to run a bash wrapper that prints a start message and runs sickchill with simple failure handling.

Changes

Cohort / File(s) Summary
CI workflow — Docker health check
​.github/workflows/pythonpackage.yml
Health check now assigns curl -s http://localhost:8081/ui/get_messages to response and uses a quoted equality test ([ "$response" = "{}" ]) instead of an unquoted command substitution.
Dependency constraint
pyproject.toml
Narrowed packaging dependency lower bound from >=20.9 to >=24.2 (upper bound remains <26.0).
Container image & startup
Dockerfile
Bumped base image to python:3.11-slim-bookworm; adjusted system library packages to newer versions; added EXPOSE 8081; replaced the previous direct sickchill CMD with a bash -c wrapper that echoes a startup message and runs sickchill --nolaunch --datadir /data --port 8081, and on failure prints an error, sleeps 10s, and exits non‑zero. Also simplified HEALTHCHECK to a single curl -fs http://localhost:8081/ui/get_messages equality check against {}.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Fix command substitution syntax in workflow' only reflects the change to .github/workflows/pythonpackage.yml, but the changeset also includes significant updates to Dockerfile (Python version, system packages, CMD, HEALTHCHECK) and pyproject.toml (dependency constraint). The title does not capture the main scope of changes. Revise the title to reflect all significant changes, such as 'Update Docker base image, dependencies, and workflow health check' or provide a more comprehensive summary that includes the Dockerfile and pyproject.toml updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

✏️ 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 BKSteve-patch-1

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

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

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pythonpackage.yml:
- Line 181: The pipeline `$(curl http://localhost:8081/home/ -s | grep -q
"site-notification-modal")` is wrapped in a command substitution, so its empty
stdout is executed instead of using grep's exit status; remove the `$()` so the
pipeline `curl ... | grep -q "site-notification-modal"` runs directly and its
exit code controls the `&& echo "Success!" || (echo "Failed" && exit 1)` branch,
ensuring the failure path triggers correctly when the pattern is not found.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 58ff48d1-a2ee-4803-85fd-b238e1c6cf9e

📥 Commits

Reviewing files that changed from the base of the PR and between f133eb1 and 4755e65.

📒 Files selected for processing (1)
  • .github/workflows/pythonpackage.yml

Comment thread .github/workflows/pythonpackage.yml
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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Dockerfile (1)

122-123: ⚠️ Potential issue | 🟡 Minor

HEALTHCHECK will emit a shell error when curl -f fails.

When sickchill is not yet responding, curl -f exits non-zero and the command substitution yields an empty string, turning the test into [ == "{}" ], which bash reports as unary operator expected (stderr noise, non-zero exit). The elif branch then probes https://localhost:8081, but SickChill on --port 8081 is plain HTTP — that branch can never succeed. Net effect: the health check works once the service is up, but during startup it spams errors and the HTTPS fallback is unreachable.

Consider quoting the substitution and dropping the unreachable HTTPS branch:

🔧 Proposed fix
 HEALTHCHECK --interval=5m --timeout=3s \
- CMD bash -c 'if [ $(curl -f http://localhost:8081/ui/get_messages -s) == "{}" ]; then echo "sickchill is alive"; elif [ $(curl -f https://localhost:8081/ui/get_messages -s) == "{}" ]; then echo "sickchill is alive"; else echo 1; fi'
+ CMD bash -c '[ "$(curl -fs http://localhost:8081/ui/get_messages)" = "{}" ] && echo "sickchill is alive" || exit 1'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile` around lines 122 - 123, The HEALTHCHECK line using bash -c with
unquoted command substitutions and curl -f causes shell errors when curl fails
and includes an unreachable HTTPS fallback; change the HEALTHCHECK command so
the curl call to http://localhost:8081/ui/get_messages is captured into a quoted
variable (use curl without -f or append || true to avoid non-zero exit), then
test that variable with a quoted string comparison (e.g., [ "$output" = "{}" ])
and remove the https://localhost:8081 branch; update the HEALTHCHECK invocation
that contains HEALTHCHECK ... CMD bash -c 'curl ... /ui/get_messages'
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Dockerfile`:
- Around line 115-120: The Dockerfile currently defines duplicate CMD and EXPOSE
instructions so the logging-wrapper CMD (the bash -c "echo 'Starting
SickChill...' && sickchill --nolaunch --datadir /data --port 8081 || ...") is
overridden by the later exec-form CMD ["sickchill", "--nolaunch", "--datadir",
"/data", "--port", "8081"] and EXPOSE 8081 is declared twice; fix by keeping
only one EXPOSE 8081 and replacing the old exec-form CMD with the intended
behavior: either remove the logging wrapper and keep the exec-form CMD to
preserve proper signal handling, or remove the later exec-form CMD and EXPOSE so
the bash logging-wrapper becomes the sole CMD (if temporary debugging is
desired); update the Dockerfile to have a single CMD referencing sickchill and a
single EXPOSE 8081 accordingly.
- Line 9: The Dockerfile was switched to python:3.11-slim-bookworm but still
installs Bullseye-era packages (libffi7, libssl1.1) which don't exist on
Bookworm; update the apt package list used in the RUN apt-get install step (the
stanza that follows the FROM line) to use the Bookworm equivalents (replace
libffi7 → libffi8 and libssl1.1 → libssl3) or, better, remove hard-coded
ABI-versioned package names and install the generic packages (libffi-dev,
libssl-dev) so they resolve to the correct versions on Bookworm; ensure apt-get
update precedes install and keep the same cleanup (apt-get clean && rm -rf
/var/lib/apt/lists/*).

---

Outside diff comments:
In `@Dockerfile`:
- Around line 122-123: The HEALTHCHECK line using bash -c with unquoted command
substitutions and curl -f causes shell errors when curl fails and includes an
unreachable HTTPS fallback; change the HEALTHCHECK command so the curl call to
http://localhost:8081/ui/get_messages is captured into a quoted variable (use
curl without -f or append || true to avoid non-zero exit), then test that
variable with a quoted string comparison (e.g., [ "$output" = "{}" ]) and remove
the https://localhost:8081 branch; update the HEALTHCHECK invocation that
contains HEALTHCHECK ... CMD bash -c 'curl ... /ui/get_messages' accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 53249e00-fedb-4994-ac0c-4b6845bc37d5

📥 Commits

Reviewing files that changed from the base of the PR and between 2600833 and 36b5632.

📒 Files selected for processing (1)
  • Dockerfile

Comment thread Dockerfile
Comment thread Dockerfile
@BKSteve BKSteve closed this Apr 22, 2026
@BKSteve BKSteve deleted the BKSteve-patch-1 branch April 22, 2026 03:34
@BKSteve BKSteve restored the BKSteve-patch-1 branch April 22, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant