Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3f2bf98
stale.yml: Removed trailing whitespace and formatted with Prettier
olehermanse Jun 1, 2026
fc743f5
cfengine format ./tests/stress/
olehermanse Jun 24, 2026
90adff3
cfengine format ./contrib/
olehermanse Jun 24, 2026
5b250b0
cfengine format ./tests/acceptance/selftest/
olehermanse Jun 24, 2026
e59f8e5
cfengine format ./tests/unit/
olehermanse Jun 24, 2026
0a0d326
cfengine format ./libpromises/failsafe.cf
olehermanse Jun 24, 2026
311bb6a
cfengine format ./tests/acceptance/19_security/
olehermanse Jun 24, 2026
dd41c7e
cfengine format ./tests/acceptance/24_cmd_line_arguments/
olehermanse Jun 24, 2026
27994d7
tests/unit/policy_test.c: Manual edits for new line numbers
olehermanse Jun 24, 2026
8d01272
cfengine format ./tests/acceptance/*.sub.cf
olehermanse Jul 3, 2026
1874c29
cfengine format ./tests/acceptance/31_tickets/
olehermanse Jun 25, 2026
92f27da
cfengine format ./tests/acceptance/30_custom_promise_types/
olehermanse Jun 25, 2026
c865165
cfengine format ./tests/acceptance/29_simulate_mode/
olehermanse Jun 25, 2026
3afd129
cfengine format ./tests/acceptance/25_cf-execd/
olehermanse Jun 25, 2026
4b4da76
cfengine format ./tests/acceptance/21_methods/
olehermanse Jun 25, 2026
dffba04
Updated expected output in test
olehermanse Jun 25, 2026
8308afc
Formatting changes based on @larsewi's code review
olehermanse Jun 26, 2026
75a644f
cfengine format ./tests/acceptance/
olehermanse Jul 1, 2026
ae39515
Adjusted test expectation after formatting
olehermanse Jun 29, 2026
5122c83
cfengine format ./examples/
olehermanse Jul 1, 2026
ab229f3
Adjusted test expectation after formatting
olehermanse Jun 29, 2026
aaa7e13
Manual edits after code review
olehermanse Jun 30, 2026
1bfd864
Fixed str -> string in various disabled staging tests
olehermanse Jul 2, 2026
d2ab29e
Fixed errors in staging tests found during linting
olehermanse Jul 2, 2026
96e5173
GH Actions: Check linting and formatting
olehermanse Jul 2, 2026
7c8e5a0
cfengine format
olehermanse Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .github/workflows/cfengine_cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint policy and check formatting with CFEngine CLI
on:
workflow_call:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Checkout masterfiles
uses: actions/checkout@v7
- name: Install CFEngine CLI
run: pipx install cfengine
- name: Run cfengine lint
run: |
cfengine lint --strict no ./
- name: Run cfengine format --check
run: |
cfengine format --check
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ on:
branches: [ master, 3.27.x, 3.24.x ]

jobs:
cfengine_cli:
uses: ./.github/workflows/cfengine_cli.yml
unit_tests:
needs: cfengine_cli
uses: ./.github/workflows/unit_tests.yml
shellcheck_tests:
uses: ./.github/workflows/shellcheck.yml
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@ name: Label and close stale pull requests

on:
schedule:
- cron: '31 19 * * *'
- cron: "31 19 * * *"
workflow_dispatch:

jobs:
stale:

runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'Marking this PR as stale due to inactivity; it will be closed in 7 days.'
stale-pr-label: 'stale'
days-before-stale: 30
days-before-close: 7
close-pr-message: "Closing PR due to inactivity. Feel free to open a new PR if necessary."

- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: "Marking this PR as stale due to inactivity; it will be closed in 7 days."
stale-pr-label: "stale"
days-before-stale: 30
days-before-close: 7
close-pr-message: "Closing PR due to inactivity. Feel free to open a new PR if necessary."
24 changes: 13 additions & 11 deletions contrib/cf-doc/example_cf-doc.cf
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/var/cfengine/bin/cf-agent -f-
bundle agent example_cf_doc
{
meta:
"inventory" string => "Example: This bundle does Inventory";
"config" string => "Example: This bundle configures /tmp/example.txt";
meta:
"inventory" string => "Example: This bundle does Inventory";
"config" string => "Example: This bundle configures /tmp/example.txt";

vars:
"h"
string => "$(sys.fqhost)",
meta => { "docinv=Fully Qualified Hostname according to CFEngine" };
vars:
"h"
string => "$(sys.fqhost)",
meta => { "docinv=Fully Qualified Hostname according to CFEngine" };

files:
"/tmp/example.txt"
create => 'true',
meta => { "docconfig=Make sure the important file /tmp/example.txt exists" };
files:
"/tmp/example.txt"
create => 'true',
meta => {
"docconfig=Make sure the important file /tmp/example.txt exists"
};
}
21 changes: 12 additions & 9 deletions contrib/cf-profile/tests/lib/namespace/ns1.cf
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
body file control {
namespace => "ns1";
inputs => { "$(ns1:d.dir)/ns2.cf" };
body file control
{
namespace => "ns1";
inputs => { "$(ns1:d.dir)/ns2.cf" };
}

bundle common d {
vars:
"dir" string => "$(this.promise_dirname)";
bundle common d
{
vars:
"dir" string => "$(this.promise_dirname)";
}

bundle agent ns1 {
methods:
"c" usebundle => ns2:ns2;
bundle agent ns1
{
methods:
"c" usebundle => ns2:ns2;
}
13 changes: 8 additions & 5 deletions contrib/cf-profile/tests/lib/namespace/ns2.cf
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
body file control {
namespace => "ns2";
body file control
{
namespace => "ns2";
}
bundle agent ns2 {
commands:
"/bin/sleep 2";

bundle agent ns2
{
commands:
"/bin/sleep 2";
}
30 changes: 17 additions & 13 deletions contrib/cf-profile/tests/namespace.cf
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
body common control {
bundlesequence => { "main" };
inputs => { "$(d.dir)/lib/namespace/ns1.cf" };
body common control
{
bundlesequence => { "main" };
inputs => { "$(d.dir)/lib/namespace/ns1.cf" };
}

bundle common d {
vars:
"dir" string => "$(this.promise_dirname)";
bundle common d
{
vars:
"dir" string => "$(this.promise_dirname)";
}

bundle agent main {
methods:
"a" usebundle => ns1:ns1;
"b" usebundle => ns1;
bundle agent main
{
methods:
"a" usebundle => ns1:ns1;
"b" usebundle => ns1;
}

bundle agent ns1 {
commands:
"/bin/sleep 3";
bundle agent ns1
{
commands:
"/bin/sleep 3";
}
54 changes: 31 additions & 23 deletions contrib/cf-profile/tests/promises.cf
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
body common control {
bundlesequence => { "main1", "main2" };
body common control
{
bundlesequence => { "main1", "main2" };
}

bundle agent main1 {
bundle agent main1
{
commands:
"/bin/sleep 1";

commands:
"/bin/sleep 1";

methods:
"a" usebundle => a("arg1 somevalue", "arg2 somevalue", "arg3 somevalue");
"b" usebundle => b("arg4 somevalue", "arg5 somevalue", "arg6 somevalue");
methods:
"a" usebundle => a("arg1 somevalue", "arg2 somevalue", "arg3 somevalue");
"b" usebundle => b("arg4 somevalue", "arg5 somevalue", "arg6 somevalue");
}

bundle agent a (a1, a2, a3) {
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";
bundle agent a(a1, a2, a3)
{
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";
}
bundle agent b (a1, a2, a3) {
methods:
"c" usebundle => c("arg7 somevalue", "arg8 somevalue", "arg9 somevalue");
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";

bundle agent b(a1, a2, a3)
{
methods:
"c" usebundle => c("arg7 somevalue", "arg8 somevalue", "arg9 somevalue");

commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";
}
bundle agent c (a1, a2, a3) {
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";

bundle agent c(a1, a2, a3)
{
commands:
"/bin/echo $(this.bundle):$(a1),$(a2),$(a3)";
}

bundle agent main2 {
commands:
"/bin/sleep 2";
bundle agent main2
{
commands:
"/bin/sleep 2";
}
Loading
Loading