Skip to content

Add demo workflow #872

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

Open
wants to merge 162 commits into
base: main
Choose a base branch
from
Open

Add demo workflow #872

wants to merge 162 commits into from

Conversation

osterman
Copy link
Member

@osterman osterman commented Dec 19, 2024

what

  • Regenerate demos on a workflow dispatch
  • Add licensed soundtrack
  • Generate multiple demos

why

  • Complicated to run manually
  • Demos are out of date, and not refreshed on new releases

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive demo automation workflow for generating screengrabs and demo screencasts, including asset uploads and pull request management.
    • Added new demo scripts, scene configurations, and style files for enhanced video and GIF documentation of Atmos features.
    • Provided a new CLI tool and shell scripts for building and processing demo video recordings and scenes.
    • Added terminal configuration options and improved TUI output for demos.
  • Improvements

    • Enhanced compatibility of demo build scripts across macOS and Linux.
    • Updated demo and example configurations for better documentation and usability.
    • Improved handling of included documentation files in vendor configurations.
    • Refined Makefile paths for consistency.
    • Improved alias behavior for terminal commands in demo scripts.
  • Bug Fixes

    • Adjusted module versions and variable references in example Terraform configurations for improved stability.
  • Chores

    • Removed an obsolete GitHub Actions workflow.
    • Updated .gitignore to exclude generated audio files.
    • Updated dependencies for Go modules.

@osterman osterman requested a review from a team as a code owner December 19, 2024 16:59
@mergify mergify bot added the triage Needs triage label Dec 19, 2024
Copy link

mergify bot commented Dec 19, 2024

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label Dec 19, 2024
Copy link
Contributor

coderabbitai bot commented Dec 19, 2024

📝 Walkthrough

Walkthrough

This update introduces a comprehensive overhaul of demo automation, recording, and documentation generation for the Atmos project. A new, extensive GitHub Actions workflow replaces the previous VHS workflow, automating the process of building screengrabs, recording demo screencasts, uploading assets, and managing pull requests. The demo recording infrastructure is expanded with new tape scripts, scene definitions, and a Go-based build tool for managing video assets. Several scripts and Makefiles are updated for OS compatibility and directory changes. Configuration files and example modules are adjusted for improved documentation inclusion and module version control. The internal TUI package gains a new viewport component for command output management.

Changes

File(s) Change Summary
.github/workflows/demo.yml, .github/workflows/vhs.yaml Added a new "Demo" workflow with extensive automation for screengrabs and demo recordings; removed the previous "vhs" workflow.
demo/recordings/build.sh, demo/recordings/studio.go Added a new shell script and a Go program for automating tape-to-video conversion, scene processing, and asset management.
demo/recordings/.gitignore Added background.mp3 to ignore list.
demo/recordings/scenes/atmos.txt Added new video file entries for various Atmos demo segments.
demo/recordings/styles/defaults.tape, demo/recordings/styles/less.tape, demo/recordings/styles/ls.tape, demo/recordings/styles/quick-start-advanced.tape, demo/recordings/styles/repo-root.tape Added new and updated tape scripts for VHS demo recordings, including terminal styling, navigation, and command aliases.
demo/recordings/tapes/atmos-describe-stacks.tape, demo/recordings/tapes/atmos-docs.tape, demo/recordings/tapes/atmos-help.tape, demo/recordings/tapes/atmos-list-components.tape, demo/recordings/tapes/atmos-list-stacks.tape, demo/recordings/tapes/atmos-outro.tape, demo/recordings/tapes/atmos-terraform-help.tape, demo/recordings/tapes/atmos-tui.tape, demo/recordings/tapes/atmos-validate-stacks.tape, demo/recordings/tapes/atmos-vendor-pull.tape, demo/recordings/tapes/atmos-version.tape, demo/recordings/tapes/atmos-workflows.tape, demo/recordings/tapes/ls-quick-start.tape Added or updated multiple VHS tape scripts for automated demo recordings, covering various Atmos features and workflows.
demo/defaults.tape Introduced a new VHS configuration with detailed theme, font, and terminal settings.
demo/screengrabs/build-all.sh Updated for OS compatibility and improved command execution logic.
demo/screengrabs/Makefile Changed install path directory casing from lowercase to capitalized.
demo/screengrabs/scripts/demo-stacks/.demo.rc Updated bat alias to disable paging.
examples/quick-start-advanced/atmos.yaml Added a new terminal section with max-width and pager settings.
examples/quick-start-advanced/components/terraform/vpc/main.tf Downgraded module versions for "utils" and "vpc".
examples/quick-start-advanced/components/terraform/vpc/remote-state.tf Changed variable references for count, stage, and environment in the VPC flow logs bucket module.
examples/quick-start-advanced/vendor.yaml Included "**/README.md" in included_paths for vpc and vpc-flow-logs-bucket components.
go.mod Promoted github.com/dustin/go-humanize to a direct dependency.
internal/tui/viewport/tui.go Added a new TUI viewport component for command output with spinner and real-time log display.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Prepare Job
    participant Screengrabs Job
    participant VHS Job
    participant Go Studio Tool
    participant S3
    participant GitHub PR

    GitHub Actions->>Prepare Job: Trigger on workflow_dispatch or PR
    Prepare Job->>GitHub Actions: Output latest Atmos version
    GitHub Actions->>Screengrabs Job: Start after Prepare
    Screengrabs Job->>Go Studio Tool: Build and install screengrabs
    Screengrabs Job->>GitHub PR: Create/update PR with screengrabs
    GitHub Actions->>VHS Job: Start after Prepare
    VHS Job->>Go Studio Tool: Record screencast, process tapes/scenes
    VHS Job->>S3: Upload mp4/gif assets
    VHS Job->>GitHub PR: Create/update PR with demo assets and links
Loading

Suggested reviewers

  • aknysh

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or @auto-summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @auto-title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80058a8 and 2e2e0b8.

📒 Files selected for processing (1)
  • .github/workflows/demo.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/demo.yml

20-20: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


26-26: shellcheck reported issue in this script: SC2086:info:2:26: Double quote to prevent globbing and word splitting

(shellcheck)


26-26: shellcheck reported issue in this script: SC2086:info:2:96: Double quote to prevent globbing and word splitting

(shellcheck)

🔇 Additional comments (3)
.github/workflows/demo.yml (3)

1-11: LGTM! Environment setup is solid, warrior!

The manual trigger and environment variables are well-configured for demo generation.


82-91: Well-configured concurrency control, champion!

The matrix strategy with concurrency control is well-implemented to handle multiple .tape files efficiently.


55-58: Verify the existence of the Makefile, brave one!

The build step assumes the existence of demo/screengrabs/Makefile.

✅ Verification successful

Victory! The Makefile and its dependencies stand ready for battle!

The build system is well-structured and complete:

  • Makefile exists with both required targets: build-all and install
  • build-all.sh script is present and functional
  • Required input file demo-stacks.txt is confirmed
  • Install path is properly configured to ../../website/src/components/screengrabs
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if Makefile exists and contains required targets
if [ -f demo/screengrabs/Makefile ]; then
  echo "Makefile found. Checking for required targets..."
  grep -E "^(build-all|install):" demo/screengrabs/Makefile
else
  echo "Makefile not found at demo/screengrabs/Makefile"
  exit 1
fi

Length of output: 226


Script:

#!/bin/bash
# Let's check the content of the Makefile to understand the targets
echo "=== Content of demo/screengrabs/Makefile ==="
cat demo/screengrabs/Makefile

Length of output: 419


Script:

#!/bin/bash
# Let's verify the build script exists and check its content
echo "=== Checking build-all.sh existence and content ==="
if [ -f demo/screengrabs/build-all.sh ]; then
    echo "build-all.sh found. Content:"
    cat demo/screengrabs/build-all.sh
    echo -e "\n=== Checking demo-stacks.txt existence ==="
    if [ -f demo/screengrabs/demo-stacks.txt ]; then
        echo "demo-stacks.txt found"
    else
        echo "demo-stacks.txt not found"
    fi
else
    echo "build-all.sh not found"
fi

Length of output: 2581

Comment on lines 103 to 126
- name: Push changes to branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.prepare.outputs.version }}"
JOB_NAME=$(basename "${{ matrix.file }}" | sed 's/.tape$//')
BRANCH_NAME="chore/update-$JOB_NAME-for-$VERSION"
git checkout -b "$BRANCH_NAME" || git checkout "$BRANCH_NAME"
git add -A
git commit -m "chore: update $JOB_NAME for $VERSION" || echo "No changes to commit"
git push origin "$BRANCH_NAME"

- name: Create or update PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.prepare.outputs.version }}"
JOB_NAME=$(basename "${{ matrix.file }}" | sed 's/.tape$//')
BRANCH_NAME="chore/update-$JOB_NAME-for-$VERSION"
PR_TITLE="Update $JOB_NAME for $VERSION"
PR_BODY="This PR updates the demo gif for $JOB_NAME with Atmos version $VERSION."
gh pr view "$BRANCH_NAME" > /dev/null 2>&1 || \
gh pr create --base main --head "$BRANCH_NAME" --title "$PR_TITLE" --body "$PR_BODY"
gh pr edit "$BRANCH_NAME" --add-label "no-release"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Apply the same battle-hardening to the VHS job's git operations!

The git and PR operations here need the same robust error handling as suggested for the screengrabs job.

Apply similar error handling improvements as shown in the screengrabs job review above.

Comment on lines 18 to 33
- name: Get Atmos version
id: get-version
run: |
VERSION=$(curl -s https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: List all .tape files
id: list-tapes
run: |
files=$(find . -type f -name '*.tape')
echo "matrix=$(echo -n \"$files\" | jq -R -s -c 'split(\"\\n\") | map(select(. != \"\"))')" >> $GITHUB_OUTPUT

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Shield your commands from the chaos of spaces and failures!

The shell commands need additional error handling and proper quoting:

Apply these improvements:

  - name: Get Atmos version
    id: get-version
    run: |
-     VERSION=$(curl -s https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)
+     VERSION=$(curl -s --fail https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)
+     if [ -z "$VERSION" ]; then
+       echo "Failed to get Atmos version"
+       exit 1
+     fi
      echo "version=$VERSION" >> $GITHUB_OUTPUT

  - name: List all .tape files
    id: list-tapes
    run: |
-     files=$(find . -type f -name '*.tape')
-     echo "matrix=$(echo -n \"$files\" | jq -R -s -c 'split(\"\\n\") | map(select(. != \"\"))')" >> $GITHUB_OUTPUT
+     files=$(find . -type f -name '*.tape' -print0 | jq -R -s -c 'split("\u0000") | map(select(. != ""))')
+     echo "matrix=$files" >> $GITHUB_OUTPUT
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Get Atmos version
id: get-version
run: |
VERSION=$(curl -s https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: List all .tape files
id: list-tapes
run: |
files=$(find . -type f -name '*.tape')
echo "matrix=$(echo -n \"$files\" | jq -R -s -c 'split(\"\\n\") | map(select(. != \"\"))')" >> $GITHUB_OUTPUT
- name: Get Atmos version
id: get-version
run: |
VERSION=$(curl -s --fail https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)
if [ -z "$VERSION" ]; then
echo "Failed to get Atmos version"
exit 1
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: List all .tape files
id: list-tapes
run: |
files=$(find . -type f -name '*.tape' -print0 | jq -R -s -c 'split("\u0000") | map(select(. != ""))')
echo "matrix=$files" >> $GITHUB_OUTPUT
🧰 Tools
🪛 actionlint (1.7.4)

20-20: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


26-26: shellcheck reported issue in this script: SC2086:info:2:26: Double quote to prevent globbing and word splitting

(shellcheck)


26-26: shellcheck reported issue in this script: SC2086:info:2:96: Double quote to prevent globbing and word splitting

(shellcheck)

Comment on lines 59 to 85
- name: Push changes to branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.prepare.outputs.version }}"
BRANCH_NAME="chore/update-build-screengrabs-for-$VERSION"
git checkout -b "$BRANCH_NAME" || git checkout "$BRANCH_NAME"
git add -A
git commit -m "chore: update screengrabs for $VERSION" || echo "No changes to commit"
git push origin "$BRANCH_NAME"

- name: Create or update PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.prepare.outputs.version }}"
BRANCH_NAME="chore/update-build-screengrabs-for-$VERSION"
PR_TITLE="Update screengrabs for $VERSION"
PR_BODY="This PR updates the screengrabs for Atmos version $VERSION."
gh pr view "$BRANCH_NAME" > /dev/null 2>&1 || \
gh pr create --base main --head "$BRANCH_NAME" --title "$PR_TITLE" --body "$PR_BODY"
gh pr edit "$BRANCH_NAME" --add-label "no-release"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Strengthen your git operations with proper error handling!

The git and PR operations need more robust error handling.

Apply these improvements:

  - name: Push changes to branch
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    run: |
      VERSION="${{ needs.prepare.outputs.version }}"
      BRANCH_NAME="chore/update-build-screengrabs-for-$VERSION"
-     git checkout -b "$BRANCH_NAME" || git checkout "$BRANCH_NAME"
+     if ! git checkout -b "$BRANCH_NAME" 2>/dev/null; then
+       if ! git checkout "$BRANCH_NAME"; then
+         echo "Failed to checkout branch"
+         exit 1
+       fi
+     fi
      git add -A
-     git commit -m "chore: update screengrabs for $VERSION" || echo "No changes to commit"
+     if ! git diff --staged --quiet; then
+       git commit -m "chore: update screengrabs for $VERSION"
+       if ! git push origin "$BRANCH_NAME"; then
+         echo "Failed to push changes"
+         exit 1
+       fi
+     else
+       echo "No changes to commit"
+     fi
-     git push origin "$BRANCH_NAME"

  - name: Create or update PR
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    run: |
      VERSION="${{ needs.prepare.outputs.version }}"
      BRANCH_NAME="chore/update-build-screengrabs-for-$VERSION"
      PR_TITLE="Update screengrabs for $VERSION"
      PR_BODY="This PR updates the screengrabs for Atmos version $VERSION."
-     gh pr view "$BRANCH_NAME" > /dev/null 2>&1 || \
-     gh pr create --base main --head "$BRANCH_NAME" --title "$PR_TITLE" --body "$PR_BODY"
+     if ! gh pr view "$BRANCH_NAME" > /dev/null 2>&1; then
+       if ! gh pr create --base main --head "$BRANCH_NAME" --title "$PR_TITLE" --body "$PR_BODY"; then
+         echo "Failed to create PR"
+         exit 1
+       fi
+     fi
-     gh pr edit "$BRANCH_NAME" --add-label "no-release"
+     if ! gh pr edit "$BRANCH_NAME" --add-label "no-release"; then
+       echo "Failed to add label to PR"
+       exit 1
+     fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Push changes to branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.prepare.outputs.version }}"
BRANCH_NAME="chore/update-build-screengrabs-for-$VERSION"
git checkout -b "$BRANCH_NAME" || git checkout "$BRANCH_NAME"
git add -A
git commit -m "chore: update screengrabs for $VERSION" || echo "No changes to commit"
git push origin "$BRANCH_NAME"
- name: Create or update PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.prepare.outputs.version }}"
BRANCH_NAME="chore/update-build-screengrabs-for-$VERSION"
PR_TITLE="Update screengrabs for $VERSION"
PR_BODY="This PR updates the screengrabs for Atmos version $VERSION."
gh pr view "$BRANCH_NAME" > /dev/null 2>&1 || \
gh pr create --base main --head "$BRANCH_NAME" --title "$PR_TITLE" --body "$PR_BODY"
gh pr edit "$BRANCH_NAME" --add-label "no-release"
- name: Push changes to branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.prepare.outputs.version }}"
BRANCH_NAME="chore/update-build-screengrabs-for-$VERSION"
if ! git checkout -b "$BRANCH_NAME" 2>/dev/null; then
if ! git checkout "$BRANCH_NAME"; then
echo "Failed to checkout branch"
exit 1
fi
fi
git add -A
if ! git diff --staged --quiet; then
git commit -m "chore: update screengrabs for $VERSION"
if ! git push origin "$BRANCH_NAME"; then
echo "Failed to push changes"
exit 1
fi
else
echo "No changes to commit"
fi
- name: Create or update PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ needs.prepare.outputs.version }}"
BRANCH_NAME="chore/update-build-screengrabs-for-$VERSION"
PR_TITLE="Update screengrabs for $VERSION"
PR_BODY="This PR updates the screengrabs for Atmos version $VERSION."
if ! gh pr view "$BRANCH_NAME" > /dev/null 2>&1; then
if ! gh pr create --base main --head "$BRANCH_NAME" --title "$PR_TITLE" --body "$PR_BODY"; then
echo "Failed to create PR"
exit 1
fi
fi
if ! gh pr edit "$BRANCH_NAME" --add-label "no-release"; then
echo "Failed to add label to PR"
exit 1
fi

Copy link
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

🧹 Nitpick comments (2)
demo/screengrabs/build-all.sh (1)

50-69: Add error handling to postprocess functions

The postprocess functions perform multiple sed operations without checking for errors.

Consider adding error handling:

postprocess_ansi() {
  local file=$1
+  local exit_code=0
  # Remove noise and clean up the output
-  $SED '/- Finding latest version of/d' $file
-  $SED '/- Installed hashicorp/d' $file
+  $SED '/- Finding latest version of/d' "$file" || exit_code=$?
+  $SED '/- Installed hashicorp/d' "$file" || exit_code=$?
  # ... (similar for other operations)
+  return $exit_code
}
.github/workflows/demo.yml (1)

42-46: Improve dependency installation reliability

The apt-get commands should be more resilient to transient failures.

Apply these improvements:

-      - name: Install dependencies
+      - name: Install dependencies
+        timeout-minutes: 5
+        retries: 3
        run: |
-          sudo apt-get update
-          sudo apt-get install -y aha util-linux make jq
+          sudo apt-get update || (sleep 10 && sudo apt-get update)
+          DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends aha util-linux make jq
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e2e0b8 and 9b129e0.

📒 Files selected for processing (3)
  • .github/workflows/demo.yml (1 hunks)
  • .github/workflows/vhs.yaml (0 hunks)
  • demo/screengrabs/build-all.sh (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/vhs.yaml
🧰 Additional context used
🪛 Shellcheck (0.10.0)
demo/screengrabs/build-all.sh

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 20-20: Declare and assign separately to avoid masking return values.

(SC2155)

🪛 actionlint (1.7.4)
.github/workflows/demo.yml

24-24: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:26: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:96: Double quote to prevent globbing and word splitting

(shellcheck)

🔇 Additional comments (5)
.github/workflows/demo.yml (5)

1-15: LGTM! Well-structured workflow configuration

The workflow triggers and environment setup are comprehensive and appropriate for the demo regeneration use case.


22-33: Previous review comments about command robustness are still applicable

The commands in the prepare job need additional error handling and proper quoting as highlighted in the previous review.

🧰 Tools
🪛 actionlint (1.7.4)

24-24: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:26: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:96: Double quote to prevent globbing and word splitting

(shellcheck)


63-89: Previous review comments about git operations robustness are still applicable

The git operations and PR creation steps need more robust error handling as highlighted in the previous review.


93-99: LGTM! Well-implemented concurrency control

The matrix strategy with concurrency group and cancel-in-progress settings is well thought out.


111-138: Previous review comments about git operations robustness are still applicable

The git operations and PR creation steps need more robust error handling as highlighted in the previous review.

Comment on lines +5 to +10
# Determine the correct sed syntax based on the operating system
if [ "$(uname)" = "Darwin" ]; then
SED="$SED" # macOS requires '' for in-place editing
else
SED="sed -i" # Linux does not require ''
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix the macOS SED variable initialization

The macOS branch of the conditional is not properly initializing the SED variable. It's currently just reassigning the undefined variable to itself.

Apply this fix:

if [ "$(uname)" = "Darwin" ]; then
-    SED="$SED" # macOS requires '' for in-place editing
+    SED="sed -i ''" # macOS requires '' for in-place editing
else
    SED="sed -i"    # Linux does not require ''
fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Determine the correct sed syntax based on the operating system
if [ "$(uname)" = "Darwin" ]; then
SED="$SED" # macOS requires '' for in-place editing
else
SED="sed -i" # Linux does not require ''
fi
# Determine the correct sed syntax based on the operating system
if [ "$(uname)" = "Darwin" ]; then
SED="sed -i ''" # macOS requires '' for in-place editing
else
SED="sed -i" # Linux does not require ''
fi

Comment on lines +15 to +20
local extension="${command##*.}" # if any...
local demo_path=../../examples/$demo
local output_base_file=artifacts/$(echo "$command" | sed -E 's/ -/-/g' | sed -E 's/ +/-/g' | sed 's/---/--/g' | sed 's/scripts\///' | sed 's/\.sh$//')
local output_html=${output_base_file}.html
local output_ansi=${output_base_file}.ansi
local output_dir=$(dirname $output_base_file)
local output_html=${output_base_file}.html
local output_ansi=${output_base_file}.ansi
local output_dir=$(dirname $output_base_file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve variable declarations and path handling

The current implementation has two issues:

  1. Variables are declared and assigned in one line, which can mask return values
  2. Path handling could be more robust

Apply these improvements:

-    local extension="${command##*.}" # if any...
-    local demo_path=../../examples/$demo
-    local output_base_file=artifacts/$(echo "$command" | sed -E 's/ -/-/g' | sed -E 's/ +/-/g' | sed 's/---/--/g' | sed 's/scripts\///' | sed 's/\.sh$//')
-    local output_html=${output_base_file}.html
-    local output_ansi=${output_base_file}.ansi
-    local output_dir=$(dirname $output_base_file)
+    local extension
+    local demo_path
+    local output_base_file
+    local output_html
+    local output_ansi
+    local output_dir
+    
+    extension="${command##*.}"
+    demo_path="../../examples/${demo}"
+    output_base_file="artifacts/$(echo "$command" | sed -E 's/ -/-/g' | sed -E 's/ +/-/g' | sed 's/---/--/g' | sed 's/scripts\///' | sed 's/\.sh$//')"
+    output_html="${output_base_file}.html"
+    output_ansi="${output_base_file}.ansi"
+    output_dir="$(dirname "$output_base_file")"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
local extension="${command##*.}" # if any...
local demo_path=../../examples/$demo
local output_base_file=artifacts/$(echo "$command" | sed -E 's/ -/-/g' | sed -E 's/ +/-/g' | sed 's/---/--/g' | sed 's/scripts\///' | sed 's/\.sh$//')
local output_html=${output_base_file}.html
local output_ansi=${output_base_file}.ansi
local output_dir=$(dirname $output_base_file)
local output_html=${output_base_file}.html
local output_ansi=${output_base_file}.ansi
local output_dir=$(dirname $output_base_file)
local extension
local demo_path
local output_base_file
local output_html
local output_ansi
local output_dir
extension="${command##*.}"
demo_path="../../examples/${demo}"
output_base_file="artifacts/$(echo "$command" | sed -E 's/ -/-/g' | sed -E 's/ +/-/g' | sed 's/---/--/g' | sed 's/scripts\///' | sed 's/\.sh$//')"
output_html="${output_base_file}.html"
output_ansi="${output_base_file}.ansi"
output_dir="$(dirname "$output_base_file")"
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 20-20: Declare and assign separately to avoid masking return values.

(SC2155)

Copy link
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: 3

🧹 Nitpick comments (1)
.github/workflows/demo.yml (1)

3-9: LGTM! Consider optimizing PR triggers.

The workflow triggers are well-configured for both manual and automated runs. The path filter helps prevent unnecessary executions.

Consider adding a label condition to prevent running on every PR:

 pull_request:
   types: [labeled, opened, synchronize]
+  if: contains(github.event.pull_request.labels.*.name, 'update-demos')
   paths:
     - ".github/workflows/demo.yml"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6981f63 and 9575eae.

📒 Files selected for processing (2)
  • .github/workflows/demo.yml (1 hunks)
  • demo/screengrabs/Makefile (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • demo/screengrabs/Makefile
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/demo.yml

24-24: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:26: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:96: Double quote to prevent globbing and word splitting

(shellcheck)


76-76: the runner of "peter-evans/create-pull-request@v5" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


109-109: shellcheck reported issue in this script: SC2129:style:3:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


109-109: shellcheck reported issue in this script: SC2086:info:3:30: Double quote to prevent globbing and word splitting

(shellcheck)


109-109: shellcheck reported issue in this script: SC2086:info:4:32: Double quote to prevent globbing and word splitting

(shellcheck)


109-109: shellcheck reported issue in this script: SC2086:info:5:63: Double quote to prevent globbing and word splitting

(shellcheck)


127-127: the runner of "peter-evans/create-pull-request@v5" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🔇 Additional comments (1)
.github/workflows/demo.yml (1)

22-32: 🛠️ Refactor suggestion

Strengthen shell commands with proper error handling and quoting!

The commands need to be more resilient to failures and properly quoted.

Apply these improvements:

   - name: Get Atmos version
     id: get-version
     run: |
-      VERSION=$(curl -s https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)
+      VERSION=$(curl -s --fail https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)
+      if [[ -z "$VERSION" ]]; then
+        echo "Failed to fetch Atmos version"
+        exit 1
+      fi
       echo "version=$VERSION" >> $GITHUB_OUTPUT

   - name: List all .tape files
     id: list-tapes
     run: |
-      files=$(find . -type f -name '*.tape')
-      echo "matrix=$(echo -n \"$files\" | jq -R -s -c 'split(\"\\n\") | map(select(. != \"\"))')" >> $GITHUB_OUTPUT
+      if ! files=$(find . -type f -name '*.tape' -print0); then
+        echo "Failed to find .tape files"
+        exit 1
+      fi
+      matrix=$(jq -R -s -c 'split("\u0000") | map(select(. != ""))' <<< "$files")
+      echo "matrix=$matrix" >> $GITHUB_OUTPUT

Likely invalid or redundant comment.

🧰 Tools
🪛 actionlint (1.7.4)

24-24: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:26: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:96: Double quote to prevent globbing and word splitting

(shellcheck)

Comment on lines 107 to 115
- name: Prepare variables
id: vars
run: |
VERSION="${{ needs.prepare.outputs.version }}"
JOB_NAME=$(basename "${{ matrix.file }}" | sed 's/.tape$//')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "job_name=${JOB_NAME}" >> $GITHUB_OUTPUT
echo "branch_name=chore/update-${JOB_NAME}-for-${VERSION}" >> $GITHUB_OUTPUT

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve variable preparation robustness!

The variable preparation step needs better error handling and validation.

   - name: Prepare variables
     id: vars
     run: |
       VERSION="${{ needs.prepare.outputs.version }}"
-      JOB_NAME=$(basename "${{ matrix.file }}" | sed 's/.tape$//')
+      if [[ ! -f "${{ matrix.file }}" ]]; then
+        echo "Tape file not found: ${{ matrix.file }}"
+        exit 1
+      fi
+      JOB_NAME=$(basename "${{ matrix.file }}" .tape)
+      if [[ -z "$JOB_NAME" ]]; then
+        echo "Failed to extract job name"
+        exit 1
+      fi
-      echo "version=${VERSION}" >> $GITHUB_OUTPUT
-      echo "job_name=${JOB_NAME}" >> $GITHUB_OUTPUT
-      echo "branch_name=chore/update-${JOB_NAME}-for-${VERSION}" >> $GITHUB_OUTPUT
+      {
+        echo "version=${VERSION}"
+        echo "job_name=${JOB_NAME}"
+        echo "branch_name=chore/update-${JOB_NAME}-for-${VERSION}"
+      } >> "$GITHUB_OUTPUT"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Prepare variables
id: vars
run: |
VERSION="${{ needs.prepare.outputs.version }}"
JOB_NAME=$(basename "${{ matrix.file }}" | sed 's/.tape$//')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "job_name=${JOB_NAME}" >> $GITHUB_OUTPUT
echo "branch_name=chore/update-${JOB_NAME}-for-${VERSION}" >> $GITHUB_OUTPUT
- name: Prepare variables
id: vars
run: |
VERSION="${{ needs.prepare.outputs.version }}"
if [[ ! -f "${{ matrix.file }}" ]]; then
echo "Tape file not found: ${{ matrix.file }}"
exit 1
fi
JOB_NAME=$(basename "${{ matrix.file }}" .tape)
if [[ -z "$JOB_NAME" ]]; then
echo "Failed to extract job name"
exit 1
fi
{
echo "version=${VERSION}"
echo "job_name=${JOB_NAME}"
echo "branch_name=chore/update-${JOB_NAME}-for-${VERSION}"
} >> "$GITHUB_OUTPUT"
🧰 Tools
🪛 actionlint (1.7.4)

109-109: shellcheck reported issue in this script: SC2129:style:3:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


109-109: shellcheck reported issue in this script: SC2086:info:3:30: Double quote to prevent globbing and word splitting

(shellcheck)


109-109: shellcheck reported issue in this script: SC2086:info:4:32: Double quote to prevent globbing and word splitting

(shellcheck)


109-109: shellcheck reported issue in this script: SC2086:info:5:63: Double quote to prevent globbing and word splitting

(shellcheck)

Copy link
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: 0

🧹 Nitpick comments (4)
demo/recordings/style.tape (1)

15-17: Consider merging Margin and Padding for consistency.

You set the margin to zero and then redefine margin again at line 28. It might be simpler to keep margin settings in one place unless you intend to override them later.

demo/screengrabs/build-all.sh (1)

15-20: Declare and assign separately to avoid masking return values.

ShellCheck SC2155 advises caution.

Here's a minimal example fix:

-    local extension="${command##*.}" # if any...
-    local demo_path=../../examples/$demo
-    local output_base_file=artifacts/$(echo "$command" | sed -E 's/ -/-/g' | sed -E 's/ +/-/g' | sed 's/---/--/g' | sed 's/scripts\///' | sed 's/\.sh$//')
-    local output_html=${output_base_file}.html
-    local output_ansi=${output_base_file}.ansi
-    local output_dir=$(dirname $output_base_file)
+    local extension
+    extension="${command##*.}"
+    local demo_path
+    demo_path="../../examples/$demo"
+    ...
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 20-20: Declare and assign separately to avoid masking return values.

(SC2155)

.github/workflows/demo.yml (2)

24-26: Double-quote your variable expansions to avoid word splitting.

When injecting output into the environment, wrap $VERSION in quotes to prevent unexpected splitting.

Here's an illustrative fix:

-VERSION=$(curl -s https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)
+VERSION="$(curl -s https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)"
🧰 Tools
🪛 actionlint (1.7.4)

24-24: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


31-32: Apply quotes around $files to avoid potential word splitting.

Enclose expansions in quotes for robust handling of spaces or special characters.

-files=$(find . -type f -name '*.tape')
+files="$(find . -type f -name '*.tape')"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9575eae and e77df1d.

📒 Files selected for processing (7)
  • .github/workflows/demo.yml (1 hunks)
  • .github/workflows/vhs.yaml (0 hunks)
  • demo/defaults.tape (1 hunks)
  • demo/recordings/demo.tape (1 hunks)
  • demo/recordings/style.tape (1 hunks)
  • demo/screengrabs/Makefile (1 hunks)
  • demo/screengrabs/build-all.sh (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/vhs.yaml
✅ Files skipped from review due to trivial changes (1)
  • demo/defaults.tape
🚧 Files skipped from review as they are similar to previous changes (1)
  • demo/screengrabs/Makefile
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/demo.yml

24-24: shellcheck reported issue in this script: SC2086:info:2:28: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:26: Double quote to prevent globbing and word splitting

(shellcheck)


30-30: shellcheck reported issue in this script: SC2086:info:2:96: Double quote to prevent globbing and word splitting

(shellcheck)


103-103: shellcheck reported issue in this script: SC2129:style:3:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


103-103: shellcheck reported issue in this script: SC2086:info:3:30: Double quote to prevent globbing and word splitting

(shellcheck)


103-103: shellcheck reported issue in this script: SC2086:info:4:32: Double quote to prevent globbing and word splitting

(shellcheck)


103-103: shellcheck reported issue in this script: SC2086:info:5:63: Double quote to prevent globbing and word splitting

(shellcheck)

🪛 Shellcheck (0.10.0)
demo/screengrabs/build-all.sh

[warning] 17-17: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 20-20: Declare and assign separately to avoid masking return values.

(SC2155)

🔇 Additional comments (9)
demo/recordings/style.tape (2)

3-14: Good use of modular settings for VHS aesthetics.

These lines establish consistent theme, font, and window styling. It's neat to see all defaults centralized, improving maintainability.


22-36: All defaults appear consistent across the file.

Retaining uniform definitions for frame rate, cursor blink, and margin fill ensures cohesive styling without confusion.

demo/recordings/demo.tape (4)

1-2: Intro lines clearly frame the purpose of the demo.

Your approach for referencing the style file exemplifies a DRY pattern: changes in styling remain centralized.


6-10: Sleep intervals are well-structured for demonstration clarity.

The timing helps highlight each command's output.


59-64: Scrolling behavior clarifies large outputs.

Scrolling through 25 lines at a time is practical for capturing partial screen content. This is great for longer outputs.


67-85: All-around thorough demonstration of key Atmos features.

Commands show a broad range of capabilities, from listing stacks to viewing workflows. Very comprehensive.

demo/screengrabs/build-all.sh (2)

50-64: Noise filtering is nicely handled.

The commands remove lines irrelevant to demo clarity. This reduces visual clutter.


5-10: ⚠️ Potential issue

Mac-specific SED usage is incomplete.

Currently, SED="$SED" is not setting the variable. If you wish to support in-place editing on macOS, you must set it properly.

Here's a proposed fix:

 if [ "$(uname)" = "Darwin" ]; then
-    SED="$SED" # macOS requires '' for in-place editing
+    SED="sed -i ''" # macOS requires '' for in-place editing
 else
     SED="sed -i"    # Linux does not require ''
 fi

Likely invalid or redundant comment.

.github/workflows/demo.yml (1)

103-109: 🛠️ Refactor suggestion

Consider grouping echo statements to streamline output redirection.

ShellCheck suggests grouping multiple echo commands inside braces.

-echo "version=${VERSION}" >> $GITHUB_OUTPUT
-echo "job_name=${JOB_NAME}" >> $GITHUB_OUTPUT
-echo "branch_name=chore/update-${JOB_NAME}-for-${VERSION}" >> $GITHUB_OUTPUT
+{
+  echo "version=${VERSION}"
+  echo "job_name=${JOB_NAME}"
+  echo "branch_name=chore/update-${JOB_NAME}-for-${VERSION}"
+} >> "$GITHUB_OUTPUT"

Likely invalid or redundant comment.

🧰 Tools
🪛 actionlint (1.7.4)

103-103: shellcheck reported issue in this script: SC2129:style:3:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


103-103: shellcheck reported issue in this script: SC2086:info:3:30: Double quote to prevent globbing and word splitting

(shellcheck)


103-103: shellcheck reported issue in this script: SC2086:info:4:32: Double quote to prevent globbing and word splitting

(shellcheck)


103-103: shellcheck reported issue in this script: SC2086:info:5:63: Double quote to prevent globbing and word splitting

(shellcheck)

Copy link
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: 0

♻️ Duplicate comments (2)
.github/workflows/demo.yml (2)

203-210: ⚠️ Potential issue

Define JOB_NAME before usage

JOB_NAME is echoed without ever being set, leading to empty branch names. Add a definition (e.g., "demo") before writing to outputs:

      - name: Prepare variables
        id: vars
        run: |
          VERSION="${{ needs.prepare.outputs.version }}"
+         JOB_NAME="demo"
          echo "version=${VERSION}" >> $GITHUB_OUTPUT
          echo "job_name=${JOB_NAME}" >> $GITHUB_OUTPUT
          echo "branch_name=chore/update-${JOB_NAME}-for-${VERSION}" >> $GITHUB_OUTPUT

253-258: ⚠️ Potential issue

Correct path for copying demo GIF

With working-directory: demo/recordings, the source path is duplicated. Change:

-          cp demo/recordings/gif/atmos.gif docs/demo.gif
+          cp gif/atmos.gif ../../docs/demo.gif

This ensures the file lands in the repo’s docs/ directory.

🧹 Nitpick comments (3)
.github/workflows/demo.yml (3)

3-9: Consider broadening workflow triggers to include demo assets

Currently the workflow runs only when the workflow file itself changes. To automatically refresh demos when related content (tape scripts, assets, docs) is updated, you might add demo paths:

 on:
   workflow_dispatch:
   pull_request:
     types: [labeled, opened, synchronize]
     paths:
       - ".github/workflows/demo.yml"
+      - "demo/**"
+      - "demo/recordings/**"
+      - "docs/demo.gif"
+      - "website/static/img/demo.gif"

93-95: Remove commented-out runner specifications

The blocked-out #runs-on lines are leftover cruft. Consider deleting them for clarity since you’re using ubuntu-24.04.

-    #runs-on:
-    #  - runs-on=${{ github.run_id }}
-    #  - runner=large

224-225: Pin setup-go to a specific patch version

Locking actions/setup-go to a precise patch helps avoid surprises from upstream changes:

-      - name: Set up Go
-        uses: actions/setup-go@v4
+      - name: Set up Go
+        uses: actions/[email protected]
🧰 Tools
🪛 actionlint (1.7.4)

224-224: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e61fc8d and afea056.

📒 Files selected for processing (1)
  • .github/workflows/demo.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/demo.yml

224-224: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Analyze (go)
  • GitHub Check: Lint (golangci)
🔇 Additional comments (2)
.github/workflows/demo.yml (2)

28-33: Version retrieval logic looks good

Fetching the latest Atmos tag via GitHub API and writing to GITHUB_OUTPUT is concise and sufficient given GitHub Actions’ built-in error handling.


75-89: Screengrabs PR automation with create-pull-request@v7

Using peter-evans/create-pull-request@v7 with delete-branch, commit signing, and proper branch naming covers all bases for updating screengrabs.

Copy link
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

♻️ Duplicate comments (3)
.github/workflows/demo.yml (3)

3-9: Consider expanding workflow triggers
The workflow currently only fires when demo.yml changes. You may want it to also run when demo artifacts or scripts change (e.g., demo/**, docs/demo.gif, etc.) to keep demos up-to-date automatically.


200-204: ⚠️ Potential issue

Define JOB_NAME before using it
JOB_NAME is echoed but never set, leading to empty branch names and failing PR creation. Initialize it—for example:

  run: |
    VERSION="${{ needs.prepare.outputs.version }}"
+   JOB_NAME="demo"
    echo "version=${VERSION}" >> $GITHUB_OUTPUT
    echo "job_name=${JOB_NAME}" >> $GITHUB_OUTPUT
    echo "branch_name=chore/update-${JOB_NAME}-for-${VERSION}" >> $GITHUB_OUTPUT

30-32: 🛠️ Refactor suggestion

Add error handling and validation for version retrieval
If curl fails or returns an empty tag, downstream jobs will silently operate on an empty version. Consider adding --fail to curl and checking for an empty value:

- VERSION=$(curl -s https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name)
+ if ! VERSION=$(curl -s --fail https://api.github.com/repos/cloudposse/atmos/releases/latest | jq -r .tag_name); then
+   echo "Failed to fetch latest Atmos version"
+   exit 1
+ fi
+ if [ -z "$VERSION" ]; then
+   echo "Atmos version is empty"
+   exit 1
+ fi
🧹 Nitpick comments (2)
.github/workflows/demo.yml (2)

246-249: Quote S3 commands to prevent word splitting
Without quotes, paths with spaces or special characters may break. For example:

- aws s3 ls s3://${{ env.S3_BUCKET_NAME }}
+ aws s3 ls "s3://${{ env.S3_BUCKET_NAME }}"
- aws s3 sync $ext/ s3://${{ env.S3_BUCKET_NAME }}/${{ env.S3_PATH }}/${ext}/
+ aws s3 sync "$ext/" "s3://${{ env.S3_BUCKET_NAME }}/${{ env.S3_PATH }}/${ext}/"
- aws s3 ls s3://${{ env.S3_BUCKET_NAME }}/${{ env.S3_PATH }}/${ext}/ --recursive --human-readable --summarize
+ aws s3 ls "s3://${{ env.S3_BUCKET_NAME }}/${{ env.S3_PATH }}/${ext}/" --recursive --human-readable --summarize

219-219: Pin actions/setup-go to a patch release
Using a floating major tag can pull in breaking changes. Consider pinning to the latest patch, e.g.:

- uses: actions/setup-go@v4
+ uses: actions/[email protected]
🧰 Tools
🪛 actionlint (1.7.4)

219-219: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between afea056 and c902286.

📒 Files selected for processing (3)
  • .github/workflows/demo.yml (1 hunks)
  • demo/recordings/fonts.txt (1 hunks)
  • demo/recordings/tapes/atmos-docs.tape (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • demo/recordings/fonts.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • demo/recordings/tapes/atmos-docs.tape
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/demo.yml

219-219: the runner of "actions/setup-go@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: vhs
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Analyze (go)

Comment on lines +238 to +239
ls -al demo/recordings/gif
ls -al demo/recordings/mp4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix file paths in the record step
With working-directory: demo/recordings, the commands ls -al demo/recordings/gif and ls -al demo/recordings/mp4 will error. Update them to:

- ls -al demo/recordings/gif
- ls -al demo/recordings/mp4
+ ls -al gif
+ ls -al mp4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ls -al demo/recordings/gif
ls -al demo/recordings/mp4
ls -al gif
ls -al mp4
🤖 Prompt for AI Agents (early access)
In .github/workflows/demo.yml at lines 238 to 239, the ls commands use incorrect file paths given the working-directory is set to demo/recordings. Remove the redundant demo/recordings prefix from the paths so the commands become ls -al gif and ls -al mp4 to correctly list the contents within the current working directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cloudposse Needs Cloud Posse assistance no-release Do not create a new release (wait for additional code changes) size/xl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants