Repository navigation
NOC Weekly Digest #15 - October 19–25, 2026 #739
dvolodin7
started this conversation in
NOC Choronicles
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
A major architectural milestone for NOC, a broad Python modernization, and a new release.
This week, NOC merged 37 pull requests and released NOC 25.1.3. Development focused on completing the migration to the
src/noc/layout, making resource loading independent of the current working directory, modernizing Python typing, and addressing several latent reliability issues.The six companion projects—Gufo Thor, Gufo Tower, Gufo SNMP, Gufo Blob, Gufo ACME, and CSR Proxy—had no merges or releases during the reporting period.
The main story is structural: the new package layout establishes the foundation for distributing and running NOC as a properly packaged Python application. Several accompanying changes prepare the codebase for NOC 26 and its planned breaking changes.
Highlights
src/noc/migration is complete. Approximately 6,400 Python files were moved under the standard Python package layout, completing NEP-0101 Step 8.Generic.Hostprofile, was closed after restoring the required JSON-RPC serialization behavior.1. Architecture: Completing the
src/noc/MigrationThe week's central milestone was the completion of NEP-0101 Step 8.
NOC's main Python packages—including
core/,services/,commands/,fixes/, andcmibs/, together with the Django-style applications—were moved undersrc/noc/. The repository root now contains the remaining launch and build scaffolding rather than the application source tree.The migration was predominantly mechanical, involving approximately 6,400 Python files. Its significance, however, extends well beyond file organization.
With application code residing in a proper Python package, NOC can resolve its resources through the installed package instead of relying on assumptions about the repository structure or process working directory.
Package-based resource loading
The layout migration enabled a coordinated cleanup of resource discovery.
A central
Config.noc_baseproperty now provides the foundation for locating NOC resources. CWD-relative paths, hardcodedsrc/nocreferences, and bespoke filesystem scanners were replaced across several areas of the application.The changes cover:
These changes move resource loading toward a shared
gufo.loader.Loaderandimportlib.resourcesapproach.The packaging configuration was updated accordingly: Hatchling replaced setuptools, and the distribution now includes the Jinja templates and RADIUS dictionary needed at runtime.
The intended result is consistent resource resolution across source checkouts, installed wheels, and services launched from arbitrary working directories.
For developers and integrators, this removes an important class of deployment assumptions. The application should no longer need to know where its source checkout happens to reside to locate its own resources.
Preparing for NOC 26
The migration also establishes the foundation for the next major version.
Breaking changes are being documented incrementally in
docs/releases/26_dev.md. Among the changes already identified are the movement of dynamic-dashboard templates, stricter binary-attribute requirements for device profiles, removal ofcommand_more, and changes to card custom-template handling.These changes should be treated as part of the NOC 26 upgrade path rather than as routine maintenance.
2. Python Modernization: PEP 695 and Modern Annotations
NOC continued its transition to modern Python typing, using Python 3.13 as its minimum supported version.
The work spans both production code and tests.
Modern generic syntax
Module-level
TypeVarandParamSpecdeclarations were replaced with inline type parameters where appropriate. Generic classes moved to theclass Name[T]syntax introduced by PEP 695, and quoted forward-reference annotations were removed where they were no longer necessary.The migration also replaced
typing.Optionalwith PEP 604 unions such asX | Noneacross approximately 150 modules.Test helpers and test cases received additional argument and return-type annotations, including explicit
-> Noneannotations.Tooling enforcement
The modernization was supported by a series of Ruff
pyupgraderule enablements, encouraging consistent use of newer Python syntax and APIs.Other changes included:
datetime.UTC.ruff formatacross the tree.PLR091rules to avoid unnecessary mass changes.The goal is a more consistent, statically checkable codebase without introducing a separate compatibility layer for older Python versions.
These changes are primarily a source-level modernization: the intent is to preserve runtime behavior and public APIs while making the code better aligned with the project's supported Python baseline.
3. Reliability: Fixing Latent Async and Threading Problems
Two important changes addressed problems that could remain hidden until particular execution paths or workloads exposed them.
Background asyncio task lifetime
Enforcing Ruff's
RUF006rule highlighted a correctness risk in background task handling.Calls to
asyncio.create_task()were made without consistently retaining references to the resulting tasks. This could allow tasks to be garbage-collected before completing.A new
start_background_task()helper establishes explicit task retention in the service layer, covering components such as metrics, the correlator, chwriter, and the scheduler.One-shot CLI worker pools used by network scanning and SNMP-related commands were also moved under
asyncio.TaskGroup().Structured concurrency makes the lifetime of these tasks easier to manage and allows cancellation to propagate through the worker pool in a controlled manner.
Thread-pool executor deadlock
The thread-pool executor was typed and restructured, exposing and fixing a latent deadlock in
set_max_workers.The previous implementation attempted to acquire a non-reentrant lock while already holding it. The revised implementation removes this lock-ordering problem.
A related
idle_timeout=0path that could raise aTypeErrorwas fixed as well.A simpler event-loop setup
The event-loop initialization code was also consolidated.
A new
get_loop_factory()helper centralizes the choice between uvloop and the standard asyncio event loop. Ten CLI commands were migrated from the customrun_sync()wrapper toasyncio.run(..., loop_factory=...).This reduces the amount of custom event-loop orchestration and makes loop selection consistent across commands.
Together, these changes improve the explicitness of task lifetimes, cancellation, and thread-pool synchronization without changing the intended application-level behavior.
4. Deprecations and Configuration Cleanup
Several long-deprecated interfaces and unused configuration options were removed.
Two changes are particularly relevant to developers maintaining custom device profiles.
Binary profile attributes are now strictly typed
The deprecation of string values for binary device-profile attributes has been finalized.
The profile metaclass no longer automatically converts
strvalues tobytesor emits theRemovedInNOC2003warning. The eleven binary profile attributes now requirebytesorNone, with corresponding static annotations.Custom profile authors relying on implicit conversion must update their definitions to use byte literals, for example:
b"example"This is a deliberate compatibility break and should be included in NOC 26 migration checks.
command_morehas been removedThe deprecated
command_moreparameter was removed in favor ofpattern_more.The replacement uses a list of
(match, command)byte tuples. Legacy two-field forms are no longer silently converted; they now raise an error during loading.Custom profiles using the old format must be updated.
Dead configuration and commands
The cleanup also removed:
msgstream.*.auto_pauseparameters.[backup]configuration section.These removals eliminate unused or obsolete interfaces. Most should have no effect on standard deployments, while the profile changes require attention from users with custom configurations.
5. Dependency and Build Maintenance
The week's dependency updates focused on compatibility, defensive improvements, and packaging hygiene.
bsdiff4hiredisgufo_noc_speedupa2wsgiPYTHONPYCACHEPREFIXThe
bsdiff4update is particularly relevant to GridVCS delta storage. It hardens patch processing against malformed or oversized diffs and improves memory cleanup when an operation is interrupted.The on-disk delta format remains unchanged, so deltas written with version 1.2.6 remain readable.
The
hiredisupdate is a maintenance refresh of a stable API, while the SNMP speedup package's Python 3.14 support prepares the accelerated parser for the next interpreter version.Finally, configuring
PYTHONPYCACHEPREFIXin the Docker image prevents Python's generated bytecode from being written alongside the application sources under/opt/noc.6. Fixes and Improvements
Device discovery: issue #664
The most prominent user-visible regression addressed this week affected automatic device discovery with the
Generic.Hostprofile.Following the earlier migration from
ORJSONResponsetoJSONResponse, the generic JSON-RPC handler returned a response containingCheckResultdataclasses that the standard JSON serializer could not handle.The handler was restored to orjson serialization, resolving the issue.
PR #696 was merged on October 18, and issue #664 was closed on October 22.
The fix restores the expected discovery behavior. It also highlights an important compatibility detail: although the project is moving away from
ORJSONResponsegenerally, the JSON-RPC path still depends on serialization behavior that cannot be replaced with the default response handling without additional work.GIS tile configuration
A copy-and-paste error in the web desktop's
api_settingsresponse causedenable_tile2andenable_tile3to use the value ofenable_tile1.As a result, custom tile sources could not be enabled independently.
Each flag now reads its own configuration value.
Cisco ASA profile adapter
The Cisco ASA
get_configprofile adapter was simplified.The refactoring introduces an early return for single-context mode and replaces repeated string concatenation with list accumulation and joining.
The output remains byte-identical.
Test-suite robustness
Several test adjustments support the new package layout and loader behavior.
One-shot loader generators are now materialized into lists before being passed to
pytest.mark.parametrize, avoiding problems with test re-collection and parallel execution through xdist.Handler-path tests now use the module's runtime import name rather than assuming a particular filesystem location.
These changes reduce the test suite's dependence on the old repository layout.
7. Release: NOC 25.1.3
NOC 25.1.3 was published on October 23, 2026, at 11:09 UTC.
The release notes report 45 fixes and improvements.
The release brings together work on the source layout, package-based resource loading, Python typing, deprecation cleanup, and runtime reliability.
Full release details are available in the NOC 25.1.3 release notes.
The release's count of 45 fixes and improvements is a changelog metric; it should not be confused with the 37 pull requests merged during this reporting period.
8. Project Activity and Contributors
NOC accounted for all recorded development activity across the seven covered repositories during the reporting period.
All 37 NOC pull requests were authored by @dvolodin7. The count excludes no backports or reverts because none inflated the raw total during the reporting period.
The changes form a coherent engineering effort rather than a collection of unrelated fixes: package restructuring, typing modernization, API cleanup, and runtime hardening all support the same broader direction.
No new design discussions were opened on NOC or the companion projects during the reporting period. The only relevant discussion activity was associated with the NOC 25.1.3 release.
9. Looking Ahead
NOC 26: compatibility and packaging
With the
src/noc/migration complete, the next major-version work can build on a consistent package structure.The documented breaking changes already include:
command_more.Custom-profile authors and integrators should review these changes before upgrading.
Python 3.14 readiness
The updated SNMP acceleration package adds Python 3.14 support. The week's broader typing and packaging work also moves the codebase toward a more modern Python development environment.
Gufo Thor 0.15.0
Gufo Thor 0.15.0 was released on October 26, immediately after this digest's reporting window.
It will be covered in the next issue.
Summary: NOC's main achievement this week was completing the structural work needed for a properly packaged application. The resource-loading changes, typing modernization, and reliability fixes build on that foundation, while the deprecation removals clarify the compatibility boundary for NOC 26.
NOC 25.1.3 packages this work into a release; the next challenge is carrying the new layout and stricter interfaces forward into the next major version.
All reactions