Skip to content

Commit 997c171

Browse files
committed
feat: Migrate configuration format from .mkp-builderrc to .mkp-builder.ini
- Introduced support for INI configuration files with a new structure. - Added multiline description support in configuration files. - Updated filtering to exclude __pycache__ directories from packages. - Renamed command line arguments and GitHub Action inputs for clarity. - Updated documentation to reflect changes in configuration format.
1 parent 3086835 commit 997c171

File tree

7 files changed

+122
-123
lines changed

7 files changed

+122
-123
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
!/*.md
66
!/.gitignore
77
!/.github
8-
!/.mkp-builderrc.example
8+
!/.mkp-builder.ini.example
99
!/.clinerules
1010
*~
1111
*.swp

.mkp-builder.ini.example

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Example configuration file for CheckMK MKP Builder
2+
# Copy this to .mkp-builder.ini in your plugin repository and customize
3+
4+
[package]
5+
# Package Information
6+
name = my_awesome_plugin
7+
title = My Awesome CheckMK Plugin
8+
author = Your Name <your.email@example.com>
9+
description = A comprehensive CheckMK plugin that monitors awesome things.
10+
This description can span multiple lines for better readability.
11+
Use proper indentation for continuation lines.
12+
13+
# CheckMK Compatibility
14+
version.min_required = 2.3.0p1
15+
version.packaged = 2.3.0p34
16+
version.usable_until =
17+
18+
# Optional settings
19+
download_url = https://github.com/yourusername/your-plugin-repo
20+
21+
# Build Options
22+
validate_python = true

.mkp-builderrc.example

Lines changed: 0 additions & 20 deletions
This file was deleted.

CHANGES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### New
11+
- Add support for INI configuration format with `.mkp-builder.ini` files
12+
- Add multiline description support in configuration files
13+
- Add `__pycache__` directory filtering to exclude Python cache files from packages
1114

1215
### Changed
16+
- **BREAKING**: Configuration file format changed from `.mkp-builderrc` (key=value) to `.mkp-builder.ini` (INI format with `[package]` section)
17+
- **BREAKING**: Command line arguments renamed for clarity:
18+
- `--cmk-min``--version-min-required`
19+
- `--cmk-packaged``--version-packaged`
20+
- **BREAKING**: GitHub Action inputs renamed:
21+
- `cmk-min-version``version-min-required`
22+
- `cmk-packaged-version``version-packaged`
23+
- Internal configuration keys now match info file structure (e.g., `version.min_required`, `version.packaged`)
24+
- Improved JSON formatting in `info.json` with proper indentation
25+
- Enhanced Python dict formatting in `info` file using `pprint` module with 80-character line width
1326

1427
### Fixed
28+
- Package files now properly exclude `__pycache__` directories and their contents
1529

1630
## 1.0.1 - 2025-08-06
1731
### New

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ jobs:
8181
title: 'My Awesome Plugin'
8282
author: 'John Doe <john@example.com>'
8383
description: 'A plugin that does amazing things'
84-
cmk-min-version: '2.3.0p1'
85-
cmk-packaged-version: '2.3.0p34'
84+
version-min-required: '2.3.0p1'
85+
version-packaged: '2.3.0p34'
8686
validate-python: 'true'
8787
verbose: 'true'
8888

@@ -102,8 +102,8 @@ jobs:
102102
| `title` | Package title | ❌ | From config file |
103103
| `author` | Author name and email | ❌ | From config file |
104104
| `description` | Package description | ❌ | From config file |
105-
| `cmk-min-version` | Minimum CheckMK version | ❌ | From config file |
106-
| `cmk-packaged-version` | CheckMK packaging version | ❌ | From config file |
105+
| `version-min-required` | Minimum CheckMK version | ❌ | From config file |
106+
| `version-packaged` | CheckMK packaging version | ❌ | From config file |
107107
| `download-url` | Download URL | ❌ | From config file |
108108
| `version-usable-until` | The last CheckMK version this plugin is compatible with | ❌ | From config file |
109109
| `output-dir` | Output directory | ❌ | `.` |
@@ -120,22 +120,26 @@ jobs:
120120

121121
## Configuration File
122122

123-
Create a `.mkp-builderrc` file in your repository root for default values:
123+
Create a `.mkp-builder.ini` file in your repository root for default values:
124124

125-
```bash
125+
```ini
126+
[package]
126127
# Package Information
127-
PACKAGE_NAME="my_plugin"
128-
PACKAGE_TITLE="My Awesome Plugin"
129-
PACKAGE_AUTHOR="John Doe <john@example.com>"
130-
PACKAGE_DESCRIPTION="A plugin that does amazing things"
128+
name = my_plugin
129+
title = My Awesome Plugin
130+
author = John Doe <john@example.com>
131+
description = A plugin that does amazing things.
132+
This description can span multiple lines
133+
and provides better formatting options.
131134
132135
# CheckMK Compatibility
133-
CMK_MIN_VERSION="2.3.0p1"
134-
CMK_PACKAGED_VERSION="2.3.0p34"
136+
version.min_required = 2.3.0p1
137+
version.packaged = 2.3.0p34
138+
version.usable_until = 3.0.0
135139
136140
# Optional
137-
DOWNLOAD_URL="https://github.com/user/repo"
138-
VALIDATE_PYTHON="yes"
141+
download_url = https://github.com/user/repo
142+
validate_python = true
139143
```
140144

141145
## Required Directory Structure
@@ -161,7 +165,7 @@ repository/
161165
│ │ └── your_plugin.py
162166
│ └── share/check_mk/agents/plugins/
163167
│ └── your_plugin
164-
├── .mkp-builderrc # Optional config file
168+
├── .mkp-builder.ini # Optional config file
165169
└── .github/workflows/
166170
└── build.yml
167171
```
@@ -295,11 +299,11 @@ The action automatically maps files from your local directory structure:
295299

296300
**"No MKP file found after build"**
297301
- Ensure your `local/` directory structure is correct
298-
- Check that your `.mkp-builderrc` file has valid syntax
302+
- Check that your `.mkp-builder.ini` file has valid syntax
299303
- Verify Python files pass validation
300304

301305
**"Package name could not be determined"**
302-
- Add `package-name` input or set `PACKAGE_NAME` in `.mkp-builderrc`
306+
- Add `package-name` input or set `name` in the `[package]` section of `.mkp-builder.ini`
303307
- Ensure your agent plugin files exist in the correct location
304308

305309
**"Python syntax error"**

action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ inputs:
1818
description:
1919
description: 'Package description (default: from config file)'
2020
required: false
21-
cmk-min-version:
21+
version-min-required:
2222
description: 'Minimum CheckMK version (default: from config file)'
2323
required: false
24-
cmk-packaged-version:
24+
version-packaged:
2525
description: 'CheckMK version used for packaging (default: from config file)'
2626
required: false
2727
download-url:
@@ -143,8 +143,8 @@ runs:
143143
[[ -n "${{ inputs.title }}" ]] && BUILD_ARGS+=("--title" "${{ inputs.title }}")
144144
[[ -n "${{ inputs.author }}" ]] && BUILD_ARGS+=("--author" "${{ inputs.author }}")
145145
[[ -n "${{ inputs.description }}" ]] && BUILD_ARGS+=("--description" "${{ inputs.description }}")
146-
[[ -n "${{ inputs.cmk-min-version }}" ]] && BUILD_ARGS+=("--cmk-min" "${{ inputs.cmk-min-version }}")
147-
[[ -n "${{ inputs.cmk-packaged-version }}" ]] && BUILD_ARGS+=("--cmk-packaged" "${{ inputs.cmk-packaged-version }}")
146+
[[ -n "${{ inputs.version-min-required }}" ]] && BUILD_ARGS+=("--version-min-required" "${{ inputs.version-min-required }}")
147+
[[ -n "${{ inputs.version-packaged }}" ]] && BUILD_ARGS+=("--version-packaged" "${{ inputs.version-packaged }}")
148148
[[ -n "${{ inputs.download-url }}" ]] && BUILD_ARGS+=("--download-url" "${{ inputs.download-url }}")
149149
[[ -n "${{ inputs.version-usable-until }}" ]] && BUILD_ARGS+=("--version-usable-until" "${{ inputs.version-usable-until }}")
150150
[[ -n "${{ inputs.output-dir }}" ]] && BUILD_ARGS+=("--output-dir" "${{ inputs.output-dir }}")
@@ -162,7 +162,7 @@ runs:
162162
echo "::notice::Running MKP build with arguments: ${BUILD_ARGS[*]}"
163163
164164
# Run the versioned build script directly
165-
"$MKP_SCRIPT" "${BUILD_ARGS[@]}"
165+
"$MKP_SCRIPT" --github-action-mode "${BUILD_ARGS[@]}"
166166
167167
# Find the generated MKP file
168168
MKP_FILE=$(find "${{ inputs.output-dir }}" -name "*.mkp" -type f | head -1)

0 commit comments

Comments
 (0)