Skip to content

Conversation

@dohernandez
Copy link
Member

@dohernandez dohernandez commented Dec 9, 2025

Description

This PR enhances the GitHub workflow to sync docker-compose.yaml from the genlayer-node repository, adds a new script to update the docker-compose example in the setup guide, and improves documentation for the existing scripts. It also removes the now-unnecessary config sanitization scripts since the source config is already sanitized.

Key Changes

  • New docker-compose sync: Added docker_compose sync type to the workflow matrix that syncs release/docker-compose.yaml from genlayer-node to content/validators/docker-compose.yaml
  • Docker-compose sanitization: Created sanitize-docker-compose.sh script using sed to remove the alloy service and volumes section from the synced docker-compose file
  • New update script: Created update-docker-compose-in-setup-guide.js to inject docker-compose content into setup-guide.mdx
  • Documentation: Added scripts/README.md documenting all update scripts and updated the main README with usage instructions
  • Cleanup: Removed sanitize-config.sh and sanitize-config.py as they are no longer needed

Files Changed

File Change
.github/workflows/sync-docs-from-node.yml Added docker_compose to matrix, sparse-checkout, and summary
.github/actions/sync-files/action.yml Added docker_compose preparation and sanitization step
.github/scripts/sanitize-docker-compose.sh New script to sanitize docker-compose
.github/scripts/doc-generator.sh Added docker-compose update script call
scripts/update-docker-compose-in-setup-guide.js New script to update setup guide
scripts/README.md New documentation for scripts
content/validators/docker-compose.yaml Docker-compose source file
package.json Added node-update-docker-compose npm script
README.md Added section for validator setup guide scripts

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (maintenance tasks, refactoring, or non-functional changes like updating dependencies or improving documentation)

Checklist:

  • My code follows the code style of this project.
  • I have added the necessary documentation (if appropriate)
  • I have added tests (if appropriate)
  • Lint and unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features

    • Added Docker Compose synchronization and automatic inclusion in the validator setup and docs; new script to update the setup guide with the Compose file.
    • New doc-generation step to incorporate Docker Compose updates into CI output.
  • Refactor

    • Streamlined sanitization for configs and Docker Compose with unified, safer processing and temp-file cleanup; removed the previous configurable sanitize input.
  • Documentation

    • README, scripts docs, and PR/doc summaries updated to reflect Docker Compose support.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link

netlify bot commented Dec 9, 2025

Deploy Preview for genlayer-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 7bdc20e
🔍 Latest deploy log https://app.netlify.com/projects/genlayer-docs/deploys/693811b4135ac000088a5507

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

Replaces Python-based config sanitization with yq/shell scripts, adds Docker Compose as a new sync type (workflow matrix, sparse-checkout, sanitize & temp-file prepare/cleanup steps), introduces docker-compose content and update tooling, and updates docs and npm scripts to incorporate the new flow.

Changes

Cohort / File(s) Summary
Composite action & inputs
.github/actions/sync-files/action.yml
Removed sanitize_script input; added Prepare steps to copy/sanitize config and docker-compose into temp locations and expose CONFIG_SOURCE / DOCKER_COMPOSE_SOURCE; Sync step uses those sources when present; added docker-compose temp cleanup.
Sanitize scripts (config)
.github/scripts/sanitize-config.sh
Replaced Python sanitization with yq-based YAML transforms (set RPC placeholders, remove node.dev); removed backup and Python invocation.
Sanitize scripts (docker-compose)
.github/scripts/sanitize-docker-compose.sh
New script to validate input and sanitize docker-compose YAML (remove alloy service and volumes, prune comments/blank lines) using yq/sed.
Removed Python sanitizer
.github/scripts/sanitize-config.py
Deleted: indentation-based Python sanitizer and its entry-point (functions removed).
Workflow changes
.github/workflows/sync-docs-from-node.yml, .github/scripts/doc-generator.sh, .github/workflows/README.md
Added docker_compose to sync_type matrix and sparse-checkout path; added set_params case and title mapping; removed sanitize_script usage; added node-update-docker-compose step in doc-generator and updated aggregated summary and docs README.
Docker Compose content & docs
content/validators/docker-compose.yaml, pages/validators/setup-guide.mdx
Added docker-compose.yaml with webdriver-container and genlayer-node services; minor whitespace tweak in setup guide.
Update scripts & package.json
scripts/update-docker-compose-in-setup-guide.js, package.json, scripts/README.md
New Node script to inject docker-compose YAML into the setup guide; added node-update-docker-compose npm script and inserted into dev/build chains; documented scripts in scripts/README.md.
Documentation updates
README.md, .github/workflows/README.md
Added docs describing the docker-compose sync, sanitization behavior, and script references; updated workflow README to reflect 6 sync types and sanitizers.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Developer
  participant GH_WF as "GitHub Actions (sync-docs-from-node)"
  participant Composite as "sync-files composite action"
  participant Sanitizers as "sanitize-config.sh / sanitize-docker-compose.sh"
  participant Repo as "Repo (release/* → content/* / temp dirs)"
  Developer->>GH_WF: push / schedule (matrix includes docker_compose)
  GH_WF->>Composite: run sync step (sync_type=docker_compose)
  Composite->>Repo: sparse-checkout release/docker-compose.yaml
  Composite->>Sanitizers: copy & sanitize → write DOCKER_COMPOSE_SOURCE (temp)
  Sanitizers->>Repo: write sanitized temp file
  Composite->>Repo: rsync DOCKER_COMPOSE_SOURCE → content/validators/docker-compose.yaml
  Composite->>Repo: cleanup temp docker-compose dir
  GH_WF->>Developer: open PR with aggregated summary (includes Docker Compose)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to focus on:
    • Matrix and set_params branching in .github/workflows/sync-docs-from-node.yml.
    • Composite action changes and new env/output names in .github/actions/sync-files/action.yml.
    • yq transformations and portability in .github/scripts/sanitize-config.sh and .github/scripts/sanitize-docker-compose.sh.
    • Pattern matching and path assumptions in scripts/update-docker-compose-in-setup-guide.js.

Possibly related PRs

Suggested reviewers

  • AgustinRamiroDiaz
  • MuncleUscles

Poem

🐰 I hopped through CI, trimmed old Python away,
Yq shined its light and made the configs play,
A docker-compose found its tidy home,
Temp files gone, and docs now brightly combed,
Hop, sync, merge — I nibble bugs with glee! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: updating the docs workflow to support docker-compose synchronization, which is the core objective of this PR.
Description check ✅ Passed The description is comprehensive and well-structured, including key changes, a detailed file change table, and checklist items. It aligns with the template format and provides sufficient context.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/nod-561-update-docs-github-workflow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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

Caution

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

⚠️ Outside diff range comments (1)
.github/workflows/sync-docs-from-node.yml (1)

331-346: Consider removing --all flag from selective git staging command.

The commit_and_push_changes function in git-utils.sh (line 47) uses git add --all content/validators pages/api-references pages/validators, but based on your established preference from PR #257, the selective staging should be git add content/validators pages/api-references pages/validators without the --all flag. The --all flag stages deletions across the entire working directory, which contradicts the selective staging approach intended to avoid staging unintended changes.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ccd959c and 05668bd.

📒 Files selected for processing (13)
  • .github/actions/sync-files/action.yml (2 hunks)
  • .github/scripts/doc-generator.sh (1 hunks)
  • .github/scripts/sanitize-config.py (0 hunks)
  • .github/scripts/sanitize-config.sh (0 hunks)
  • .github/scripts/sanitize-docker-compose.sh (1 hunks)
  • .github/workflows/README.md (5 hunks)
  • .github/workflows/sync-docs-from-node.yml (5 hunks)
  • README.md (1 hunks)
  • content/validators/docker-compose.yaml (1 hunks)
  • package.json (1 hunks)
  • pages/validators/setup-guide.mdx (0 hunks)
  • scripts/README.md (1 hunks)
  • scripts/update-docker-compose-in-setup-guide.js (1 hunks)
💤 Files with no reviewable changes (3)
  • pages/validators/setup-guide.mdx
  • .github/scripts/sanitize-config.sh
  • .github/scripts/sanitize-config.py
🧰 Additional context used
📓 Path-based instructions (1)
scripts/**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Scripts for build-time generation are located in the scripts/ directory

Files:

  • scripts/update-docker-compose-in-setup-guide.js
  • scripts/README.md
🧠 Learnings (19)
📓 Common learnings
Learnt from: dohernandez
Repo: genlayerlabs/genlayer-docs PR: 257
File: .github/workflows/sync-docs-from-node.yml:0-0
Timestamp: 2025-07-26T13:26:45.588Z
Learning: In the sync-docs-from-node.yml workflow, the user prefers selective git staging with `git add content/validators pages/api-references pages/validators` rather than `git add -A` to avoid staging unintended changes, as these are the expected directories to be modified during the documentation sync process.
Learnt from: dohernandez
Repo: genlayerlabs/genlayer-docs PR: 308
File: pages/validators/setup-guide.mdx:790-790
Timestamp: 2025-12-03T17:07:37.200Z
Learning: In pages/validators/setup-guide.mdx: When documenting docker-compose setup, users must create genvm-module-web-docker.yaml (separate from the tarball's genvm-module-web.yaml) to point the webdriver URL to the docker service name (http://webdriver-container:4444) instead of localhost, as the tarball version is configured for binary execution with localhost.
📚 Learning: 2025-12-03T17:07:37.200Z
Learnt from: dohernandez
Repo: genlayerlabs/genlayer-docs PR: 308
File: pages/validators/setup-guide.mdx:790-790
Timestamp: 2025-12-03T17:07:37.200Z
Learning: In pages/validators/setup-guide.mdx: When documenting docker-compose setup, users must create genvm-module-web-docker.yaml (separate from the tarball's genvm-module-web.yaml) to point the webdriver URL to the docker service name (http://webdriver-container:4444) instead of localhost, as the tarball version is configured for binary execution with localhost.

Applied to files:

  • scripts/update-docker-compose-in-setup-guide.js
  • content/validators/docker-compose.yaml
  • .github/workflows/README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur

Applied to files:

  • scripts/update-docker-compose-in-setup-guide.js
  • .github/workflows/README.md
  • scripts/README.md
  • README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version list in curl command output example (line ~88), download command version variable (line ~113), consensus contract addresses and genesis block number (lines ~143-146), and command documentation (line ~347) in setup-guide.mdx for new validator releases

Applied to files:

  • scripts/update-docker-compose-in-setup-guide.js
  • scripts/README.md
  • README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Enhance command documentation in setup-guide.mdx when new features are added to existing commands

Applied to files:

  • scripts/update-docker-compose-in-setup-guide.js
  • scripts/README.md
  • README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update configuration examples with new contract addresses in setup-guide.mdx when applicable

Applied to files:

  • scripts/update-docker-compose-in-setup-guide.js
  • README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update version references in download examples and version lists in setup-guide.mdx when new validator releases occur

Applied to files:

  • scripts/update-docker-compose-in-setup-guide.js
  • scripts/README.md
  • README.md
📚 Learning: 2025-08-19T21:48:24.895Z
Learnt from: epsjunior
Repo: genlayerlabs/genlayer-docs PR: 278
File: components/copy-page.tsx:0-0
Timestamp: 2025-08-19T21:48:24.895Z
Learning: In the genlayer-docs project, markdown files are generated during the build process via `npm run sync-mdx`. If markdown generation fails, the entire deployment process fails, ensuring that markdown files will always exist in production environments.

Applied to files:

  • package.json
  • .github/workflows/README.md
  • scripts/README.md
📚 Learning: 2025-08-19T22:01:32.272Z
Learnt from: epsjunior
Repo: genlayerlabs/genlayer-docs PR: 278
File: scripts/process-mdx-to-md.js:150-184
Timestamp: 2025-08-19T22:01:32.272Z
Learning: In the genlayer-docs project build process, epsjunior prefers to let file operations in build scripts fail fast with natural Node.js errors rather than adding graceful error handling, to ensure build integrity and prevent incomplete builds from proceeding.

Applied to files:

  • package.json
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)

Applied to files:

  • package.json
  • .github/workflows/README.md
  • scripts/README.md
  • .github/scripts/doc-generator.sh
📚 Learning: 2025-08-21T17:36:07.724Z
Learnt from: epsjunior
Repo: genlayerlabs/genlayer-docs PR: 285
File: scripts/list-docs-routes.js:24-26
Timestamp: 2025-08-21T17:36:07.724Z
Learning: In the genlayer-docs project, the route discovery script (scripts/list-docs-routes.js) intentionally limits traversal to directories containing _meta.json files to ensure tests mirror the actual site navigation behavior and avoid testing draft content that isn't part of the public navigation structure.

Applied to files:

  • package.json
  • scripts/README.md
📚 Learning: 2025-07-26T13:26:45.588Z
Learnt from: dohernandez
Repo: genlayerlabs/genlayer-docs PR: 257
File: .github/workflows/sync-docs-from-node.yml:0-0
Timestamp: 2025-07-26T13:26:45.588Z
Learning: In the sync-docs-from-node.yml workflow, the user prefers selective git staging with `git add content/validators pages/api-references pages/validators` rather than `git add -A` to avoid staging unintended changes, as these are the expected directories to be modified during the documentation sync process.

Applied to files:

  • .github/workflows/README.md
  • .github/workflows/sync-docs-from-node.yml
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-sitemap-xml.js : Build process includes automatic generation of sitemap (scripts/generate-sitemap-xml.js)

Applied to files:

  • .github/workflows/README.md
  • scripts/README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/**/* : Scripts for build-time generation are located in the scripts/ directory

Applied to files:

  • scripts/README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/changelog.mdx : Changelog Updates (pages/validators/changelog.mdx): Add new version entries at the top in reverse chronological order, use consistent format: # v0.x.x, ## New features, ## Bug fixes, ## Misc, and include missing intermediate versions if needed

Applied to files:

  • README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : GenVM diagnostics integration affects the doctor command behavior and should be documented in the validator setup guide

Applied to files:

  • README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update genesis block configuration in consensus section of setup-guide.mdx when network upgrades occur

Applied to files:

  • README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Update consensus contract addresses and genesis block number in setup-guide.mdx when network upgrades occur

Applied to files:

  • README.md
📚 Learning: 2025-07-14T09:14:00.225Z
Learnt from: dohernandez
Repo: genlayerlabs/genlayer-docs PR: 245
File: .github/workflows/sync-docs-from-node.yml:69-72
Timestamp: 2025-07-14T09:14:00.225Z
Learning: The correct parameter name for enabling cone mode in sparse checkout for actions/checkoutv4 is `sparse-checkout-cone-mode` (not `sparse-checkout-cone`). This parameter should be set to `true` to enable cone mode for directory-based sparse checkout optimization.

Applied to files:

  • .github/workflows/sync-docs-from-node.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Generate Documentation
  • GitHub Check: Redirect rules - genlayer-docs
  • GitHub Check: Header rules - genlayer-docs
  • GitHub Check: Pages changed - genlayer-docs
  • GitHub Check: Playwright E2E
🔇 Additional comments (13)
README.md (1)

74-89: Validator setup guide update section looks consistent

The new section correctly documents the three setup-guide update scripts and points readers to scripts/README.md; commands and paths match the actual scripts.

.github/scripts/doc-generator.sh (1)

41-48: New docker-compose step integrates cleanly into doc generation flow

The node-update-docker-compose step mirrors existing steps and correctly participates in the shared failed flag, so any non-zero exit will surface in the final status.

.github/scripts/sanitize-docker-compose.sh (1)

1-26: Sanitization script is simple and robust for the intended use

Argument/file checks plus the sed range delete from # Grafana Alloy to EOF match the stated goal of stripping the alloy-related tail for docs.

package.json (1)

6-8: npm script wiring for docker-compose updates is correct

node-update-docker-compose is correctly defined and integrated into both dev and build pipelines immediately after node-update-config, keeping the setup guide aligned with content/validators/docker-compose.yaml.

Also applies to: 14-15

content/validators/docker-compose.yaml (1)

1-42: Docker Compose definition aligns with validator/docker-genvm guidance

The compose file cleanly defines webdriver-container and genlayer-node, uses genvm-module-web-docker.yaml for the GenVM config, and exposes webdriver via the docker service, matching the documented docker-compose setup expectations. Based on learnings, this is the expected pattern for the validator guide.

.github/workflows/README.md (1)

15-18: Documentation accurately reflects docker_compose integration.

The README.md comprehensively documents the new sync type, file structure, sanitization process, and npm script. All sections are logically organized and consistent with the PR changes.

Also applies to: 117-118, 175-180, 232-233

.github/workflows/sync-docs-from-node.yml (7)

95-95: Matrix integration is clean and logical.

The docker_compose type is properly added to the matrix strategy alongside existing types.

Also applies to: 95-95


109-115: Sparse-checkout configuration is correct.

The release/docker-compose.yaml path is properly added and sparse-checkout-cone-mode: true uses the correct parameter name.


133-138: Parameter setup for docker_compose is correctly structured.

Follows the established pattern for single-file syncs and matches the documented source/target paths.


397-405: PR body correctly includes docker-compose update script.

The npm run node-update-docker-compose script is properly listed in the automated process checklist at line 403.


471-471: Summary loop properly includes docker_compose sync reporting.

The docker_compose type is integrated into the summary report loop with appropriate title and emoji mapping at line 476.

Also applies to: 476-476


267-271: No action needed. The .github/scripts/doc-generator.sh script properly invokes npm run node-update-docker-compose at lines 41-48 with appropriate error handling and status reporting. The workflow integration is correctly implemented.


159-167: Sanitization properly integrated in composite action.

The composite action correctly handles sanitization for docker_compose type. The .github/actions/sync-files/action.yml contains a dedicated "Prepare docker-compose file" step that detects docker_compose type and explicitly invokes .github/scripts/sanitize-docker-compose.sh on the source file before syncing. This internal handling justifies the removal of the explicit sanitize_script input parameter.

Comment on lines +62 to +86
- name: Prepare docker-compose file
if: inputs.type == 'docker_compose'
shell: bash
run: |
# For docker_compose type, handle special case:
# Copy and sanitize (remove alloy service and volumes)
if [[ -f "${{ inputs.source_path }}" ]]; then
# Create temp directory
TEMP_DIR=$(mktemp -d)
echo "TEMP_DOCKER_COMPOSE_DIR=$TEMP_DIR" >> $GITHUB_ENV
# Copy docker-compose.yaml
cp "${{ inputs.source_path }}" "$TEMP_DIR/docker-compose.yaml"
# Sanitize: remove alloy service and volumes section using yq
bash .github/scripts/sanitize-docker-compose.sh "$TEMP_DIR/docker-compose.yaml"
# Update source path for sync
echo "DOCKER_COMPOSE_SOURCE=$TEMP_DIR/docker-compose.yaml" >> $GITHUB_ENV
else
echo "Docker compose source file not found: ${{ inputs.source_path }}"
exit 1
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 | 🟡 Minor

Update stale comment about docker-compose sanitization implementation

The docker-compose prep step calls .github/scripts/sanitize-docker-compose.sh, which uses sed, but the comment still says “using yq”.

You can align the comment with the implementation:

-        # Sanitize: remove alloy service and volumes section using yq
+        # Sanitize: remove alloy service and volumes section using the sanitize-docker-compose.sh script
📝 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 docker-compose file
if: inputs.type == 'docker_compose'
shell: bash
run: |
# For docker_compose type, handle special case:
# Copy and sanitize (remove alloy service and volumes)
if [[ -f "${{ inputs.source_path }}" ]]; then
# Create temp directory
TEMP_DIR=$(mktemp -d)
echo "TEMP_DOCKER_COMPOSE_DIR=$TEMP_DIR" >> $GITHUB_ENV
# Copy docker-compose.yaml
cp "${{ inputs.source_path }}" "$TEMP_DIR/docker-compose.yaml"
# Sanitize: remove alloy service and volumes section using yq
bash .github/scripts/sanitize-docker-compose.sh "$TEMP_DIR/docker-compose.yaml"
# Update source path for sync
echo "DOCKER_COMPOSE_SOURCE=$TEMP_DIR/docker-compose.yaml" >> $GITHUB_ENV
else
echo "Docker compose source file not found: ${{ inputs.source_path }}"
exit 1
fi
- name: Prepare docker-compose file
if: inputs.type == 'docker_compose'
shell: bash
run: |
# For docker_compose type, handle special case:
# Copy and sanitize (remove alloy service and volumes)
if [[ -f "${{ inputs.source_path }}" ]]; then
# Create temp directory
TEMP_DIR=$(mktemp -d)
echo "TEMP_DOCKER_COMPOSE_DIR=$TEMP_DIR" >> $GITHUB_ENV
# Copy docker-compose.yaml
cp "${{ inputs.source_path }}" "$TEMP_DIR/docker-compose.yaml"
# Sanitize: remove alloy service and volumes section using the sanitize-docker-compose.sh script
bash .github/scripts/sanitize-docker-compose.sh "$TEMP_DIR/docker-compose.yaml"
# Update source path for sync
echo "DOCKER_COMPOSE_SOURCE=$TEMP_DIR/docker-compose.yaml" >> $GITHUB_ENV
else
echo "Docker compose source file not found: ${{ inputs.source_path }}"
exit 1
fi
🤖 Prompt for AI Agents
.github/actions/sync-files/action.yml around lines 62 to 86: the block preparing
the docker-compose file claims it "Sanitize: remove alloy service and volumes
section using yq" but the actual script
.github/scripts/sanitize-docker-compose.sh uses sed; update the comment to
correctly state that the sanitize script uses sed (or a shell stream-edit)
instead of yq, keeping the rest of the logic unchanged so the comment accurately
reflects the implementation.

Comment on lines +65 to +73
## Other Scripts

| Script | Description |
|--------|-------------|
| `generate-full-docs.js` | Concatenates all MDX files into a single documentation file |
| `generate-sitemap-xml.js` | Generates `sitemap.xml` from all MDX files |
| `generate-changelog.js` | Generates the changelog page from individual version files |
| `generate-node-api-docs.js` | Generates API documentation and navigation |
| `sync-meta-files.js` | Synchronizes `_meta.json` files with actual content |
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 | 🟡 Minor

Fix script name in “Other Scripts” table

The table lists generate-node-api-docs.js, but package.json runs node scripts/generate-api-docs.js for API docs. This mismatch can confuse contributors.

Consider updating the entry:

-| `generate-node-api-docs.js` | Generates API documentation and navigation |
+| `generate-api-docs.js` | Generates API documentation and navigation |
📝 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
## Other Scripts
| Script | Description |
|--------|-------------|
| `generate-full-docs.js` | Concatenates all MDX files into a single documentation file |
| `generate-sitemap-xml.js` | Generates `sitemap.xml` from all MDX files |
| `generate-changelog.js` | Generates the changelog page from individual version files |
| `generate-node-api-docs.js` | Generates API documentation and navigation |
| `sync-meta-files.js` | Synchronizes `_meta.json` files with actual content |
## Other Scripts
| Script | Description |
|--------|-------------|
| `generate-full-docs.js` | Concatenates all MDX files into a single documentation file |
| `generate-sitemap-xml.js` | Generates `sitemap.xml` from all MDX files |
| `generate-changelog.js` | Generates the changelog page from individual version files |
| `generate-api-docs.js` | Generates API documentation and navigation |
| `sync-meta-files.js` | Synchronizes `_meta.json` files with actual content |
🤖 Prompt for AI Agents
In scripts/README.md around lines 65 to 73, the table entry for the API docs
script uses the wrong filename (`generate-node-api-docs.js`) which doesn't match
package.json; update that table row to use the actual script name
`generate-api-docs.js` (or, if package.json is wrong, align package.json
instead), and keep the description as "Generates API documentation and
navigation" so the README and package.json are consistent.

Comment on lines +14 to +22
if (!fs.existsSync(dockerComposePath)) {
console.error(`Docker compose file ${dockerComposePath} does not exist`);
return;
}

if (!fs.existsSync(setupGuidePath)) {
console.error(`Setup guide file ${setupGuidePath} does not exist`);
return;
}
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 | 🟠 Major

Ensure the script fails the build when docker-compose update cannot run

Right now, missing files or failure to find the docker-compose block only log to stderr and then return, so the process exits with code 0. Because this script is part of the doc-generation and build chains, that can leave the setup guide out of sync while CI still passes. Based on learnings, build-time scripts here are expected to fail fast instead of silently skipping work.

Consider exiting with a non-zero status on unrecoverable errors:

  if (!fs.existsSync(dockerComposePath)) {
    console.error(`Docker compose file ${dockerComposePath} does not exist`);
-    return;
+    process.exit(1);
  }

  if (!fs.existsSync(setupGuidePath)) {
    console.error(`Setup guide file ${setupGuidePath} does not exist`);
-    return;
+    process.exit(1);
  }
@@
  } else {
-    console.error('Could not find docker-compose pattern in setup guide');
+    console.error('Could not find docker-compose pattern in setup guide');
@@
     if (!found) {
-      console.error('Could not find docker-compose YAML block in setup guide');
+      console.error('Could not find docker-compose YAML block in setup guide');
+      process.exit(1);
     }
   }

This way, npm run node-update-docker-compose will fail loudly if the expected section or files are missing, and the higher-level workflows (doc-generator.sh, dev/build scripts, CI) will correctly surface the problem.

Also applies to: 45-47, 71-73

🤖 Prompt for AI Agents
In scripts/update-docker-compose-in-setup-guide.js around lines 14-22 (and
similarly at 45-47 and 71-73), the script currently logs errors and returns when
files or expected sections are missing which leaves the process exiting with
code 0; change these early-return error paths to call process.exit(1) (or throw
an Error) after logging a clear message so the script fails fast and returns a
non-zero exit code when the docker-compose file, the setup guide, or the
docker-compose block cannot be found or updated, ensuring CI/doc-generation
detects the failure.

- Add sanitize-config.sh using yq to replace RPC URLs and remove node.dev
- Update docker-compose sanitization to use yq + sed
- Install yq in workflow for both config and docker_compose sync types
- Update README with sanitization documentation
@dohernandez dohernandez force-pushed the chore/nod-561-update-docs-github-workflow branch from f0af425 to 7bdc20e Compare December 9, 2025 12:10
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 (1)
.github/actions/sync-files/action.yml (1)

80-81: Update stale comment to accurately describe sanitization method.

The comment on line 80 states "using yq" but .github/scripts/sanitize-docker-compose.sh uses both yq and sed. Update the comment to reflect the actual implementation.

-          # Sanitize: remove alloy service and volumes section using yq
+          # Sanitize: remove alloy service and volumes section using the sanitize-docker-compose.sh script
🧹 Nitpick comments (1)
.github/scripts/sanitize-docker-compose.sh (1)

26-27: Sed pattern for alloy comment cleanup could be fragile with non-standard YAML structures.

The pattern /# Grafana Alloy/,/^[^ #]/{ /^[^ #]/!d } on line 26 assumes comments follow a specific structure (comments before the next service definition). If the source docker-compose.yaml has alloy comments in unexpected locations or with different formatting, the cleanup may not work as intended.

Consider adding a fallback or logging to verify what was actually removed. Alternatively, document the expected format assumption clearly in the script header.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0af425 and 7bdc20e.

📒 Files selected for processing (5)
  • .github/actions/sync-files/action.yml (2 hunks)
  • .github/scripts/sanitize-config.sh (2 hunks)
  • .github/scripts/sanitize-docker-compose.sh (1 hunks)
  • .github/workflows/README.md (5 hunks)
  • .github/workflows/sync-docs-from-node.yml (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/scripts/sanitize-config.sh
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: dohernandez
Repo: genlayerlabs/genlayer-docs PR: 257
File: .github/workflows/sync-docs-from-node.yml:0-0
Timestamp: 2025-07-26T13:26:45.588Z
Learning: In the sync-docs-from-node.yml workflow, the user prefers selective git staging with `git add content/validators pages/api-references pages/validators` rather than `git add -A` to avoid staging unintended changes, as these are the expected directories to be modified during the documentation sync process.
📚 Learning: 2025-07-26T13:26:45.588Z
Learnt from: dohernandez
Repo: genlayerlabs/genlayer-docs PR: 257
File: .github/workflows/sync-docs-from-node.yml:0-0
Timestamp: 2025-07-26T13:26:45.588Z
Learning: In the sync-docs-from-node.yml workflow, the user prefers selective git staging with `git add content/validators pages/api-references pages/validators` rather than `git add -A` to avoid staging unintended changes, as these are the expected directories to be modified during the documentation sync process.

Applied to files:

  • .github/workflows/README.md
  • .github/workflows/sync-docs-from-node.yml
📚 Learning: 2025-08-19T21:48:24.895Z
Learnt from: epsjunior
Repo: genlayerlabs/genlayer-docs PR: 278
File: components/copy-page.tsx:0-0
Timestamp: 2025-08-19T21:48:24.895Z
Learning: In the genlayer-docs project, markdown files are generated during the build process via `npm run sync-mdx`. If markdown generation fails, the entire deployment process fails, ensuring that markdown files will always exist in production environments.

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-full-docs.js : Build process includes automatic generation of full documentation concatenation (scripts/generate-full-docs.js) and sitemap generation (scripts/generate-sitemap-xml.js)

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to pages/validators/setup-guide.mdx : Setup Guide Updates (pages/validators/setup-guide.mdx): Update version references in download examples and version lists, update configuration examples with new contract addresses when applicable, enhance command documentation when new features are added to existing commands, update genesis block configuration in consensus section when network upgrades occur

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2025-12-03T17:07:37.200Z
Learnt from: dohernandez
Repo: genlayerlabs/genlayer-docs PR: 308
File: pages/validators/setup-guide.mdx:790-790
Timestamp: 2025-12-03T17:07:37.200Z
Learning: In pages/validators/setup-guide.mdx: When documenting docker-compose setup, users must create genvm-module-web-docker.yaml (separate from the tarball's genvm-module-web.yaml) to point the webdriver URL to the docker service name (http://webdriver-container:4444) instead of localhost, as the tarball version is configured for binary execution with localhost.

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/**/* : Scripts for build-time generation are located in the scripts/ directory

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2025-07-24T07:56:58.272Z
Learnt from: CR
Repo: genlayerlabs/genlayer-docs PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-07-24T07:56:58.272Z
Learning: Applies to scripts/generate-sitemap-xml.js : Build process includes automatic generation of sitemap (scripts/generate-sitemap-xml.js)

Applied to files:

  • .github/workflows/README.md
📚 Learning: 2025-07-14T09:14:00.225Z
Learnt from: dohernandez
Repo: genlayerlabs/genlayer-docs PR: 245
File: .github/workflows/sync-docs-from-node.yml:69-72
Timestamp: 2025-07-14T09:14:00.225Z
Learning: The correct parameter name for enabling cone mode in sparse checkout for actions/checkoutv4 is `sparse-checkout-cone-mode` (not `sparse-checkout-cone`). This parameter should be set to `true` to enable cone mode for directory-based sparse checkout optimization.

Applied to files:

  • .github/workflows/sync-docs-from-node.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Playwright E2E
  • GitHub Check: Redirect rules - genlayer-docs
  • GitHub Check: Header rules - genlayer-docs
  • GitHub Check: Pages changed - genlayer-docs
🔇 Additional comments (7)
.github/scripts/sanitize-docker-compose.sh (1)

1-29: Script structure and error handling are sound.

The use of set -e, input validation, and clear error messages make this a robust utility. The yq-based service/volumes removal is the correct approach for YAML manipulation.

.github/actions/sync-files/action.yml (1)

65-88: Docker-compose preparation and cleanup steps are well-structured.

The new docker-compose flow mirrors the config flow with proper temporary directory handling, yq installation conditional (shared with config), and cleanup using always() condition. Variable propagation (DOCKER_COMPOSE_SOURCE) is correctly handled for use in the sync step.

Also applies to: 119-125

.github/workflows/README.md (1)

15-21: Workflow documentation properly reflects docker-compose integration.

The README updates are comprehensive and accurate. The file structure examples, sanitization documentation, and npm script references all align with the workflow implementation. The "6 sync types" count, sparse-checkout configuration, and sanitization details are properly documented.

Also applies to: 103-119, 175-187, 240-240

.github/workflows/sync-docs-from-node.yml (4)

95-95: Docker-compose matrix addition and sparse-checkout configuration are correct.

The workflow properly adds docker_compose to the sync matrix, installs yq conditionally for config/docker_compose types, and includes release/docker-compose.yaml in sparse-checkout with cone-mode enabled. This follows the established patterns in the workflow.

Also applies to: 103-107, 118-119


139-143: Docker-compose sync parameters are properly configured.

The new case block correctly sets title, source/target paths, and filter pattern, mirroring the structure of other sync types. The absence of sanitize_script parameter is correct since sanitization is now handled within the action for this type.


1-548: Overall workflow structure and integration are sound.

The docker-compose sync type is consistently integrated across the workflow matrix, sparse-checkout configuration, parameter setting, documentation generation, PR creation, and summary reporting. The workflow maintains the selective directory sync approach that avoids unintended changes, aligning with established preferences.


409-409: PR body and summary generation properly integrated with docker-compose type.

The npm script node-update-docker-compose is correctly defined in package.json and the supporting script scripts/update-docker-compose-in-setup-guide.js exists. The addition to the documented script list in the PR body and the summary section with docker_compose and emoji (🐳) maintains consistency with other sync types.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should also copy release/.env.example so that the env vars referenced here make sense to the users

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I plan to do it in another PR

Copy link
Contributor

Choose a reason for hiding this comment

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

why delete the alloy configuration? I understand that we want telemetry from all users, I wouldn't remove it

Copy link
Member Author

Choose a reason for hiding this comment

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

Because it is not shown in the validator guide, here we only store what is shown there. The day we start showing it, we add it, or we remove the removal

@dohernandez dohernandez merged commit 1895087 into main Dec 9, 2025
2 of 6 checks passed
@dohernandez dohernandez deleted the chore/nod-561-update-docs-github-workflow branch December 9, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants