Remove non-functional CheckSuiteID parameter support

The CheckSuiteID parameter was referencing a non-existent 'check_suite_id'
column in the action_run table. This commit removes the hallucinated database
schema reference while maintaining API compatibility.

Changes:
- Remove CheckSuiteID field from FindRunOptions struct
- Remove check_suite_id database query condition
- Remove parameter handling logic from shared action handler
- Remove related tests for non-functional feature
- Update Swagger docs to indicate parameter is not supported in Gitea API
- Maintain GitHub API compatibility by keeping parameter documented

The check_suite_id parameter is now silently ignored when provided,
with clear documentation that it's not supported in Gitea.
This commit is contained in:
Brice Ruth committed 2025-06-30 10:44:48 -05:00
1 parent 695496c100
commit 1b9b410c5d
6 files changed
+63 -118

No files matched your search

-4
View File
@@ -77,7 +77,6 @@ type FindRunOptions struct {
CreatedAfter time.Time
CreatedBefore time.Time
ExcludePullRequests bool
CheckSuiteID int64
}
func (opts FindRunOptions) ToConds() builder.Cond {
@@ -115,9 +114,6 @@ func (opts FindRunOptions) ToConds() builder.Cond {
if opts.ExcludePullRequests {
cond = cond.And(builder.Neq{"`action_run`.trigger_event": webhook_module.HookEventPullRequest})
}
if opts.CheckSuiteID > 0 {
cond = cond.And(builder.Eq{"`action_run`.check_suite_id": opts.CheckSuiteID})
}
return cond
}
-16
View File
@@ -28,22 +28,6 @@ func TestFindRunOptions_ToConds_ExcludePullRequests(t *testing.T) {
assert.Contains(t, args, webhook.HookEventPullRequest)
}
func TestFindRunOptions_ToConds_CheckSuiteID(t *testing.T) {
// Test when CheckSuiteID is set
const testSuiteID int64 = 12345
opts := FindRunOptions{
CheckSuiteID: testSuiteID,
}
cond := opts.ToConds()
// Convert the condition to SQL for assertion
sql, args, err := builder.ToSQL(cond)
assert.NoError(t, err)
// The condition should contain the check_suite_id equal to the test value
assert.Contains(t, sql, "`action_run`.check_suite_id=")
assert.Contains(t, args, testSuiteID)
}
func TestFindRunOptions_ToConds_CreatedDateRange(t *testing.T) {
// Test when CreatedAfter and CreatedBefore are set
startDate := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC)