Copilot commented on code in PR #435:
URL: https://github.com/apache/trafficserver-ci/pull/435#discussion_r3391148196


##########
github-mirror/systemd/github-mirror-webhook.service:
##########
@@ -0,0 +1,23 @@
+[Unit]
+Description=ATS CI GitHub mirror webhook receiver
+Documentation=file:@INSTALL_ROOT@/README.md
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+Type=simple
+User=@MIRROR_USER@
+Group=@MIRROR_GROUP@
+EnvironmentFile=/etc/trafficserver-github-mirror/github-mirror-webhook.env
+WorkingDirectory=@MIRROR_ROOT@
+ExecStart=@INSTALL_ROOT@/bin/github-mirror-webhook.py
+Restart=on-failure
+RestartSec=5s

Review Comment:
   `github-mirror-webhook.py` exits with status 1 when `GITHUB_WEBHOOK_SECRET` 
is unset/`CHANGE_ME`, but this unit is configured with `Restart=on-failure`, 
which will put the service into a restart loop (log spam and noisy failed unit) 
until the secret is installed. Add `RestartPreventExitStatus=1` (or adjust 
`Restart=`) so a deliberate config error doesn’t trigger restarts.



##########
github-mirror/systemd/github-mirror-fallback.service:
##########
@@ -0,0 +1,13 @@
+[Unit]
+Description=ATS CI GitHub mirror fallback refresh
+Documentation=file:@INSTALL_ROOT@/README.md
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+Type=oneshot
+User=@MIRROR_USER@
+Group=@MIRROR_GROUP@
+Environment=MIRROR_ROOT=@MIRROR_ROOT@
+ExecStart=@INSTALL_ROOT@/bin/update-mirror.sh --all
+Nice=5

Review Comment:
   This oneshot service runs `git fetch` against GitHub and can legitimately 
take longer than systemd’s default start timeout (90s), especially on initial 
sync or network slowness. Add an explicit `TimeoutStartSec` to avoid systemd 
killing the update mid-fetch (which would leave the mirror stale and cause CI 
checkout failures).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to