fix(remediation): record review and ntfy delivery status #188
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:electra
host:fleet
host:lyra
host:nova
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!188
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-168-remediation-notification-feedback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Validation
./tests/nixos-update-remediation-regressions.shnovarunner-label warning excluded)git diff --checkRefs #168
Automated code review
Reviewed commit:
b7d93621d7d677f80d5296a740d71092515fdc66Verdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
The PR implements a feedback loop for the automated NixOS update remediation system. It adds logic to record when a remediation proposal is ready for human review (via a marker-deduplicated comment on the tracking issue) and handles ntfy notification delivery failures by recording them as bounded, deduplicated comments on the affected tracking issues. The changes span workflow definitions (
attic-cache.yml), Python publication logic (publication.py), and regression tests.Blocking findings
None.
Important findings
The
record-remediation-notify-failurejob hasneeds: [remediate, notify-remediation]. Thenotify-remediationjob itself hasneeds: remediate. Ifnotify-remediationfails,record-remediation-notify-failureruns. However, ifnotify-remediationis skipped (e.g., due toif: ${{ always() && needs.remediate.result != 'skipped' }}logic or other conditions), the dependency resolution might behave unexpectedly depending on Forgejo's specific handling of skipped vs failed jobs inalways()contexts. More critically, ifnotify-remediationfails, it outputsdelivery_failures. If it succeeds, it also outputsdelivery_failures(empty array). The logic seems sound, but the explicit dependency on both ensures it only runs after notification attempts.Impact: If the dependency logic is misinterpreted by the runner or if
notify-remediationfails in a way that doesn't trigger theifcondition correctly, the failure reporting might not occur, leaving operators unaware of ntfy delivery issues.Suggested fix: Verify Forgejo's behavior when a needed job fails vs is skipped. Ensure the
ifcondition onrecord-remediation-notify-failure(needs.notify-remediation.result == 'failure') accurately captures all failure modes of the notification step.Suggestions
$TEA_BIN comment --repo "${GITHUB_REPOSITORY:-nimmo/nixos-config}" "$issue_index" "$comment"
Impact: If this workflow is ever forked or used in a different repository without updating the environment variable
GITHUB_REPOSITORY, it will default tonimmo/nixos-config. WhileGITHUB_REPOSITORYis typically set by the runner, relying on a fallback with a hardcoded value is less robust than ensuring the variable is always present or using a workflow-level input.Suggested fix: Ensure
GITHUB_REPOSITORYis always provided by the runner environment (which it usually is in GitHub/Forgejo Actions) and consider removing the fallback or making it explicit that it's a safety net for local testing only.Tests and validation
Questions
notify-remediationjob'sif: ${{ always() && needs.remediate.result != 'skipped' }}condition correctly handle cases whereremediateis skipped? Ifremediateis skipped,notify-remediationshould also be skipped or handled appropriately to avoid false failure reports.record-remediation-notify-failurejob, why isTEA_BINpassed fromneeds.remediate.outputs.tea_bin? Is it guaranteed thattea_binis available even ifremediatefailed? Ifremediatefails to producetea_bin, the failure reporter will fail with 'remediation publication client is unavailable', which might mask the actual ntfy failure.--retry 3 --retry-all-errors. Are there any specific transient errors that should be handled differently (e.g., rate limiting vs. network timeout)?Review limitations
Diff coverage
.forgejo/workflows/attic-cache.yml: reviewed — included in a context-limited batchREADME.md: reviewed — included in a context-limited batchscripts/nixos_update_remediation/publication.py: reviewed — included in a context-limited batchtests/nixos-update-remediation-integration.py: reviewed — included in a context-limited batchtests/nixos-update-remediation-regressions.sh: reviewed — included in a context-limited batchReview metadata