From 9d4c76a5e109ac451a894d52c5a29d926ded8509 Mon Sep 17 00:00:00 2001 From: pomidorry Date: Sun, 7 Jun 2026 19:52:59 +0300 Subject: [PATCH] fix --- modules/migration/file_format_test.go | 8 -------- modules/migration/options.go | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/modules/migration/file_format_test.go b/modules/migration/file_format_test.go index e1d85fcb36..bcf5e9f285 100644 --- a/modules/migration/file_format_test.go +++ b/modules/migration/file_format_test.go @@ -52,11 +52,3 @@ func TestMigrateOptionsSSHKeyOwnerIDRoundtrip(t *testing.T) { assert.Equal(t, int64(42), got.SSHKeyOwnerID) } -// TestMigrateOptionsSSHKeyOwnerIDOmitemptyZero ensures the default value (use -// repository owner's key) is omitted from the serialised JSON so existing task -// payloads in the DB stay compact and backward-compatible. -func TestMigrateOptionsSSHKeyOwnerIDOmitemptyZero(t *testing.T) { - data, err := json.Marshal(MigrateOptions{}) - assert.NoError(t, err) - assert.NotContains(t, string(data), "ssh_key_owner_id") -} diff --git a/modules/migration/options.go b/modules/migration/options.go index 067b1df43d..6a75b586ee 100644 --- a/modules/migration/options.go +++ b/modules/migration/options.go @@ -19,7 +19,7 @@ type MigrateOptions struct { AuthTokenEncrypted string `json:"auth_token_encrypted,omitempty"` // SSHKeyOwnerID overrides the owner whose managed SSH keypair authenticates // the SSH clone. 0 means use the target repository owner (the default). - SSHKeyOwnerID int64 `json:"ssh_key_owner_id,omitempty"` + SSHKeyOwnerID int64 `json:"ssh_key_owner_id"` // required: true UID int `json:"uid" binding:"Required"` // required: true