Skip to content

feat(decdn_node): add manual local-binary install method - #18

Merged
thiras merged 2 commits into
mainfrom
feat/decdn-node-manual-binary
Jul 11, 2026
Merged

thiras merged 2 commits into
mainfrom
feat/decdn-node-manual-binary

Conversation

@thiras

@thiras thiras commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

What & why

The decdn_node role installed the daemon + CLI only from pinned GitHub Release tarballs — but no release exists yet, so there was no way to deploy the node without first cutting one. This adds a second install method, manual, that copies locally-built binaries from the Ansible control machine. Default stays release, so existing inventory (host_vars/decdn-node-1, decdn_node_version: "0.1.0") is unaffected.

Changes

  • defaults/main.yml — new decdn_node_install_method (release | manual, default release) + decdn_node_manual_bin_src / decdn_cli_manual_bin_src.
  • tasks/main.yml — validate the method (unconditional, first); gate the version assert to release; add a manual-mode assert requiring both control-machine paths. The gates are mutually exclusive but jointly exhaustive, so no reachable path skips config validation.
  • tasks/install.yml — wrap the existing release flow in a when: release block; add a parallel manual block that copys both binaries (checksum-idempotent, root:root 0755, notifies restart on change only); make the --version backstop mode-agnostic (rc != 0 always fails; version-substring match only when a version is set).
  • README.md / meta/main.yml — document both methods, manual prerequisites, the no-version-stamp day-2 behavior, and release↔manual mode-switch hygiene.

Templates and the systemd unit need no change — both modes land the daemon at {{ decdn_bin }}, which ExecStart already references.

Verification

  • yamllint, ansible-lint (production profile), and ansible-playbook --syntax-check — clean.
  • Drove the real branching logic against localhost with stub binaries: install-method gate rejects bad values, empty-src gate fires, manual copy places both binaries and is idempotent on re-run (changed=0), and the version backstop passes on a working binary with an empty version.
  • Reviewed via the pr-review-toolkit agents (code / comments / silent-failure) — no Critical or Important findings; low-severity doc suggestions applied.

Manual-mode end-to-end on a real host (make check/deploy against a target) is the one gate not runnable from CI — exercise it on a test node.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for installing decdn-node using either pinned release archives or locally supplied binaries.
    • Added configuration options for selecting the installation method and specifying manual binary sources.
    • Manual installations now restart services and support upgrades from locally rebuilt binaries.
  • Bug Fixes

    • Added validation to reject unsupported installation settings and incomplete manual configurations.
    • Improved version verification and installation-method switching behavior.
  • Documentation

    • Updated installation, upgrade, prerequisites, and configuration guidance for both deployment methods.

Add a `decdn_node_install_method` toggle (release | manual, default
release) so operators can deploy locally-built binaries when no GitHub
Release exists yet. In manual mode the role copies the decdn-node daemon
and decdn CLI verbatim from control-machine paths
(decdn_node_manual_bin_src / decdn_cli_manual_bin_src) into place, with
copy's checksum idempotency replacing the release version stamp.

The version assert is now gated to release mode, a manual-mode assert
requires both source paths, and the --version backstop is mode-agnostic
(rc != 0 always fails; the version-substring match applies only when a
version is set). Templates and the systemd unit are unchanged — both
modes land the daemon at decdn_bin.

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:00
@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: c8b565c2-81ec-4c8b-8eef-df04d4c1fd83

📥 Commits

Reviewing files that changed from the base of the PR and between dee47dc and f46e8f7.

📒 Files selected for processing (5)
  • ansible/roles/decdn_node/README.md
  • ansible/roles/decdn_node/defaults/main.yml
  • ansible/roles/decdn_node/meta/main.yml
  • ansible/roles/decdn_node/tasks/install.yml
  • ansible/roles/decdn_node/tasks/main.yml

📝 Walkthrough

Walkthrough

The Ansible role now supports release and manual binary installation methods, validates method-specific configuration, handles deployment state, and conditionally verifies the installed daemon version. Documentation and role metadata describe the new options and upgrade behavior.

Changes

decdn-node installation methods

Layer / File(s) Summary
Install method configuration and validation
ansible/roles/decdn_node/defaults/main.yml, ansible/roles/decdn_node/tasks/main.yml, ansible/roles/decdn_node/README.md
Adds release/manual configuration, manual binary source variables, and fail-fast assertions for method-specific requirements.
Release and manual installation paths
ansible/roles/decdn_node/tasks/install.yml
Keeps pinned release downloads and version stamps for release, adds control-machine binary copying for manual, restarts the service, and clears stale release stamps.
Version verification and operational documentation
ansible/roles/decdn_node/tasks/install.yml, ansible/roles/decdn_node/README.md, ansible/roles/decdn_node/meta/main.yml
Adds daemon execution validation with optional version matching and documents installation, upgrade, switching, and role metadata changes.

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

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant AnsibleRole
  participant GitHubReleases
  participant ControlMachine
  participant TargetHost
  participant DecdnService

  Operator->>AnsibleRole: configure install method
  alt release
    AnsibleRole->>GitHubReleases: fetch pinned tarballs
    AnsibleRole->>TargetHost: install binaries and version stamp
  else manual
    AnsibleRole->>ControlMachine: read local binaries
    AnsibleRole->>TargetHost: copy binaries and clear release stamp
    TargetHost->>DecdnService: restart service
  end
  AnsibleRole->>TargetHost: run decdn-node --version
  TargetHost-->>AnsibleRole: return status and version output
Loading

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

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

Adds a second installation path to the ansible/roles/decdn_node role so the daemon/CLI can be deployed before any GitHub Releases exist, while preserving the existing default release-based behavior.

Changes:

  • Introduces decdn_node_install_method (release | manual) plus manual source-path defaults and validation.
  • Splits install logic into mutually exclusive release vs manual blocks; manual mode copies controller-local binaries with checksum idempotency.
  • Updates docs/metadata to describe the two install methods and day-2 implications (upgrades + switching hygiene).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ansible/roles/decdn_node/tasks/main.yml Adds install-method validation and conditional asserts for release vs manual requirements.
ansible/roles/decdn_node/tasks/install.yml Implements manual binary copy path and gates the existing release-tarball workflow by install method.
ansible/roles/decdn_node/defaults/main.yml Adds new defaults for install method and manual binary source paths.
ansible/roles/decdn_node/README.md Documents install methods, prerequisites, and upgrade/switching behavior.
ansible/roles/decdn_node/meta/main.yml Updates role description to reflect the new manual install option.

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

Comment thread ansible/roles/decdn_node/tasks/main.yml

@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 a new manual installation method for the decdn_node Ansible role, allowing operators to copy locally-built binaries from the control machine as an alternative to downloading official GitHub releases. The changes include conditional tasks in install.yml, updated configuration assertions in main.yml, and updated documentation. The review feedback suggests a robust improvement: automatically deleting the installed-version stamp file during manual installations to prevent state conflicts when switching back to the release method, along with a corresponding documentation update.

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/roles/decdn_node/tasks/install.yml
Comment thread ansible/roles/decdn_node/README.md Outdated
…rding

Address PR #18 review:
- Manual mode now removes /usr/local/lib/decdn/installed-version so a
  release -> manual -> release round-trip with an unchanged version always
  re-fetches the official tarball (was a documented footgun; now automatic).
  README "Switching methods" simplified accordingly.
- The manual-mode assert message referenced `install_method` instead of the
  real variable `decdn_node_install_method`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@thiras
thiras merged commit a6e19be into main Jul 11, 2026
8 checks passed
@thiras
thiras deleted the feat/decdn-node-manual-binary branch July 11, 2026 16:09
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.

2 participants