Skip to content

Commit 46c596e

Browse files
committed
feat(bulletins): add bulletin management module with NiFi 2.7.0+ clearing
New nipyapi.bulletins module: - get_bulletins(): controller-level bulletins - get_bulletin_board(): filtered bulletins returning BulletinDTO directly - clear_*_bulletins(): component-specific clearing (10 functions) - clear_all_bulletins(): high-level helper for CI Additional changes: - nipyapi.profiles: add list_profiles, show, current commands - nipyapi.utils: add format_timestamp utility - nipyapi.ci.get_status: fix to capture controller service bulletins - nipyapi.canvas: bulletin functions now alias to bulletins module - Makefile: intelligent uv/pip detection - docs: updated contributing guide, module documentation
1 parent 34d0c5f commit 46c596e

File tree

22 files changed

+1143
-66
lines changed

22 files changed

+1143
-66
lines changed

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ export
1717
# Defaults to 'python' for conda/venv users, override with PYTHON=python3 for system installs
1818
PYTHON ?= python
1919

20+
# Package installer: prefer uv if available, fall back to pip
21+
# Users with uv get faster installs; users without uv work unchanged
22+
UV := $(shell command -v uv 2>/dev/null)
23+
ifdef UV
24+
PIP := uv pip
25+
else
26+
PIP := pip
27+
endif
28+
2029
# Profiles file for development/testing (explicitly use examples file, not user's ~/.nipyapi/profiles.yml)
2130
NIPYAPI_PROFILES_FILE ?= examples/profiles.yml
2231

@@ -149,13 +158,13 @@ clean-docker: clean-act ## comprehensive Docker cleanup: act + containers + volu
149158
@echo "Comprehensive Docker cleanup complete"
150159

151160
install: clean ## install the package to the active Python's site-packages
152-
pip install .
161+
$(PIP) install .
153162

154163
dev-install: ## install dev extras for local development
155-
pip install -e ".[dev]"
164+
$(PIP) install -e ".[dev]"
156165

157166
docs-install: ## install docs extras
158-
pip install -e ".[docs]"
167+
$(PIP) install -e ".[docs]"
159168

160169
coverage: ensure-certs ## run pytest with coverage and generate report (set coverage-min=NN to enforce; requires infrastructure)
161170
@echo "Running coverage analysis (single-user profile)..."
@@ -189,7 +198,7 @@ flake8: ## run flake8 linter on core nipyapi files
189198
pylint: ## run pylint on core nipyapi files
190199
pylint nipyapi/ --rcfile=pylintrc --ignore=nifi,registry,_version.py
191200

192-
pre-commit: ## run pre-commit hooks on all files
201+
pre-commit: ## run pre-commit hooks on all files (black, isort, flake8, pylint)
193202
pre-commit run --all-files
194203

195204
#################################################################################

docs/contributing.rst

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,18 @@ Ready to contribute? Here's how to set up `nipyapi` for local development.
6464

6565
$ git clone git@github.com:Chaffelson/nipyapi.git
6666

67-
3. Create and activate a Python 3.9+ virtual environment (venv or conda), then install dev extras::
67+
3. Create and activate a Python 3.9+ virtual environment (venv or uv), then install dev extras::
6868

6969
# using venv
7070
$ python -m venv .venv && source .venv/bin/activate
7171
$ cd nipyapi/
72-
$ pip install -e ".[dev]"
72+
$ make dev-install # uses uv if available, falls back to pip
7373

74-
# or using conda
75-
$ conda create -n nipyapi-dev python=3.11 -y
76-
$ conda activate nipyapi-dev
77-
$ pip install -e ".[dev]"
74+
# or using uv (faster)
75+
$ uv venv .venv && source .venv/bin/activate
76+
$ make dev-install
77+
78+
**Note:** The Makefile automatically detects whether ``uv`` is available and uses it for faster installs. If not available, it falls back to ``pip``. Both work seamlessly.
7879

7980
4. Create a branch for local development::
8081

@@ -163,7 +164,7 @@ NiPyAPI uses Makefile targets as the primary automation interface. Run ``make he
163164
**Setup & Installation**
164165
::
165166

166-
make dev-install # Install package with dev dependencies (recommended)
167+
make dev-install # Install with dev dependencies (uses uv if available, pip otherwise)
167168
make docs-install # Install documentation dependencies
168169
make clean # Remove build, pyc, and temp artifacts
169170
make clean-all # Nuclear clean: removes ALL including generated code
@@ -193,10 +194,16 @@ NiPyAPI uses Makefile targets as the primary automation interface. Run ``make he
193194
make lint # Run flake8 + pylint (excludes generated code)
194195
make flake8 # Run flake8 only
195196
make pylint # Run pylint only
196-
make pre-commit # Run pre-commit hooks on all files
197+
make pre-commit # Run pre-commit hooks (black, isort, flake8, pylint)
198+
199+
Pre-commit hooks are the recommended way to ensure code quality before committing. They automatically run formatting and linting checks.
197200

198-
# Formatting (manual)
199-
black nipyapi/ && isort nipyapi/ # Auto-format code
201+
**Troubleshooting Lint Issues**
202+
203+
* **Import order errors**: Run ``isort nipyapi/`` to auto-fix import ordering
204+
* **Line length errors**: Break long lines at logical points (operators, commas). Max is 100 chars.
205+
* **Formatting errors**: Run ``black nipyapi/`` to auto-format, then re-run ``make lint``
206+
* **Linting generated code**: Always use ``make lint`` which excludes generated code automatically
200207

201208
**Docker Operations**
202209
::
@@ -247,8 +254,12 @@ These files are automatically generated from OpenAPI specifications and should n
247254

248255
Focus your contributions on these core modules:
249256

257+
* ``nipyapi/bulletins.py`` - Bulletin retrieval, filtering, and clearing
250258
* ``nipyapi/canvas.py`` - Canvas management functions
259+
* ``nipyapi/ci.py`` - CI/CD convenience functions for flow deployment
251260
* ``nipyapi/config.py`` - Configuration and endpoints
261+
* ``nipyapi/extensions.py`` - NiFi extensions (NAR) management
262+
* ``nipyapi/layout.py`` - Canvas layout and component positioning
252263
* ``nipyapi/parameters.py`` - Parameter context operations
253264
* ``nipyapi/profiles.py`` - Profile management system
254265
* ``nipyapi/security.py`` - Authentication and security
@@ -259,6 +270,19 @@ Focus your contributions on these core modules:
259270
* ``examples/`` - Example scripts and usage patterns
260271
* ``docs/`` - Documentation (RST files)
261272

273+
**Adding New Core Modules**
274+
275+
When creating a new core module (e.g., ``nipyapi/mymodule.py``):
276+
277+
1. Add the module name to ``nipyapi/__init__.py`` in the ``__all__`` list
278+
2. Add a description to ``docs/scripts/generate_structured_docs.py`` in ``module_descriptions``
279+
3. Regenerate documentation with ``make docs`` to create the RST file
280+
4. Add corresponding tests in ``tests/test_mymodule.py``
281+
282+
The documentation generator auto-detects modules from ``__all__`` but uses ``module_descriptions``
283+
for human-readable descriptions. Without an entry in ``module_descriptions``, the module will
284+
still appear in docs but with a generic description.
285+
262286
**Regenerating Clients**
263287

264288
If you need to update the generated clients (e.g., for a new NiFi version):

docs/nipyapi-docs/core_modules.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ They wrap the lower-level generated API clients with Pythonic interfaces.
1717
core_modules/profiles
1818
core_modules/layout
1919
core_modules/extensions
20+
core_modules/ci
21+
core_modules/bulletins
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Bulletins
2+
=========
3+
4+
Bulletin retrieval, filtering, and clearing
5+
6+
.. automodule:: nipyapi.bulletins
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Ci
2+
==
3+
4+
CI/CD convenience functions for flow deployment
5+
6+
.. automodule:: nipyapi.ci
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:

docs/nipyapi-docs/core_modules/extensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Extensions
22
==========
33

4-
Extensions functionality
4+
NiFi extensions (NAR) management
55

66
.. automodule:: nipyapi.extensions
77
:members:

docs/nipyapi-docs/core_modules/layout.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Layout
22
======
33

4-
Layout functionality
4+
Canvas layout and component positioning
55

66
.. automodule:: nipyapi.layout
77
:members:

docs/nipyapi-docs/core_modules/profiles.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Profiles
22
========
33

4-
Profiles functionality
4+
Profile management for multi-environment configurations
55

66
.. automodule:: nipyapi.profiles
77
:members:

docs/nipyapi-docs/nifi_models/models.rst

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ NiFi Models
33

44
Complete model class reference for NiFi APIs.
55

6-
This reference documents all **394** model classes used by NiFi APIs. These classes are automatically cross-referenced from API documentation - click any model type in API documentation to jump directly to its definition here.
6+
This reference documents all **403** model classes used by NiFi APIs. These classes are automatically cross-referenced from API documentation - click any model type in API documentation to jump directly to its definition here.
77

88
Model Type Patterns
99
--------------------
@@ -166,6 +166,22 @@ All Model Classes
166166
:members:
167167
:show-inheritance:
168168

169+
.. autoclass:: ClearBulletinsForGroupRequestEntity
170+
:members:
171+
:show-inheritance:
172+
173+
.. autoclass:: ClearBulletinsForGroupResultsEntity
174+
:members:
175+
:show-inheritance:
176+
177+
.. autoclass:: ClearBulletinsRequestEntity
178+
:members:
179+
:show-inheritance:
180+
181+
.. autoclass:: ClearBulletinsResultEntity
182+
:members:
183+
:show-inheritance:
184+
169185
.. autoclass:: ClientIdParameter
170186
:members:
171187
:show-inheritance:
@@ -586,6 +602,10 @@ All Model Classes
586602
:members:
587603
:show-inheritance:
588604

605+
.. autoclass:: FlowRegistryClientDefinition
606+
:members:
607+
:show-inheritance:
608+
589609
.. autoclass:: FlowRegistryClientEntity
590610
:members:
591611
:show-inheritance:
@@ -682,6 +702,14 @@ All Model Classes
682702
:members:
683703
:show-inheritance:
684704

705+
.. autoclass:: ListenPortDTO
706+
:members:
707+
:show-inheritance:
708+
709+
.. autoclass:: ListenPortsEntity
710+
:members:
711+
:show-inheritance:
712+
685713
.. autoclass:: ListingRequestDTO
686714
:members:
687715
:show-inheritance:
@@ -1122,6 +1150,10 @@ All Model Classes
11221150
:members:
11231151
:show-inheritance:
11241152

1153+
.. autoclass:: PropertyListenPortDefinition
1154+
:members:
1155+
:show-inheritance:
1156+
11251157
.. autoclass:: PropertyResourceDefinition
11261158
:members:
11271159
:show-inheritance:
@@ -1546,6 +1578,10 @@ All Model Classes
15461578
:members:
15471579
:show-inheritance:
15481580

1581+
.. autoclass:: VersionedListenPortDefinition
1582+
:members:
1583+
:show-inheritance:
1584+
15491585
.. autoclass:: VersionedParameter
15501586
:members:
15511587
:show-inheritance:

docs/nipyapi-docs/registry_models/models.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Registry Models
33

44
Complete model class reference for Registry APIs.
55

6-
This reference documents all **85** model classes used by Registry APIs. These classes are automatically cross-referenced from API documentation - click any model type in API documentation to jump directly to its definition here.
6+
This reference documents all **87** model classes used by Registry APIs. These classes are automatically cross-referenced from API documentation - click any model type in API documentation to jump directly to its definition here.
77

88
Model Type Patterns
99
--------------------
@@ -186,6 +186,10 @@ All Model Classes
186186
:members:
187187
:show-inheritance:
188188

189+
.. autoclass:: ListenPortDefinition
190+
:members:
191+
:show-inheritance:
192+
189193
.. autoclass:: LongParameter
190194
:members:
191195
:show-inheritance:
@@ -326,6 +330,10 @@ All Model Classes
326330
:members:
327331
:show-inheritance:
328332

333+
.. autoclass:: VersionedListenPortDefinition
334+
:members:
335+
:show-inheritance:
336+
329337
.. autoclass:: VersionedParameter
330338
:members:
331339
:show-inheritance:

0 commit comments

Comments
 (0)