Repository navigation
Match filescan health policies by process group and name - #1167
Merged
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1164.
Look up each process's policy by
(group, name)instead of zipping two independently sorted lists. Unloaded configurations and repeated names across groups can no longer assign another process's autostart/exit policy or silently drop extra processes.Unmatched process identities use the existing error response. Output ordering, response schema and the health policy for correctly matched records are unchanged. This is independent of #1162's state/exit-code correction.
Testing
python -m pytest -q filescan/python-filescan/tests/test_health_process_identity.py13 focused tests passed; eight fail on unchanged source. Real Flask requests cover both response orders, same-name processes in different groups, extra unloaded configurations, missing matches, unchanged inputs and normal/empty controls.
71 tests pass in an isolated combined check with the new worker/registry fixes and the earlier #1160 and #1162 changes. One earlier #1162 test fixture was separately corrected to include the
groupfield that Supervisor actually returns; that fixture-only update keeps its 17 existing tests passing. No previous production changes are included here.Supervisor RPC calls are stubbed before module import. No Supervisor daemon, scanner, listener or live service was started.
Tested on macOS with Python 3.12. New-test formatting, syntax checks, scoped lint with the Python 3.12 target, and
git diff --checkpass. Full Malcolm deployment testing was not run. No workflow or dependency changes.