Skip to content

Formatting with prettier #3481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 4, 2025
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ jobs:
python-version: "3.12"
- name: Install tools
run: |
npm install --global prettier
pipx install cfengine black
- name: Run formatting command to (hopefully not) make changes
run: |
cfengine dev docs-format
# TODO: We can integrate these commands into cfengine dev docs-format
# https://northerntech.atlassian.net/browse/CFE-4572
# TODO: There are (small) diffs between cfbs pretty and prettier
# https://northerntech.atlassian.net/browse/CFE-4571
find . -name '*.markdown' -type f | parallel -j16 prettier -w {}
black .
cfengine dev docs-format
- name: Check output.log file for warnings
run: |
! grep WARNING output.log
Expand Down
1 change: 0 additions & 1 deletion cheatsheet.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,6 @@ site.CFE_manuals_version {{ site.CFE_manuals_version }}
### Indention with included markdown

1. Verify that the selected hosts are upgrading successfully.

- Mission Portal [Inventory reporting interface][Reporting UI#inventory management]

- [Inventory API][Inventory API]
Expand Down
1 change: 1 addition & 0 deletions content/_index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sorting: 1
categories: ["index"]
alias: index.html
---

<div class="home">
<div class="home-top">
<h1>Welcome to the CFEngine Documentation</h1>
Expand Down
2 changes: 1 addition & 1 deletion content/api/_index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sorting: 50
---

The CFEngine Enterprise API allows HTTP clients to interact with the
CFEngine Enterprise *Hub*. Typically this is also the policy server.
CFEngine Enterprise _Hub_. Typically this is also the policy server.

![Enterprise API Overview](enterprise-api-architecture-overview.png)

Expand Down
14 changes: 7 additions & 7 deletions content/api/enterprise-api-examples/_index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ title: Enterprise API examples
sorting: 6
---

* [Check installation status][Checking status]
* [Manage users, roles][Managing users and roles]
* [Managing settings][Managing settings]
* [Browse host information][Browsing host information]
* [Issue flexible SQL queries][SQL query examples] against data collected from hosts by the CFEngine Server
* [Schedule reports][SQL query examples#Subscribed query example: Creating a subscribed query] for email and later download
* [Tracking changes performed by CFEngine][Tracking changes]
- [Check installation status][Checking status]
- [Manage users, roles][Managing users and roles]
- [Managing settings][Managing settings]
- [Browse host information][Browsing host information]
- [Issue flexible SQL queries][SQL query examples] against data collected from hosts by the CFEngine Server
- [Schedule reports][SQL query examples#Subscribed query example: Creating a subscribed query] for email and later download
- [Tracking changes performed by CFEngine][Tracking changes]

**See also:** [Enterprise API reference][Enterprise API reference]
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ gathered from `cf-monitord`) is not part of the SQL reports data model.

## Example: Looking up hosts by hostname

Contexts, also known as classes, are powerful. You can use them to
Contexts, also known as classes, are powerful. You can use them to
categorize hosts according to a rich set of tags. For example, each
host is automatically tagged with a canonicalized version of its
hostname and IP-address. So we could lookup the host with hostname
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Changes REST API allows to track the changes made by cf-agent in the infrastruct

This examples shows how to count changes performed by cf-agent within last 24h hours.

Example is searching for changes that are performed by *linux* machines within *generate_repairs* bundle.
Example is searching for changes that are performed by _linux_ machines within _generate_repairs_ bundle.

**Request**

Expand All @@ -28,9 +28,9 @@ curl --user admin:admin 'https://test.cfengine.com/api/v2/changes/policy/count?i

## Example: Show vacuum command executions

Show all *vacuumdb* executions within last 24 hours executed on hosts reporting the `policy_server` or `test_cfengine_com` class.
Show all _vacuumdb_ executions within last 24 hours executed on hosts reporting the `policy_server` or `test_cfengine_com` class.

Example is searching for changes that are performed by *policy_server* machines that execute *commands* promise with command */var/cfengine/bin/vacuumdb%* - there is `%` sign at the end which is a wildcard as `vacuumdb` is executed with different options across policy.
Example is searching for changes that are performed by _policy_server_ machines that execute _commands_ promise with command `/var/cfengine/bin/vacuumdb%` - there is `%` sign at the end which is a wildcard as `vacuumdb` is executed with different options across policy.

**Request**

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: default
title: Checking status
title: Checking status
sorting: 20
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: default
title: Managing settings
title: Managing settings
sorting: 30
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: default
title: Managing users and roles
title: Managing users and roles
sorting: 40
---

Expand Down
2 changes: 1 addition & 1 deletion content/api/enterprise-api-examples/sql-queries.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: default
title: SQL query examples
title: SQL query examples
---

### Synchronous Example: Listing hostname and IP for Ubuntu hosts
Expand Down
8 changes: 4 additions & 4 deletions content/api/enterprise-api-ref/_index.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: default
title: Enterprise API reference
title: Enterprise API reference
sorting: 70
---

Expand Down Expand Up @@ -77,15 +77,15 @@ Enterprise API responses are always of the following format, consisting of a

If the response is not `200 OK`, the appropriate HTTP error code returned along with a (possibly non-JSON) payload.

All timestamps are reported in *Unix Time*, i.e. seconds since 1970.
All timestamps are reported in _Unix Time_, i.e. seconds since 1970.

## Authentication

The API supports both internal and external authentication. The internal users
table will always be consulted first, followed by an external source specified
in the settings. External sources are *OpenLDAP* or *Active Directory* servers
in the settings. External sources are _OpenLDAP_ or _Active Directory_ servers
configurable through [/api/settings][Status and settings REST API#Update settings].

## Authorization

Some resources require that the request user is a member of the *admin* role. Roles are managed with [/api/role][Users and access-control REST API#List RBAC roles]. Role Based Access Control (RBAC) is configurable through the settings. Users typically have permission to access their own resources, e.g. their own scheduled reports.
Some resources require that the request user is a member of the _admin_ role. Roles are managed with [/api/role][Users and access-control REST API#List RBAC roles]. Role Based Access Control (RBAC) is configurable through the settings. Users typically have permission to access their own resources, e.g. their own scheduled reports.
6 changes: 3 additions & 3 deletions content/api/enterprise-api-ref/actions-api.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ You can trigger a delta report collection in order to have fresh host data.

**Parameters:**

* **hostkey** *(string)*
Unique host identifier
- **hostkey** _(string)_
Unique host identifier

**Example request (curl):**

Expand Down Expand Up @@ -44,7 +44,7 @@ You can trigger an agent run for an individual host.

**Parameters:**

* **hostkey** *(string)*
- **hostkey** _(string)_
Unique host identifier

**Example request (curl):**
Expand Down
48 changes: 24 additions & 24 deletions content/api/enterprise-api-ref/audit-logs-api.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@ such as settings, host data, users, roles, Build projects, etc.

**Parameters:**

* **actor** *(string)*
- **actor** _(string)_
Filter by user who performed the action.
* **object_type** *(string)*
- **object_type** _(string)_
Filter by object type (see [Allowed object types][Audit log API#Allowed object types]).
* **action** *(string)*
- **action** _(string)_
Filter by action type (see [Allowed actions][Audit log API#Allowed actions]).
* **object_name** *(integer)*
- **object_name** _(integer)_
Filter by object name.
* **created_after** *(integer)*
- **created_after** _(integer)_
Unix timestamp to filter logs after this time.
* **created_before** *(integer)*
- **created_before** _(integer)_
Unix timestamp to filter logs before this time.
* **page** *(integer)*
- **page** _(integer)_
Page number for pagination (default: 1).
* **offset** *(integer)*
Number of results to skip for the processed query.
* **sort_column** *(string)*
Column to sort by. Allowed values:
* time
* actor
* action
* object_id
* object_name
* object_type
* **sort_direction** *(string, default: "DESC")*
- **offset** _(integer)_
Number of results to skip for the processed query.
- **sort_column** _(string)_
Column to sort by. Allowed values:
- time
- actor
- action
- object_id
- object_name
- object_type
- **sort_direction** _(string, default: "DESC")_
Sort direction. Allowed values:
* ASC (ascending)
* DESC (descending)
- ASC (ascending)
- DESC (descending)

**Example request (curl):**

Expand Down Expand Up @@ -114,7 +114,7 @@ HTTP 200 OK
**Responses:**

| HTTP response code | Description |
|------------------------------|--------------------------------------|
| ---------------------------- | ------------------------------------ |
| 200 OK | Audit logs returned |
| 422 Unprocessable entity | Validation error occurred |
| 401 Unauthorized | Authorization is missing |
Expand All @@ -124,7 +124,7 @@ HTTP 200 OK
### Allowed actions

| Action | Description |
|----------------------|---------------------------|
| -------------------- | ------------------------- |
| Created | Resource creation |
| Updated | Resource update |
| Deleted | Resource deletion |
Expand All @@ -142,7 +142,7 @@ HTTP 200 OK
### Allowed object types

| Object Type | Description |
|---------------------|----------------------------------------------|
| ------------------- | -------------------------------------------- |
| User | User account |
| Role | Role definition |
| Settings | System, Mail, VCS or Authentication settings |
Expand Down Expand Up @@ -185,7 +185,7 @@ Returns list of object names filtered by type.

**Parameters:**

* **object_type** *(string)*
- **object_type** _(string)_
Filter by object type (see [Allowed object types][Audit log API#Allowed object types]).

**Example request (curl):**
Expand Down
Loading