feat: Basic tracking of the NixOS rebuilds #98

Merged
inex merged 39 commits from system-rebuild-tracking into master 2024-03-06 18:12:22 +02:00

Closes #91

Closes #91
inex added 12 commits 2024-02-26 21:50:27 +02:00
continuous-integration/drone/push Build is failing Details
2019da1e10
feat: Track the status of the nixos rebuild systemd unit
continuous-integration/drone/push Build is failing Details
56de00226a
chore: Testing env
continuous-integration/drone/push Build is failing Details
00bcca0f99
fix: invalid setuptools version
continuous-integration/drone/push Build is failing Details
ab1ca6e59c
fix: register huey task
continuous-integration/drone/push Build is failing Details
94456af7d4
fix: debugging
continuous-integration/drone/push Build is failing Details
b98c020f23
fix: wrong systemd unit used
continuous-integration/drone/push Build is failing Details
ad069a2ad2
fix: wrong unit name again
continuous-integration/drone/push Build is failing Details
c851c3d193
chore: more debugging outuput
continuous-integration/drone/push Build is failing Details
1a34558e23
chore: Shorten the output on status_text
continuous-integration/drone/push Build is failing Details
25c691104f
fix: non-0 exit status of is-active
continuous-integration/drone/push Build is failing Details
c63552241c
tests: Cover upgrade and rebuild task
inex added 1 commit 2024-02-26 21:51:36 +02:00
continuous-integration/drone/push Build is failing Details
2443ae0144
chore: Remove version flavor
inex requested review from houkime 2024-02-26 21:52:01 +02:00
inex added 1 commit 2024-03-03 11:00:12 +02:00
continuous-integration/drone/push Build is failing Details
8cb812be56
chore: Remove debug leftover
inex added 1 commit 2024-03-04 10:54:46 +02:00
continuous-integration/drone/push Build is failing Details
96f8aad146
Merge branch 'master' into system-rebuild-tracking
houkime requested changes 2024-03-04 14:05:51 +02:00
@ -0,0 +35,4 @@
# Get current time to handle timeout
start_time = datetime.now()
# Wait for the systemd unit to start
while True:
Collaborator

use utils.waitloop.wait_until_true

use utils.waitloop.wait_until_true
inex marked this conversation as resolved
@ -0,0 +38,4 @@
while True:
try:
status = subprocess.run(
["systemctl", "is-active", unit_name],
Collaborator

Use selfprivacy_api.services.generic_status_getter
Also move that file to utils and name something like systemd.py

Use selfprivacy_api.services.generic_status_getter Also move that file to utils and name something like systemd.py
inex marked this conversation as resolved
@ -0,0 +64,4 @@
while True:
try:
status = subprocess.run(
["systemctl", "is-active", unit_name],
Collaborator

same, use generic_status_getter (which hopefully becomes systemd.py)

same, use generic_status_getter (which hopefully becomes systemd.py)
inex marked this conversation as resolved
@ -0,0 +85,4 @@
)
break
elif status.stdout.strip() == "active":
log_line = subprocess.run(
Collaborator

Add service output lookup also to utils.systemd

Add service output lookup also to utils.systemd
inex marked this conversation as resolved
@ -119,4 +136,4 @@
},
)
assert response.status_code == 200
assert response.json().get("data") is not None
Collaborator

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

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
inex marked this conversation as resolved
inex added 2 commits 2024-03-05 16:23:39 +02:00
inex requested review from houkime 2024-03-05 16:23:55 +02:00
houkime requested changes 2024-03-06 11:57:12 +02:00
@ -0,0 +46,4 @@
Jobs.update(
job=job,
status=JobStatus.ERROR,
error="System rebuild failed.",
Collaborator

Try using function to get last log lines to populate this error

Try using function to get last log lines to populate this error
inex marked this conversation as resolved
@ -0,0 +90,4 @@
Jobs.update(
job=job,
status=JobStatus.ERROR,
error="System rebuild timed out.",
Collaborator

same, include unit output

same, include unit output
inex marked this conversation as resolved
@ -0,0 +109,4 @@
Jobs.update(
job=job,
status=JobStatus.ERROR,
error="System rebuild timed out.",
Collaborator

include unit output if any

include unit output if any
inex marked this conversation as resolved
inex added 1 commit 2024-03-06 17:34:05 +02:00
inex requested review from houkime 2024-03-06 17:34:05 +02:00
inex added 20 commits 2024-03-06 17:40:10 +02:00
inex added 1 commit 2024-03-06 17:46:09 +02:00
continuous-integration/drone/push Build is failing Details
0eff0ef735
fix: move_service task path
houkime approved these changes 2024-03-06 18:12:00 +02:00
inex merged commit cf2f153cfe into master 2024-03-06 18:12:22 +02:00
inex deleted branch system-rebuild-tracking 2024-03-06 18:12:22 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: SelfPrivacy/selfprivacy-rest-api#98
There is no content yet.