feat(scripts): implement report-status.sh with bats and cucumber tests

POST build status to Gitea REST API. Supports pending, success, failure,
error states. Cross-repo reporting via optional root_commit and root_repo
parameters. Includes mock Gitea API server shared between bats unit tests
and cucumber acceptance tests.
This commit is contained in:
moilanik
2026-06-08 10:47:21 +03:00
parent 9a59cbc185
commit 51922e2954
10 changed files with 1540 additions and 6 deletions
+6 -6
View File
@@ -11,32 +11,32 @@ Feature: Commit status visibility
# Ticket 0001: report-status.sh — Build status reporting to commits
# ---------------------------------------------------------------------------
@ticket-0001 @mock @wip @real
@ticket-0001 @mock @real
Scenario: Build step reports pending status to commit
When a build step starts executing
Then the commit shows a pending status with a description of the step
@ticket-0001 @mock @wip @real
@ticket-0001 @mock @real
Scenario: Build step reports successful completion with a result link
When a build step completes successfully and reports its results
Then the commit shows a success status with a clickable link to the results
@ticket-0001 @mock @wip @real
@ticket-0001 @mock @real
Scenario: Build step reports failure when tests do not pass
When a build step fails
Then the commit shows a failure status with a description of what went wrong
@ticket-0001 @mock @wip @real
@ticket-0001 @mock @real
Scenario: Multiple build steps report distinct statuses on the same commit
When several build steps each report their own status to the same commit
Then each status appears under a unique label on the commit
@ticket-0001 @mock @wip @real
@ticket-0001 @mock @real
Scenario: Deployment step reports status back to the source commit
When a deployment finishes for a commit that originated from another repository
Then the source commit shows the deployment status alongside the build status
@ticket-0001 @mock @wip
@ticket-0001 @mock
Scenario: Status reporting is interrupted when the build system cannot be reached
When a build step tries to report status but the build system is unavailable
Then the pipeline fails with a clear error message