Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.git
test-repo
playwright-report
test-results
34 changes: 34 additions & 0 deletions .github/workflows/test-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test Setup Script

on:
push:
branches: [main, git-stunts]
paths:
- 'scripts/setup.sh'
- 'test/setup.bats'
- 'test/run-setup-tests.sh'
- 'test/Dockerfile.bats'
pull_request:
paths:
- 'scripts/setup.sh'
- 'test/setup.bats'
- 'test/run-setup-tests.sh'
- 'test/Dockerfile.bats'

jobs:
test-setup-script:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Upgrade deprecated GitHub Actions to v4.

Both actions/checkout@v3 (line 24) and actions/upload-artifact@v3 (line 31) use the deprecated Node 16 runner. GitHub will eventually remove support.

⬆️ Upgrade to v4
       - name: Checkout code
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
       - name: Upload test results
         if: always()
-        uses: actions/upload-artifact@v3
+        uses: actions/upload-artifact@v4
         with:
           name: bats-test-results
           path: test-results/
🧰 Tools
🪛 actionlint (1.7.10)

24-24: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In @.github/workflows/test-setup.yml at line 24, Replace deprecated action
versions: update the workflow steps that reference uses: actions/checkout@v3 and
uses: actions/upload-artifact@v3 to their v4 counterparts (actions/checkout@v4
and actions/upload-artifact@v4) so the job runs on the supported Node 18 runner;
locate the two occurrences in the .github/workflows/test-setup.yml and change
the version tags accordingly, leaving the rest of each step configuration
intact.


- name: Run BATS tests
run: npm run test:setup
Comment on lines +22 to +27
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

CRITICAL: Workflow missing git-stunts dependency setup.

This workflow runs npm run test:setup which invokes Docker builds requiring the git-stunts sibling directory (see Dockerfile line 21). The workflow only checks out the current repository, causing the pipeline failure:

'/git-stunts' not found in build context

Required fix: Clone git-stunts before running tests.

🔧 Add missing setup step
     steps:
       - name: Checkout code
         uses: actions/checkout@v4
+
+      - name: Clone git-stunts dependency
+        run: |
+          cd ..
+          git clone https://github.com/flyingrobots/git-stunts.git

       - name: Run BATS tests
         run: npm run test:setup

Alternatively, use a multi-repository checkout action or Git submodules (see Dockerfile review for options).

📝 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
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run BATS tests
run: npm run test:setup
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clone git-stunts dependency
run: |
cd ..
git clone https://github.com/flyingrobots/git-stunts.git
- name: Run BATS tests
run: npm run test:setup
🧰 Tools
🪛 actionlint (1.7.10)

24-24: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In @.github/workflows/test-setup.yml around lines 22 - 27, The workflow fails
because the test step requires a sibling repo named git-stunts in the build
context; add a step before the "Run BATS tests" / npm run test:setup step that
checks out or clones the git-stunts repository into a directory named git-stunts
(e.g., using actions/checkout@v3 with repository set to the git-stunts repo and
path set to git-stunts, or running git clone into ./git-stunts) so Dockerfile
line 21 can find /git-stunts during the build.


- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: bats-test-results
path: test-results/
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ playwright-report/
cms-chunks-*/
cms-upload-*/
git-cms-test-*/
.obsidian/

# LaTeX artifacts
*.aux
*.log
*.out
*.toc
Comment on lines +11 to +15
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Eradicate trailing whitespace and complete your LaTeX artifact coverage.

Two infractions detected:

  1. Trailing whitespace on line 12 (*.aux has a space after it). Absolutely unacceptable. Your .gitignore should be pristine.

  2. Woefully incomplete LaTeX artifact list. You've listed four patterns but ignored the dozens of other build artifacts LaTeX compilers generate:

    • *.pdf (compiled output)
    • *.synctex.gz (SyncTeX correlation data)
    • *.fls, *.fdb_latexmk (latexmk tracking)
    • *.bbl, *.blg (BibTeX bibliography)
    • *.idx, *.ind, *.ilg (makeindex)
    • *.lof, *.lot (list of figures/tables)
    • *.nav, *.snm, *.vrb (Beamer presentation)
    • *.dvi, *.ps (legacy formats)

Are you generating LaTeX docs or not? If yes, do it properly.

🔥 Proposed fix for trailing whitespace and comprehensive LaTeX ignores
 # LaTeX artifacts
-*.aux 
+*.aux
 *.log
 *.out
 *.toc
+*.pdf
+*.synctex.gz
+*.fls
+*.fdb_latexmk
+*.bbl
+*.blg
+*.idx
+*.ind
+*.ilg
+*.lof
+*.lot
+*.nav
+*.snm
+*.vrb
+*.dvi
+*.ps
📝 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
# LaTeX artifacts
*.aux
*.log
*.out
*.toc
# LaTeX artifacts
*.aux
*.log
*.out
*.toc
*.pdf
*.synctex.gz
*.fls
*.fdb_latexmk
*.bbl
*.blg
*.idx
*.ind
*.ilg
*.lof
*.lot
*.nav
*.snm
*.vrb
*.dvi
*.ps
🤖 Prompt for AI Agents
In @.gitignore around lines 11 - 15, Remove the trailing space from the '*.aux '
entry (make it '*.aux') and expand the LaTeX artifact coverage by adding common
build outputs alongside the existing '*.log', '*.out', and '*.toc': include
'*.pdf', '*.synctex.gz', '*.fls', '*.fdb_latexmk', '*.bbl', '*.blg', '*.idx',
'*.ind', '*.ilg', '*.lof', '*.lot', '*.nav', '*.snm', '*.vrb', '*.dvi', and
'*.ps' so the .gitignore fully ignores typical LaTeX artifacts.

24 changes: 17 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,31 @@
# Base stage
FROM node:20-slim AS base
ENV NODE_ENV=production
# Install Git (Required for git-cms)
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
WORKDIR /app

# IMPORTANT: This Dockerfile expects the build context to be the PARENT directory
# so it can access both git-cms/ and git-stunts/ directories.
# See docker-compose.yml which sets context: .. and dockerfile: git-cms/Dockerfile
#
# Directory structure expected:
# ~/git/
# git-cms/ ← This repo
# git-stunts/ ← Lego blocks repo

# Deps stage
FROM base AS deps
COPY package.json package-lock.json* ./
# Copy the lego blocks first so npm install can link them
COPY git-stunts /git-stunts
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Find and inspect the Dockerfile
find . -name "Dockerfile" -type f | head -20

Repository: flyingrobots/git-cms

Length of output: 76


🏁 Script executed:

# Check for GitHub Actions workflows
find . -path "./.github/workflows/*.yml" -o -path "./.github/workflows/*.yaml" | head -20

Repository: flyingrobots/git-cms

Length of output: 125


🏁 Script executed:

# List repository structure to understand if git-stunts is a sibling
ls -la ../

Repository: flyingrobots/git-cms

Length of output: 652


🏁 Script executed:

# Check git root and submodules
git ls-files --stage | grep git-stunts
git config --file .gitmodules --name-only --get-regexp path

Repository: flyingrobots/git-cms

Length of output: 46


🏁 Script executed:

# Read Dockerfile to check line 21 and context
cat -n Dockerfile

Repository: flyingrobots/git-cms

Length of output: 1793


🏁 Script executed:

# Read test-setup.yml workflow
cat -n .github/workflows/test-setup.yml

Repository: flyingrobots/git-cms

Length of output: 1011


🏁 Script executed:

# Read ci.yml workflow
cat -n .github/workflows/ci.yml

Repository: flyingrobots/git-cms

Length of output: 1762


🏁 Script executed:

# Search for any references to git-stunts in the repo
rg "git-stunts" --type yaml --type dockerfile -i

Repository: flyingrobots/git-cms

Length of output: 98


🏁 Script executed:

# Check if git-stunts is referenced in package.json or other config
cat -n package.json | grep -A 5 -B 5 "git-stunts" || echo "No match in package.json"

Repository: flyingrobots/git-cms

Length of output: 676


🏁 Script executed:

# Check test/run-docker.sh to understand how Docker build is invoked
cat -n test/run-docker.sh

Repository: flyingrobots/git-cms

Length of output: 192


🏁 Script executed:

# Check if docker-compose.yml exists
find . -name "docker-compose.yml" -o -name "docker-compose.yaml" | head -10

Repository: flyingrobots/git-cms

Length of output: 84


🏁 Script executed:

# If docker-compose.yml exists, read it
if [ -f docker-compose.yml ]; then cat -n docker-compose.yml; fi

Repository: flyingrobots/git-cms

Length of output: 1232


CRITICAL BLOCKER: CI build fails on COPY git-stunts — dependency not in build context.

Line 21 attempts to copy git-stunts from parent directory, but GitHub Actions workflows (ci.yml, test-setup.yml) only check out the current repository. When docker compose run --rm test executes, the build context lacks the required sibling directory.

The architecture expects:

~/git/
  git-cms/          ← Only this is checked out in CI
  git-stunts/       ← Missing; required by Dockerfile and package.json dependencies

All CI builds will fail. The mismatch is fundamental: local development assumes sibling repos with context: .., but CI provides only a single repo checkout.

Solutions

Option 1: Clone git-stunts in CI (fastest)

- uses: actions/checkout@v4
- name: Checkout git-stunts
  run: |
    cd ..
    git clone https://github.com/flyingrobots/git-stunts.git

Option 2: Git submodules

- uses: actions/checkout@v4
  with:
    submodules: true

Option 3: Publish @git-stunts to npm registry (cleanest long-term)

Replace file:../git-stunts/* dependencies in package.json with published versions, remove COPY git-stunts from Dockerfile.

Fix required before merge.

🧰 Tools
🪛 GitHub Actions: CI

[error] 21-21: BUILD STEP FAILED: [deps 1/3] COPY git-stunts /git-stunts — '/git-stunts' not found in build context. Docker build cannot proceed.

🤖 Prompt for AI Agents
In @Dockerfile at line 21, The Dockerfile's COPY git-stunts line fails in CI
because the sibling repo isn't in the build context; fix by either (A) changing
CI workflows (ci.yml and test-setup.yml) to fetch the sibling repo before
building (e.g., checkout parent and git clone or enable submodules) so docker
compose run --rm test has ../git-stunts available, or (B) remove the COPY
git-stunts from the Dockerfile and replace package.json file:../git-stunts/*
dependencies with a published @git-stunts npm package (or versioned dependency)
so the build no longer requires a local sibling; apply the matching change to
Dockerfile (remove COPY git-stunts) and package.json and update CI accordingly.

COPY git-cms/package.json git-cms/package-lock.json* ./
RUN npm ci --include=dev

# Development stage
FROM base AS dev
ENV NODE_ENV=development
COPY --from=deps /git-stunts /git-stunts
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Configure Git for Dev
COPY git-cms .
RUN git config --global user.email "dev@git-cms.local"
RUN git config --global user.name "Git CMS Dev"
RUN git config --global init.defaultBranch main
Expand All @@ -26,10 +36,10 @@ CMD ["npm", "run", "serve"]
# Test stage
FROM base AS test
ENV NODE_ENV=test
COPY --from=deps /git-stunts /git-stunts
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Configure Git for Test
COPY git-cms .
RUN git config --global user.email "bot@git-cms.local"
RUN git config --global user.name "Git CMS Bot"
RUN git config --global init.defaultBranch main
CMD ["npm", "run", "test:local"]
CMD ["npm", "run", "test:local"]
111 changes: 111 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Getting Started with Git CMS

Welcome to **Git CMS**! This tool allows you to write and manage blog posts using Git—the same technology developers use to track code—but with a simple interface that works like a regular app.

Follow these steps to get up and running.

---

## 1. Prerequisites

Before you start, you need two things installed on your computer:

1. **Git**: [Download and install Git here](https://git-scm.com/downloads). (Choose the default options during installation).
2. **Node.js**: [Download and install Node.js here](https://nodejs.org/). (Choose the "LTS" version).

---

## 2. Installation

You can install Git CMS directly on your computer or run it using **Docker**.

### Option A: Direct Installation
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Markdown formatting violations decrease readability.

Multiple markdownlint violations:

  • Lines 22, 39, 86, 109: Headings lack blank line below (MD022)
  • Lines 25, 54, 58, 70, 72: Code blocks lack surrounding blank lines (MD031)
  • Line 74: Bare URL should be wrapped in angle brackets or markdown link (MD034)

These harm consistency and can cause rendering issues in certain parsers. Fix them for professional documentation quality.

📋 Example fixes

For headings (add blank line after):

 ### Option A: Direct Installation
+
 1.  Open your **Terminal**

For code blocks (add blank lines before and after):

 2.  Type the following commands one by one:
+
     ```bash
     # Download the tool
     git clone https://github.com/flyingrobots/git-cms.git
     ```
+

For bare URLs (wrap in angle brackets or make a link):

-3.  Open your web browser (Chrome, Safari, or Edge) and go to **http://localhost:4638/**.
+3.  Open your web browser (Chrome, Safari, or Edge) and go to **<http://localhost:4638/>**.

Also applies to: 25-25, 39-39, 54-54, 58-58, 70-70, 72-72, 74-74, 86-86, 109-109

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

22-22: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🤖 Prompt for AI Agents
In @GETTING_STARTED.md at line 22, Fix markdownlint violations in
GETTING_STARTED.md: add a blank line immediately after the headings (e.g., "###
Option A: Direct Installation" and the other headings flagged at lines 22, 39,
86, 109) to satisfy MD022; ensure fenced code blocks have a blank line before
and after them at the blocks flagged (lines 25, 54, 58, 70, 72) to satisfy
MD031; and replace the bare URL on line 74 with either an angle-bracket-wrapped
URL (<https://...>) or a proper markdown link to satisfy MD034. Make these edits
in the referenced sections so spacing is consistent across the document.

1. Open your **Terminal** (on Mac/Linux) or **Command Prompt/PowerShell** (on Windows).
2. Type the following commands one by one:
```bash
# Download the tool
git clone https://github.com/clduab11/git-cms.git
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Repository URL doesn't match PR context.

Documentation instructs users to clone from clduab11/git-cms, but this PR is in flyingrobots/git-cms and aims to prep for handoff to Git Stunts org. This will send users to the wrong repository.

Update to the correct URL:

  • Current state: flyingrobots/git-cms
  • Future state (if handoff complete): git-stunts/git-cms or appropriate org URL
📝 Proposed fix
-    git clone https://github.com/clduab11/git-cms.git
+    git clone https://github.com/flyingrobots/git-cms.git

And:

-1.  Download the tool: `git clone https://github.com/clduab11/git-cms.git`
+1.  Download the tool: `git clone https://github.com/flyingrobots/git-cms.git`

Adjust to git-stunts org if that's the intended final destination.

Also applies to: 41-41

🤖 Prompt for AI Agents
In @GETTING_STARTED.md at line 27, Update the repository clone URL in
GETTING_STARTED.md: replace the incorrect org `clduab11` with the current PR org
`flyingrobots` (i.e., change the git clone command using the string `git clone
https://github.com/clduab11/git-cms.git` to `git clone
https://github.com/flyingrobots/git-cms.git`) and, if the handoff to Git Stunts
is final, change it instead to the target org `git-stunts` (i.e., `git clone
https://github.com/git-stunts/git-cms.git`), and make the same replacement for
the other occurrence referenced around line 41.


# Enter the folder
cd git-cms

# Install the helper files
npm install

# Make the 'git-cms' command available everywhere on your computer
npm link
```

### Option B: Using Docker (Recommended for isolation)
If you have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed, you can run the CMS without installing Node.js:
1. Download the tool: `git clone https://github.com/clduab11/git-cms.git`
2. Enter the folder: `cd git-cms`
3. Run with Docker: `docker compose up app`
*Note: By default, this will save posts inside the `git-cms` folder. See Section 3 to change this.*

---

## 3. Setting Up Your "Content Home"

Git CMS doesn't save your posts inside the tool itself; it saves them in a "Repository" (a special folder) of your choice.
1. Create a new folder for your blog posts (e.g., `my-awesome-blog`).
2. Enter that folder in your terminal and "initialize" it:
```bash
mkdir my-awesome-blog
cd my-awesome-blog
git init
```
3. **Crucial Step**: Tell Git CMS to use this folder. You do this by setting an "Environment Variable" named `GIT_CMS_REPO` to the path of this folder.
* **Mac/Linux**: `export GIT_CMS_REPO=/Users/yourname/my-awesome-blog`
* **Windows**: `$env:GIT_CMS_REPO="C:\Users\yourname\my-awesome-blog"`
---
## 4. Running the CMS
Now you are ready to start the interface!
1. In your terminal, type:
```bash
git-cms serve
```
2. You will see a message: `[git-cms] Admin UI: http://localhost:4638/`
3. Open your web browser (Chrome, Safari, or Edge) and go to **http://localhost:4638/**.
---
## 5. Writing Your First Post
1. Click the **+ New Article** button on the left.
2. **Slug**: Enter a short ID for your post (e.g., `my-first-post`). No spaces!
3. **Title**: Enter the title of your article.
4. **Content**: Type your post in the large box. You can use [Markdown](https://www.markdownguide.org/basic-syntax/) to add formatting like **bold** or *italics*.
5. Click **Save Draft**.
### To Make it Public:
When you are happy with your post, click the **Publish** button. This marks the post as "live."
---
## 6. Managing Images and Files
You can add images to your posts easily:
1. In the editor, click the **Attach File** button at the bottom.
2. Select an image from your computer.
3. Git CMS will "chunk" the image, store it safely in Git, and automatically add the code to your post so the image shows up.
---
## 7. Advanced: CLI Power (Optional)
If you prefer using the terminal instead of the web browser, you can use these commands:
* `git-cms list`: See all your drafts.
* `git-cms show <slug>`: Read a post in the terminal.
* `git-cms publish <slug>`: Publish a draft.
---
### Troubleshooting
* **"Command not found"**: Ensure you ran `npm link` in the `git-cms` folder.
* **"Not a git repository"**: Ensure you ran `git init` inside your content folder and that your `GIT_CMS_REPO` path is correct.
Loading
Loading