2 Commits

Author SHA256 Message Date
5669083388 pr: handle case of nil user in reviews
All checks were successful
go-generate-check / go-generate-check (push) Successful in 21s
Integration tests / t (push) Successful in 6m29s
This can happen when a review request is assigned automatically via
CODEOWNERS or perhaps the requesting user has account removed.
2026-02-26 13:15:58 +01:00
Andrii Nikitin
cb9131a5dd t: add init process to all services
Some checks failed
Integration tests / t (pull_request) Successful in 7m0s
Integration tests / t (push) Failing after 6m58s
Enable init: true for all services in podman-compose.yml to ensure
proper signal handling and zombie process reaping within containers.
2026-02-26 12:17:29 +01:00
3 changed files with 15 additions and 1 deletions

View File

@@ -51,7 +51,7 @@ func FetchGiteaReviews(rf GiteaReviewTimelineFetcher, org, repo string, no int64
for idx, item := range timeline {
if item.Type == TimelineCommentType_Review || item.Type == TimelineCommentType_ReviewRequested {
for _, r := range rawReviews {
if r.ID == item.ReviewID {
if r.ID == item.ReviewID && r.User != nil {
if !alreadyHaveUserReview(r.User.UserName) {
if item.Type == TimelineCommentType_Review && idx > cutOffIdx {
needNewReviews = append(needNewReviews, r.User.UserName)

View File

@@ -137,6 +137,14 @@ func TestReviews(t *testing.T) {
isApproved: false,
isReviewedByTest1: true,
},
{
name: "Ghost user review",
reviews: []*models.PullReview{
{State: common.ReviewStateApproved, User: nil},
},
reviewers: []string{"user1"},
isApproved: false,
},
}
for _, test := range tests {

View File

@@ -8,6 +8,7 @@ services:
gitea:
build: ./gitea
container_name: gitea-test
init: true
environment:
- GITEA_WORK_DIR=/var/lib/gitea
networks:
@@ -27,6 +28,7 @@ services:
rabbitmq:
image: rabbitmq:3.13.7-management
container_name: rabbitmq-test
init: true
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "check_running", "-q"]
interval: 30s
@@ -55,6 +57,7 @@ services:
context: ..
dockerfile: integration/gitea-events-rabbitmq-publisher/Dockerfile${GIWTF_IMAGE_SUFFIX}
container_name: gitea-publisher
init: true
networks:
- gitea-network
depends_on:
@@ -75,6 +78,7 @@ services:
context: ..
dockerfile: integration/workflow-pr/Dockerfile${GIWTF_IMAGE_SUFFIX}
container_name: workflow-pr
init: true
networks:
- gitea-network
depends_on:
@@ -103,6 +107,7 @@ services:
mock-obs:
build: ./mock-obs
container_name: mock-obs
init: true
networks:
- gitea-network
ports:
@@ -116,6 +121,7 @@ services:
context: ..
dockerfile: integration/obs-staging-bot/Dockerfile${GIWTF_IMAGE_SUFFIX}
container_name: obs-staging-bot
init: true
networks:
- gitea-network
depends_on: