fix: add apptainer source, yml formatting
closes #44
Summary by CodeRabbit
-
New Features
- Conditional Apptainer installation step added (includes PPA setup) for workflows.
- Consolidated and improved containerization test step for CI.
-
Bug Fixes
- Added input validation that returns clear error messages for invalid task values.
π Walkthrough
Walkthrough
Updated action inputs' quote style, added task validation that errors on invalid values, and added a conditional "Install Apptainer" step (adds Apptainer PPA then installs) plus workflow adjustments to call the action with install-apptainer when containerizing.
Changes
| Cohort / File(s) | Change Summary |
|---|---|
Action metadata and runtime action.yml |
Normalized default-value quoting to double quotes; added task validation step that prints an explicit error and exits on invalid task; added conditional "Install Apptainer" step which adds the Apptainer PPA then installs; adjusted step ordering and removed trailing blank line |
Workflow invocation .github/workflows/main.yml |
Upgraded actions/checkout from v1 to v4; added/updated test steps to run the local action including a "Test run" and a consolidated "Test containerize" step passing install-apptainer: true and task: "containerize"; adjusted ancillary steps (e.g., show Dockerfile) for new flow |
Sequence Diagram(s)
sequenceDiagram
actor User
participant GH as GitHub Action
participant V as Validator
participant A as Apptainer Installer
participant S as Snakemake Workflow
User->>GH: dispatch with inputs (task, install-apptainer, ...)
GH->>V: validate `task` input
alt invalid task
V-->>User: print error message
GH-->>GH: exit non-zero
else valid task
V-->>GH: validation ok
alt install-apptainer == true
GH->>A: add Apptainer PPA && apt install apptainer
A-->>GH: install result
alt install failed
GH-->>User: install error and exit
end
else install-apptainer == false
GH-->>GH: skip apptainer install
end
GH->>S: run requested task (e.g., containerize)
S-->>User: task completes
end
Estimated code review effort
π― 3 (Moderate) | β±οΈ ~20 minutes
- Areas to focus during review:
-
action.ymlβ validate the exact conditional expressions and exit behavior for task validation. -
action.ymlβ verify the PPA add-command and apt-install steps (order, sudo usage, idempotence). -
.github/workflows/main.ymlβ ensure the upgraded checkout action and updated test steps correctly pass inputs and behave on runners.
-
Suggested reviewers
- johanneskoester
Pre-merge checks and finishing touches
β Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. |
| Title check | β Passed | The title 'fix: add apptainer source, yml formatting' accurately reflects the main changes: adding Apptainer PPA source configuration and YAML formatting updates. |
| Linked Issues check | β Passed | The PR successfully addresses issue #44 by introducing a new Install Apptainer step that adds the apptainer PPA repository before installation, resolving the Ubuntu package source issue. |
| Out of Scope Changes check | β Passed | Changes are within scope: Apptainer PPA addition addresses issue #44, YAML formatting is supporting change, and GitHub Actions version upgrade is reasonable maintenance. |
β¨ Finishing touches
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
fix_apptainer
π Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π₯ Commits
Reviewing files that changed from the base of the PR and between d43836421bf60df7a1a6c151738fe43ce5bd5a2d and 6e90b21979036d48983ed4126f6c0e3da9c8912f.
π Files selected for processing (1)
-
.github/workflows/main.yml(1 hunks)
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
π Additional comments (4)
.github/workflows/main.yml (4)
15-15: Good: checkout action upgraded to v4.Using a current version of the checkout action is important for security and compatibility. v1 is significantly outdated.
17-22: New "Test run" step looks good.The step correctly uses the local action with appropriate parameters to test the basic workflow functionality before containerization.
33-35: "Show Dockerfile" step looks good.The step correctly references the generated Dockerfile for inspection after containerization.
24-31: All inputs are correctly defined and PPA installation logic is properly implemented.Verification confirms:
install-apptainerinput is defined in action.yml (line 37)taskinput is defined in action.yml (line 31)- The action correctly adds the Apptainer PPA repository (
sudo add-apt-repository -y ppa:apptainer/ppa, line 60) before installation, as required by the PR objectives
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 @coderabbitai help to get the list of available commands and usage tips.
note to revs: the file diff looks more complicated then it is -- the only line that was added and that is important is sudo add-apt-repository -y ppa:apptainer/ppa.
Thanks a lot!