-
Notifications
You must be signed in to change notification settings - Fork 0
Git Stunts Prep #2
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
base: main
Are you sure you want to change the base?
Changes from all commits
e328892
46453f2
7e1ee2f
3171922
a43496d
fa98875
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| node_modules | ||
| .git | ||
| test-repo | ||
| playwright-report | ||
| test-results |
| 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 | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Run BATS tests | ||||||||||||||||||||||||||||||||||||
| run: npm run test:setup | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+22
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CRITICAL: Workflow missing git-stunts dependency setup. This workflow runs 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:setupAlternatively, use a multi-repository checkout action or Git submodules (see Dockerfile review for options). 📝 Committable suggestion
Suggested change
🧰 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 |
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Upload test results | ||||||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v3 | ||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||
| name: bats-test-results | ||||||||||||||||||||||||||||||||||||
| path: test-results/ | ||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,3 +6,10 @@ playwright-report/ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| cms-chunks-*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cms-upload-*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git-cms-test-*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .obsidian/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
flyingrobots marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # LaTeX artifacts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *.aux | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *.log | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *.out | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *.toc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Eradicate trailing whitespace and complete your LaTeX artifact coverage. Two infractions detected:
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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Find and inspect the Dockerfile
find . -name "Dockerfile" -type f | head -20Repository: 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 -20Repository: 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 pathRepository: flyingrobots/git-cms Length of output: 46 🏁 Script executed: # Read Dockerfile to check line 21 and context
cat -n DockerfileRepository: flyingrobots/git-cms Length of output: 1793 🏁 Script executed: # Read test-setup.yml workflow
cat -n .github/workflows/test-setup.ymlRepository: flyingrobots/git-cms Length of output: 1011 🏁 Script executed: # Read ci.yml workflow
cat -n .github/workflows/ci.ymlRepository: 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 -iRepository: 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.shRepository: 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 -10Repository: 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; fiRepository: 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 The architecture expects: All CI builds will fail. The mismatch is fundamental: local development assumes sibling repos with SolutionsOption 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.gitOption 2: Git submodules - uses: actions/checkout@v4
with:
submodules: trueOption 3: Publish @git-stunts to npm registry (cleanest long-term) Replace 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 |
||
| 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 | ||
|
|
@@ -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"] | ||
| 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Markdown formatting violations decrease readability. Multiple markdownlint violations:
These harm consistency and can cause rendering issues in certain parsers. Fix them for professional documentation quality. 📋 Example fixesFor 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 (MD022, blanks-around-headings) 🤖 Prompt for AI Agents |
||
| 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Repository URL doesn't match PR context. Documentation instructs users to clone from Update to the correct URL:
📝 Proposed fix- git clone https://github.com/clduab11/git-cms.git
+ git clone https://github.com/flyingrobots/git-cms.gitAnd: -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 Also applies to: 41-41 🤖 Prompt for AI Agents |
||
|
|
||
| # 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. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrade deprecated GitHub Actions to v4.
Both
actions/checkout@v3(line 24) andactions/upload-artifact@v3(line 31) use the deprecated Node 16 runner. GitHub will eventually remove support.⬆️ Upgrade to 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