Skip to content

chore: prepare repo for public release as the official deCDN Ansible - #20

Merged
thiras merged 3 commits into
mainfrom
chore/public-repo-cleanup
Jul 11, 2026
Merged

thiras merged 3 commits into
mainfrom
chore/public-repo-cleanup

Conversation

@thiras

@thiras thiras commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Prepares decdn/devops to be published as the official public Ansible for deploying a deCDN node. The internal anvil devnet was already removed (commit 5bbce04), so this focuses on the remaining public-readiness gaps: scrubbing private-workspace framing, genericizing references to the still-private sibling repos, and re-adding automated test coverage for the node role (the only molecule scenario had been deleted with anvil).

Changes

De-brand docs

  • Remove the /home/thiras/dev/decdn/ workspace path (the one hard personal leak) and "deCDN team's monorepo / workspace CLAUDE.md" framing across README.md, AGENTS.md, CONTRIBUTING.md, and the ansible/ READMEs.
  • Rewrite AGENTS.md to describe only the public Ansible project; drop the dead legacy services//etc/-mirror convention.
  • Soften "teammates" → "operators".

Genericize private cross-repo references

  • decdn/adr/… and decdn/contracts/deployments/<chainId>.json (both in the still-private decdn/decdn) become prose — "the deCDN ADRs / contract deployment" — with no dead links. Public Arbitrum Sepolia testnet contract addresses stay (public on-chain facts).

Document the binary-source dependency

  • Note that release installs need a publicly reachable v<version> release; decdn_node_release_base is overridable and manual install is the no-release escape hatch.

Re-add node test coverage

  • New ansible/molecule/default/ scenario: converges decdn_node in a privileged systemd container against a stub daemon (manual install → no private release needed), stages a placeholder keystore, and asserts the node user, valid TOML, a valid hardened unit, loopback-only metrics, 0600 env file, and a running service.
  • Re-add the molecule.yml workflow and make molecule targets; note in Testing/CI docs.

Misc

  • CI: reword the KICS SARIF comment to drop the "private repo" assumption.
  • .gitignore: ignore Python bytecode (molecule stub / local tooling).

Verification

Check Result
yamllint + ansible-lint (production profile) 0 failures
site.yml --syntax-check pass
make build + galaxy-importer success
molecule test (node scenario) exit 0 — converge + idempotence + verify
KICS IaC scan 0 HIGH/CRITICAL
actionlint (new workflow) pass

Note

The node binary is still fetched from github.com/decdn/decdn/releases (private) and ADRs live in the private decdn/decdn. Per the agreed approach the sourcing is kept and only the docs are genericized — external users can't fully deploy until that release/those assets are public (or they override decdn_node_release_base). The docs now state this.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added automated Molecule testing for Ansible changes, including containerized convergence, idempotence, and verification.
    • Added a make molecule command for running the scenario locally.
    • Added offline validation of rendered configuration, service setup, permissions, and metrics availability.
  • Documentation

    • Updated deployment, configuration, testing, contribution, and repository guidance.
    • Clarified release sources, mirror overrides, local builds, operator keys, and onboarding references.
  • Chores

    • Added Python bytecode files to ignored artifacts.
    • Updated CI guidance for surfacing security findings.

De-brand docs and re-add automated node test coverage so this repo can be
published as the official Ansible for deploying a deCDN node.

- Docs: drop the private-workspace framing (the /home/thiras path, "team's
  monorepo", "workspace CLAUDE.md") from README/AGENTS/CONTRIBUTING/ansible
  READMEs; point cross-refs at AGENTS.md and the dead legacy `services/`/
  `etc/`-mirror convention is removed.
- Genericize private sibling-repo references: `decdn/adr/` and
  `decdn/contracts/deployments/<chainId>.json` become prose ("the deCDN ADRs /
  contract deployment") with no dead links; public Arbitrum Sepolia testnet
  contract addresses stay.
- Document the binary-source dependency: release installs need a publicly
  reachable `v<version>` release; override `decdn_node_release_base` or use the
  `manual` install method otherwise.
- Add a `decdn_node` molecule scenario (converge/idempotence/verify in a
  privileged systemd container against a stub daemon), re-add the `molecule.yml`
  workflow and `make molecule` targets, and note it in the Testing/CI docs.
- CI: reword the KICS SARIF comment to drop the private-repo assumption.
- .gitignore: ignore Python bytecode (molecule stub / local tooling).

Verified: yamllint + ansible-lint (production), site.yml syntax-check,
make build + galaxy-importer, molecule test (exit 0), KICS (0 HIGH), actionlint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 11, 2026 16:45
@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@yigitdot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 36e038b7-ebc2-49a0-afb2-073996dfe2aa

📥 Commits

Reviewing files that changed from the base of the PR and between 01e2a28 and 668e4dc.

📒 Files selected for processing (6)
  • ansible/README.md
  • ansible/molecule/default/converge.yml
  • ansible/molecule/default/files/decdn-node-stub
  • ansible/molecule/default/molecule.yml
  • ansible/molecule/default/prepare.yml
  • ansible/molecule/default/verify.yml
📝 Walkthrough

Walkthrough

Changes

Molecule validation

Layer / File(s) Summary
Molecule scenario and assertions
ansible/molecule/default/*
Adds a Docker-backed systemd scenario that converges the decdn_node role with stub binaries and verifies rendered files, service state, TOML validity, and loopback metrics.
Local and CI execution wiring
.github/workflows/*, Makefile, ansible/Makefile, .gitignore
Adds local Molecule targets and a path-scoped GitHub Actions workflow with Python, Ansible, Galaxy, and Molecule setup.
Repository and testing guidance
AGENTS.md, CONTRIBUTING.md, README.md, ansible/README.md, ansible/roles/*/README.md, ansible/inventory/*, ansible/roles/decdn_node/tasks/main.yml
Updates repository, deployment, testing, operator-key, contract-source, and validation documentation and messages.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant Molecule
  participant Docker
  participant Ansible
  participant decdn_node
  GitHubActions->>Molecule: run molecule test for ansible/** changes
  Molecule->>Docker: create privileged systemd container
  Molecule->>Ansible: converge and verify scenario
  Ansible->>decdn_node: apply role with manual stub binaries
  decdn_node->>Docker: render configuration and start service
  Ansible->>decdn_node: validate files, service state, and loopback metrics
Loading
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/public-repo-cleanup

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces containerized testing for the decdn_node Ansible role using Molecule and Docker, adding a Python-based stub daemon and playbooks to verify host preparation, configuration rendering, and systemd unit hardening. It also updates documentation to reflect these testing capabilities and replaces references to CLAUDE.md with AGENTS.md. The review feedback highlights three potential playbook crashes in the verify.yml assertions where properties of potentially undefined variables are accessed; the reviewer recommends combining these checks using and to leverage Jinja's short-circuit evaluation and ensure custom failure messages are correctly displayed.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ansible/molecule/default/verify.yml Outdated
Comment thread ansible/molecule/default/verify.yml Outdated
Comment thread ansible/molecule/default/verify.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Prepares the decdn/devops repository for a public release as the official Ansible-based deployment project for running a deCDN node, primarily by de-internalizing documentation and restoring automated role verification via Molecule.

Changes:

  • Rewrites repository and Ansible documentation to remove private workspace framing and replace private cross-repo references with neutral prose.
  • Reintroduces automated test coverage for decdn_node via a new Molecule scenario (stub daemon + systemd container) and adds a dedicated GitHub Actions workflow to run it.
  • Adds make molecule targets and small repo hygiene updates (e.g., Python bytecode ignores, CI comment wording).

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Updates repo positioning for public release; documents CI gates including Molecule.
Makefile Adds a root molecule convenience target delegating to ansible/.
CONTRIBUTING.md Updates references to AGENTS.md and documents the Molecule workflow.
ansible/roles/decdn_node/tasks/main.yml Adjusts validation error messaging to remove private repo path references.
ansible/roles/decdn_node/README.md Documents decdn_node_release_base and clarifies public reachability requirements.
ansible/roles/baseline/README.md Updates wording from “team” to “operator” for public-facing docs.
ansible/README.md Updates onboarding docs and adds detailed explanation of Molecule-based verification.
ansible/molecule/default/verify.yml Adds Molecule verification assertions (user, TOML validity, unit validity, loopback metrics, permissions, service state).
ansible/molecule/default/prepare.yml Stages placeholder keystore/password files so the role’s keystore gate can pass in CI.
ansible/molecule/default/molecule.yml Defines the Docker/systemd-based Molecule scenario for decdn_node.
ansible/molecule/default/files/decdn-node-stub Adds a Python stub “node” binary for containerized verification without real releases/chain.
ansible/molecule/default/converge.yml Converges decdn_node in manual-install mode using the stub binary and placeholder chain inputs.
ansible/Makefile Adds an ansible/-local molecule target to run the scenario.
ansible/inventory/host_vars/decdn-node-1/main.yml Rewords contract-address provenance comments to avoid private repo paths while keeping on-chain facts.
AGENTS.md Rewrites agent guidance to be public-repo focused and adds Molecule guidance.
.gitignore Ignores Python bytecode artifacts (e.g., from the Molecule stub).
.github/workflows/molecule.yml Adds a new workflow to run molecule test on ansible/** changes.
.github/workflows/ci.yml Rewords KICS SARIF comment to remove “private repo” assumptions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ansible/molecule/default/molecule.yml
Comment thread .github/workflows/molecule.yml
Address bot review feedback on PR #20:

- verify.yml: combine each guard+deref pair into a single `and` expression
  (user/nologin, file exists+mode, service membership+state). Ansible templates
  each `that:` item independently — the separate guard lines did not protect the
  later derefs, so an absent user/file/service raised AnsibleUndefinedVariable and
  bypassed the fail_msg. One expression restores short-circuiting and the intended
  clean failure message. (Gemini Code Assist)
- molecule.yml: pin the geerlingguy/docker-debian12-ansible base image by digest
  instead of :latest, matching the repo's SHA/digest-pinning convention for
  reproducible CI. (Copilot)

Declined Copilot's PyPI-pinning suggestion: ci.yml installs its Python tooling
unpinned with --upgrade in every job; pinning only molecule.yml would be the lone
inconsistent workflow. Reproducibility of the systemd/docker layer is covered by
the pinned base image above.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copy link
Copy Markdown
Contributor

One CI issue to address: this workflow is intended to become a required check, but the workflow-level paths: ['ansible/**'] filter means GitHub can leave the required check pending for documentation-only or other non-Ansible PRs, blocking their merge. It also prevents changes to .github/workflows/molecule.yml itself from exercising Molecule.

Please make the workflow run for every PR and gate the expensive Molecule job using a lightweight changed-files job with a successful no-op path, or avoid making molecule a globally required check. The workflow file itself should also trigger the real Molecule job.

…kstop

Address the multi-agent PR review findings:

verify.yml
- Assert node.toml *content* (region, metrics_bind, chain_id, the three contract
  addresses), not just that it parses. The prior tomllib-load check passed on any
  valid TOML — a role regression rendering metrics_bind=0.0.0.0 or dropping an
  address would not be caught. Content is asserted via a staged script (no shell
  quoting hazards).
- Assert the keystore + password file are 0600. prepare.yml now stages them at
  0644, so the assertion attributes the lock-down to the role, not to prepare.
- Assert the hardened unit carries its load-bearing directives (NoNewPrivileges,
  ProtectSystem=strict, RestrictAddressFamilies, SystemCallFilter, User) —
  systemd-analyze only checks syntax.
- Reject all non-loopback wildcard forms on :9090 ([::], *), not just 0.0.0.0.

converge.yml
- Set decdn_node_version to match the stub's --version so the install-time
  version-match backstop is actually exercised instead of degrading to a bare
  liveness check.

files/decdn-node-stub
- Serve 200 only on /metrics (404 elsewhere) so readiness tests the real path.
- Only `run` serves; unknown invocations exit non-zero (fail loud). Guard the
  bind with a legible stderr error instead of a bare traceback.

molecule.yml / ansible/README.md
- Correct the baseline-skip rationale: this scenario connects over the Docker
  driver (docker exec, not SSH), so ssh_hardening would not "sever the
  connection". baseline is skipped because its host-level hardening (nftables
  default-deny, DevSec os/ssh hardening, fail2ban) isn't meaningful in a
  throwaway container.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thiras
thiras merged commit 9910ee4 into main Jul 11, 2026
8 checks passed
@thiras
thiras deleted the chore/public-repo-cleanup branch July 11, 2026 17:25
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.

4 participants