Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Autogenerated. Do not edit this by hand, use `copier update`.
---
_commit: 0.10.0
_src_path: gh:salt-extensions/salt-extension-copier
author: NodeRings
author_email: partners@noderings.com
coc_contact: partners@noderings.com
copyright_begin: 2026
deploy_docs: rolling
docs_url: https://noderings.github.io/saltext-noderings/
integration_name: NodeRings
license: apache
loaders:
- cloud
- module
- state
max_salt_version: '3008'
no_saltext_namespace: false
os_support:
- Linux
package_name: noderings
project_name: noderings
python_requires: '3.11'
relax_pylint: false
salt_version: '3006'
source_url: https://github.com/noderings/saltext-noderings
ssh_fixtures: false
summary: Salt Extension for ordering servers and managing DNS, firewalls and SSH keys
on the NodeRings cloud marketplace
test_containers: false
tracker_url: https://github.com/noderings/saltext-noderings/issues
url: https://github.com/noderings/saltext-noderings
44 changes: 44 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[run]
branch = True
cover_pylib = False
relative_files = True
parallel = True
concurrency = multiprocessing

omit =
.nox/*
setup.py

[report]
# Regexes for lines to exclude from consideration
exclude_also =
# Don't complain about missing debug-only code:
def __repr__

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if False:
if __name__ == .__main__.:
if TYPE_CHECKING:
@(abc\.)?abstractmethod

# Add markers which exclude statements in between.
# Requires coverage>=7.6.0.
no cover: start(?s:.)*?no cover: stop

omit =
.nox/*
setup.py

ignore_errors = True

[paths]
source =
saltext/noderings
src/saltext/noderings
testsuite =
tests/
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Docs
about: Issue related to Salt Documentation
title: "[DOCS]"
labels: documentation, needs-triage
assignees: ''

---

**Description**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Suggested Fix**
What did you expect to see in the documentation that is missing or needs updating?

**Type of documentation**
This could be module documentation or a guide.

**Location or format of documentation**
Insert page URL if applicable.

**Additional context**
Add any other context or screenshots here.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/tech-debt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Tech Debt
about: Issue is related to tech debt. This includes compatibility changes for newer versions of software and OSes that salt interacts with.
title: "[TECH DEBT]"
labels: tech-debt
assignees: ''

---

### Description of the tech debt to be addressed, include links and screenshots

### Versions Report
(Provided by running `salt --versions-report`. Please also mention any differences in master/minion versions.)
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Commit messages use Conventional Commits so release-please can sort them.
# Both groups only touch CI and development tools, so they stay out of the
# changelog ("ci" and "build" are hidden sections).
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Etc/UTC"
commit-message:
prefix: "ci"
groups:
"github-actions":
patterns:
Expand All @@ -12,6 +20,11 @@ updates:
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
timezone: "Etc/UTC"
commit-message:
prefix: "build"
groups:
"pip":
patterns:
Expand Down
135 changes: 135 additions & 0 deletions .github/self-hosted-runner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Running CI on a NodeRings self-hosted runner

CI runs on GitHub-hosted runners by default. It moves to our own runner when
both of these are true:

1. A runner with the labels `self-hosted` and `noderings` is online.
2. The repository variable `NODERINGS_RUNNER` is `true`.

Clear the variable (or set it to anything else) to go back to GitHub-hosted
runners at once, for example while the runner is down.

These always stay on GitHub-hosted runners, whatever the variable says:

- pull requests from forks (their code is untrusted)
- the `CI result` summary job
- building and publishing releases (`release.yml`)
- the GitHub Pages deploy job

## Recommended setup: one dedicated NodeRings VM, repository-level runner

Use a small Ubuntu 24.04 (x64) virtual machine ordered on NodeRings, used for
nothing else, with the GitHub Actions runner installed as a service.

Why this option:

- **A dedicated VM, not the production Kubernetes cluster.** CI runs code from
pull requests. Keep it away from production workloads, cluster credentials
and Argo CD. actions-runner-controller on the prod cluster would put CI
pods next to production.
- **The GitHub Actions runner, not Woodpecker or Forgejo.** The code, pull
requests and branch protection live on GitHub. The native runner reports
ordinary check runs, so branch protection, approvals and logs work
unchanged. Woodpecker or a Forgejo runner would need a separate CI server,
webhooks and mirroring for the same result.
- **Repository-level, not organization-level.** The noderings organization
is on the Free plan, which only has the Default runner group. An
organization runner there would serve every public repository in the
organization. A repository runner only takes jobs from this repository.
Register one per repository (one VM can host several runner services, each
in its own directory and user), or move to an organization runner group
limited to selected repositories once the organization is on a paid plan.

### 1. Lock down fork pull requests first

GitHub warns that self-hosted runners on public repositories can run code
from anyone who can open a pull request. A fork can edit the workflow files in
its own pull request, so the `runs-on` guard in our workflows is not enough by
itself.

- Repository → Settings → Actions → General → *Approval for running fork pull
request workflows from contributors* → **Require approval for all external
contributors**. (This repository already has this setting.)
- Before approving a fork run, read every change under `.github/`. Never
approve a run that changes `runs-on` or adds `self-hosted`.
- Never use `pull_request_target` together with a checkout of the pull
request's code.

### 2. Prepare the VM

As root on the new VM:

```bash
apt-get update
apt-get install -y --no-install-recommends \
git curl ca-certificates jq make build-essential \
libenchant-2-2 python3-dev python3-venv
# An unprivileged user for the runner, without sudo.
useradd --create-home --shell /bin/bash runner
# Tool cache for actions/setup-python.
install -d -o runner -g runner /opt/hostedtoolcache
```

Keep the VM patched (`unattended-upgrades`), open no inbound ports (the runner
only makes outbound HTTPS connections to GitHub), and do not store other
credentials on it.

### 3. Register the runner

1. Open <https://github.com/noderings/saltext-noderings/settings/actions/runners/new>
(Settings → Actions → Runners → **New self-hosted runner**), pick
**Linux** and **x64**. The page shows a registration token that is valid
for one hour. Use it only in the VM's shell. Do not paste it anywhere else.
2. As the `runner` user on the VM:

```bash
mkdir -p ~/actions-runner && cd ~/actions-runner
curl -fsSLO https://github.com/actions/runner/releases/download/v2.338.2/actions-runner-linux-x64-2.338.2.tar.gz
echo "baebf204307bac6193480852732f0aba2ae97b6c5597c244f4d5558390147c40 actions-runner-linux-x64-2.338.2.tar.gz" | sha256sum -c
tar xzf actions-runner-linux-x64-2.338.2.tar.gz
echo "AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache" >> .env
./config.sh --unattended \
--url https://github.com/noderings/saltext-noderings \
--token <TOKEN FROM THE PAGE> \
--name noderings-ci-1 \
--labels noderings \
--work _work
```

`self-hosted`, `Linux` and `X64` are added automatically. `noderings` is
the label the workflows ask for.
3. Back as root, install and start the service:

```bash
cd /home/runner/actions-runner
./svc.sh install runner
./svc.sh start
```

4. The runner should now show as **Idle** on
<https://github.com/noderings/saltext-noderings/settings/actions/runners>.

### 4. Switch CI over

Repository → Settings → Secrets and variables → Actions → **Variables** →
New repository variable: `NODERINGS_RUNNER` = `true`.
Then re-run CI on `main` (Actions → CI → Run workflow) and check that the jobs
show the runner name `noderings-ci-1`.

To switch back, delete the variable or set it to `false`.

### Optional: live API tests

Live tests run only when the repository secret `NODERINGS_TOKEN` exists. It
should be a service account token for a separate test organization with a
small credit balance. Fork pull requests never get secrets. Tests that order
billed servers only run from a manual CI run with *billed* ticked.

### Later: ephemeral runners

A persistent runner keeps its work directory between jobs. Our workflows clean
up after themselves and only trusted code reaches the runner, so this is
acceptable to start with. To give every job a fresh machine, register with
`--ephemeral`, then re-register after each job. This needs a GitHub App with
the *Administration: write* repository permission so the VM can request
registration tokens itself.
Loading
Loading