feat: Basic tracking of the NixOS rebuilds #98
No reviewers
Labels
No Label
Bug
Contributions welcome
Did not do
Duplicate
Feature
Module
Backups
Module
GraphQL
Priority
High
Priority
Low
Priority
Medium
Refactor
Severity
High
Severity
Low
Severity
Medium
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: SelfPrivacy/selfprivacy-rest-api#98
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "system-rebuild-tracking"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Closes #91
@ -0,0 +35,4 @@
# Get current time to handle timeout
start_time = datetime.now()
# Wait for the systemd unit to start
while True:
use utils.waitloop.wait_until_true
@ -0,0 +38,4 @@
while True:
try:
status = subprocess.run(
["systemctl", "is-active", unit_name],
Use selfprivacy_api.services.generic_status_getter
Also move that file to utils and name something like systemd.py
@ -0,0 +64,4 @@
while True:
try:
status = subprocess.run(
["systemctl", "is-active", unit_name],
same, use generic_status_getter (which hopefully becomes systemd.py)
@ -0,0 +85,4 @@
)
break
elif status.stdout.strip() == "active":
log_line = subprocess.run(
Add service output lookup also to utils.systemd
@ -119,4 +136,4 @@
},
)
assert response.status_code == 200
assert response.json().get("data") is not None
use tests.test_graphql.common get_data and other functions from that file please (it makes things much shorter and more readable).
For reference consult test_graphql/test_api_backup
@ -0,0 +46,4 @@
Jobs.update(
job=job,
status=JobStatus.ERROR,
error="System rebuild failed.",
Try using function to get last log lines to populate this error
@ -0,0 +90,4 @@
Jobs.update(
job=job,
status=JobStatus.ERROR,
error="System rebuild timed out.",
same, include unit output
@ -0,0 +109,4 @@
Jobs.update(
job=job,
status=JobStatus.ERROR,
error="System rebuild timed out.",
include unit output if any