From 154b3c74e32da70479ca6f1aa8e1e8b579f61fd1 Mon Sep 17 00:00:00 2001
From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com>
Date: Tue, 22 Apr 2025 23:12:38 +0100
Subject: [PATCH] Bump WoofWare.Myriad and upgrade Gitea (#138)
---
Directory.Build.props | 2 +-
Gitea.Declarative.Lib/ConfigSchema.fs | 8 +
.../GeneratedSwaggerGitea.fs | 1443 +++-
.../Gitea.Declarative.Lib.fsproj | 4 +-
Gitea.Declarative.Lib/Gitea.fs | 39 +-
Gitea.Declarative.Lib/GiteaConfig.schema.json | 6 +
.../SerialisedConfigSchema.fs | 4 +
Gitea.Declarative.Lib/swagger.v1.json | 5869 ++++++++++++++++-
Gitea.Declarative.Test/Utils.fs | 12 +
Gitea.InMemory/Server.fs | 4 +-
nix/deps.json | 24 +-
11 files changed, 7257 insertions(+), 158 deletions(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 3045b41..a8e1127 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -9,7 +9,7 @@
-
+
diff --git a/Gitea.Declarative.Lib/ConfigSchema.fs b/Gitea.Declarative.Lib/ConfigSchema.fs
index d7a3395..74f2821 100644
--- a/Gitea.Declarative.Lib/ConfigSchema.fs
+++ b/Gitea.Declarative.Lib/ConfigSchema.fs
@@ -61,6 +61,8 @@ type ProtectedBranch =
BranchName : string
BlockOnOutdatedBranch : bool option
RequiredStatusChecks : string list option
+ IgnoreStaleApprovals : bool option
+ EnableForcePush : bool option
}
static member OfSerialised (s : SerialisedProtectedBranch) : ProtectedBranch =
@@ -68,6 +70,8 @@ type ProtectedBranch =
BranchName = s.BranchName
BlockOnOutdatedBranch = Option.ofNullable s.BlockOnOutdatedBranch
RequiredStatusChecks = Option.ofObj s.RequiredStatusChecks |> Option.map List.ofArray
+ IgnoreStaleApprovals = Option.ofNullable s.IgnoreStaleApprovals
+ EnableForcePush = Option.ofNullable s.EnableForcePush
}
member this.ToSerialised () : SerialisedProtectedBranch =
@@ -78,6 +82,8 @@ type ProtectedBranch =
match this.RequiredStatusChecks with
| None -> null
| Some l -> List.toArray l
+ IgnoreStaleApprovals = Option.toNullable this.IgnoreStaleApprovals
+ EnableForcePush = Option.toNullable this.EnableForcePush
}
type NativeRepo =
@@ -375,6 +381,8 @@ type Repo =
bp.StatusCheckContexts
else
None
+ IgnoreStaleApprovals = bp.IgnoreStaleApprovals
+ EnableForcePush = bp.EnableForcePush
}
)
|> Set.ofSeq
diff --git a/Gitea.Declarative.Lib/GeneratedSwaggerGitea.fs b/Gitea.Declarative.Lib/GeneratedSwaggerGitea.fs
index 4437d2b..645eaed 100644
--- a/Gitea.Declarative.Lib/GeneratedSwaggerGitea.fs
+++ b/Gitea.Declarative.Lib/GeneratedSwaggerGitea.fs
@@ -43,6 +43,68 @@ type AccessToken =
TokenLastEight : string option
}
+/// ActionTask represents a ActionTask
+[]
+type ActionTask =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ CreatedAt : string option
+ []
+ DisplayTitle : string option
+ []
+ Event : string option
+ []
+ HeadBranch : string option
+ []
+ HeadSha : string option
+ []
+ Id : int option
+ []
+ Name : string option
+ []
+ RunNumber : int option
+ []
+ RunStartedAt : string option
+ []
+ Status : string option
+ []
+ UpdatedAt : string option
+ []
+ Url : string option
+ []
+ WorkflowId : string option
+ }
+
+/// ActionTaskResponse returns a ActionTask
+[]
+type ActionTaskResponse =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ TotalCount : int option
+ []
+ WorkflowRuns : ActionTask list option
+ }
+
+/// ActionVariable return value of the query API
+[]
+type ActionVariable =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Data : string option
+ []
+ Name : string option
+ []
+ OwnerId : int option
+ []
+ RepoId : int option
+ }
+
/// ActivityPub type
[]
type ActivityPub =
@@ -113,6 +175,22 @@ type Attachment =
Uuid : string option
}
+/// Badge represents a user badge
+[]
+type Badge =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Description : string option
+ []
+ Id : int option
+ []
+ ImageUrl : string option
+ []
+ Slug : string option
+ }
+
/// BranchProtection represents a branch protection for a repository
[]
type BranchProtection =
@@ -123,6 +201,8 @@ type BranchProtection =
ApprovalsWhitelistTeams : string list option
[]
ApprovalsWhitelistUsername : string list option
+ []
+ BlockAdminMergeOverride : bool option
[]
BlockOnOfficialReviewRequests : bool option
[]
@@ -137,6 +217,10 @@ type BranchProtection =
DismissStaleApprovals : bool option
[]
EnableApprovalsWhitelist : bool option
+ []
+ EnableForcePush : bool option
+ []
+ EnableForcePushAllowlist : bool option
[]
EnableMergeWhitelist : bool option
[]
@@ -145,10 +229,20 @@ type BranchProtection =
EnablePushWhitelist : bool option
[]
EnableStatusCheck : bool option
+ []
+ ForcePushAllowlistDeployKeys : bool option
+ []
+ ForcePushAllowlistTeams : string list option
+ []
+ ForcePushAllowlistUsernames : string list option
+ []
+ IgnoreStaleApprovals : bool option
[]
MergeWhitelistTeams : string list option
[]
MergeWhitelistUsernames : string list option
+ []
+ Priority : int option
[]
ProtectedFilePatterns : string option
[]
@@ -171,6 +265,24 @@ type BranchProtection =
UpdatedAt : string option
}
+/// ChangeFileOperation for creating, updating or deleting a file
+[]
+type ChangeFileOperation =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Content : string option
+ []
+ FromPath : string option
+ []
+ Operation : string
+ []
+ Path : string
+ []
+ Sha : string option
+ }
+
/// ChangedFile store information about files affected by the pull request
[]
type ChangedFile =
@@ -205,6 +317,8 @@ type CommitAffectedFiles =
AdditionalProperties : System.Collections.Generic.Dictionary
[]
Filename : string option
+ []
+ Status : string option
}
/// CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE
@@ -283,6 +397,8 @@ type CreateBranchProtectionOption =
ApprovalsWhitelistTeams : string list option
[]
ApprovalsWhitelistUsername : string list option
+ []
+ BlockAdminMergeOverride : bool option
[]
BlockOnOfficialReviewRequests : bool option
[]
@@ -295,6 +411,10 @@ type CreateBranchProtectionOption =
DismissStaleApprovals : bool option
[]
EnableApprovalsWhitelist : bool option
+ []
+ EnableForcePush : bool option
+ []
+ EnableForcePushAllowlist : bool option
[]
EnableMergeWhitelist : bool option
[]
@@ -303,10 +423,20 @@ type CreateBranchProtectionOption =
EnablePushWhitelist : bool option
[]
EnableStatusCheck : bool option
+ []
+ ForcePushAllowlistDeployKeys : bool option
+ []
+ ForcePushAllowlistTeams : string list option
+ []
+ ForcePushAllowlistUsernames : string list option
+ []
+ IgnoreStaleApprovals : bool option
[]
MergeWhitelistTeams : string list option
[]
MergeWhitelistUsernames : string list option
+ []
+ Priority : int option
[]
ProtectedFilePatterns : string option
[]
@@ -337,6 +467,8 @@ type CreateBranchRepoOption =
NewBranchName : string
[]
OldBranchName : string option
+ []
+ OldRefName : string option
}
/// CreateEmailOption options when creating email addresses
@@ -444,6 +576,8 @@ type CreateLabelOption =
Description : string option
[]
Exclusive : bool option
+ []
+ IsArchived : bool option
[]
Name : string
}
@@ -476,6 +610,18 @@ type CreateOAuth2ApplicationOptions =
Name : string option
[]
RedirectUris : string list option
+ []
+ SkipSecondaryAuthorization : bool option
+ }
+
+/// CreateOrUpdateSecretOption options when creating or updating secret
+[]
+type CreateOrUpdateSecretOption =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Data : string
}
/// CreateOrgOption options for creating an organization
@@ -486,6 +632,8 @@ type CreateOrgOption =
AdditionalProperties : System.Collections.Generic.Dictionary
[]
Description : string option
+ []
+ Email : string option
[]
FullName : string option
[]
@@ -522,6 +670,10 @@ type CreatePullRequestOption =
Labels : int list option
[]
Milestone : int option
+ []
+ Reviewers : string list option
+ []
+ TeamReviewers : string list option
[]
Title : string option
}
@@ -600,6 +752,8 @@ type CreateRepoOption =
License : string option
[]
Name : string
+ []
+ ObjectFormatName : string option
[]
Private : bool option
[]
@@ -640,6 +794,20 @@ type CreateTagOption =
Target : string option
}
+/// CreateTagProtectionOption options for creating a tag protection
+[]
+type CreateTagProtectionOption =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ NamePattern : string option
+ []
+ WhitelistTeams : string list option
+ []
+ WhitelistUsernames : string list option
+ }
+
[]
type Type1 =
{
@@ -686,7 +854,7 @@ type CreateUserOption =
[]
MustChangePassword : bool option
[]
- Password : string
+ Password : string option
[]
Restricted : bool option
[]
@@ -699,6 +867,16 @@ type CreateUserOption =
Visibility : string option
}
+/// CreateVariableOption the option when creating variable
+[]
+type CreateVariableOption =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Value : string
+ }
+
/// CreateWikiPageOptions form for creating wiki
[]
type CreateWikiPageOptions =
@@ -773,6 +951,8 @@ type EditBranchProtectionOption =
ApprovalsWhitelistTeams : string list option
[]
ApprovalsWhitelistUsername : string list option
+ []
+ BlockAdminMergeOverride : bool option
[]
BlockOnOfficialReviewRequests : bool option
[]
@@ -783,6 +963,10 @@ type EditBranchProtectionOption =
DismissStaleApprovals : bool option
[]
EnableApprovalsWhitelist : bool option
+ []
+ EnableForcePush : bool option
+ []
+ EnableForcePushAllowlist : bool option
[]
EnableMergeWhitelist : bool option
[]
@@ -791,10 +975,20 @@ type EditBranchProtectionOption =
EnablePushWhitelist : bool option
[]
EnableStatusCheck : bool option
+ []
+ ForcePushAllowlistDeployKeys : bool option
+ []
+ ForcePushAllowlistTeams : string list option
+ []
+ ForcePushAllowlistUsernames : string list option
+ []
+ IgnoreStaleApprovals : bool option
[]
MergeWhitelistTeams : string list option
[]
MergeWhitelistUsernames : string list option
+ []
+ Priority : int option
[]
ProtectedFilePatterns : string option
[]
@@ -906,6 +1100,8 @@ type EditLabelOption =
Description : string option
[]
Exclusive : bool option
+ []
+ IsArchived : bool option
[]
Name : string option
}
@@ -934,6 +1130,8 @@ type EditOrgOption =
AdditionalProperties : System.Collections.Generic.Dictionary
[]
Description : string option
+ []
+ Email : string option
[]
FullName : string option
[]
@@ -1006,6 +1204,20 @@ type EditReleaseOption =
TargetCommitish : string option
}
+/// EditTagProtectionOption options for editing a tag protection
+[]
+type EditTagProtectionOption =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ NamePattern : string option
+ []
+ WhitelistTeams : string list option
+ []
+ WhitelistUsernames : string list option
+ }
+
[]
type Type3 =
{
@@ -1089,6 +1301,10 @@ type Email =
Email : string option
[]
Primary : bool option
+ []
+ UserId : int option
+ []
+ Username : string option
[]
Verified : bool option
}
@@ -1261,6 +1477,8 @@ type GenerateRepoOption =
Owner : string
[]
Private : bool option
+ []
+ ProtectedBranch : bool option
[]
Topics : bool option
[]
@@ -1353,6 +1571,18 @@ type GitTreeResponse =
Url : string option
}
+/// GitignoreTemplateInfo name and text of a gitignore template
+[]
+type GitignoreTemplateInfo =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Name : string option
+ []
+ Source : string option
+ }
+
[]
type Type4 =
{
@@ -1370,6 +1600,8 @@ type Hook =
Active : bool option
[]
AuthorizationHeader : string option
+ []
+ BranchFilter : string option
[]
Config : Type4 option
[]
@@ -1410,6 +1642,30 @@ type InternalTracker =
EnableTimeTracker : bool option
}
+[]
+type IssueConfigContactLink =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ About : string option
+ []
+ Name : string option
+ []
+ Url : string option
+ }
+
+[]
+type IssueConfigValidation =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Message : string option
+ []
+ Valid : bool option
+ }
+
/// IssueDeadline represents an issue deadline
[]
type IssueDeadline =
@@ -1441,7 +1697,21 @@ type IssueLabelsOption =
[]
AdditionalProperties : System.Collections.Generic.Dictionary
[]
- Labels : int list option
+ Labels : unit list option
+ }
+
+/// IssueMeta basic issue information
+[]
+type IssueMeta =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Index : int option
+ []
+ Owner : string option
+ []
+ Repo : string option
}
/// Label a label to an issue or a pr
@@ -1458,6 +1728,56 @@ type Label =
Exclusive : bool option
[]
Id : int option
+ []
+ IsArchived : bool option
+ []
+ Name : string option
+ []
+ Url : string option
+ }
+
+/// LabelTemplate info of a Label template
+[]
+type LabelTemplate =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Color : string option
+ []
+ Description : string option
+ []
+ Exclusive : bool option
+ []
+ Name : string option
+ }
+
+/// LicensesInfo contains information about a License
+[]
+type LicenseTemplateInfo =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Body : string option
+ []
+ Implementation : string option
+ []
+ Key : string option
+ []
+ Name : string option
+ []
+ Url : string option
+ }
+
+/// LicensesListEntry is used for the API
+[]
+type LicensesTemplateListEntry =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Key : string option
[]
Name : string option
[]
@@ -1480,6 +1800,24 @@ type MarkdownOption =
Wiki : bool option
}
+/// MarkupOption markup options
+[]
+type MarkupOption =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Context : string option
+ []
+ FilePath : string option
+ []
+ Mode : string option
+ []
+ Text : string option
+ []
+ Wiki : bool option
+ }
+
/// MergePullRequestForm form for merging Pull Request
[]
type MergePullRequestOption =
@@ -1504,6 +1842,24 @@ type MergePullRequestOption =
MergeWhenChecksSucceed : bool option
}
+[]
+type MergeUpstreamRequest =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Branch : string option
+ }
+
+[]
+type MergeUpstreamResponse =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ MergeType : string option
+ }
+
/// MigrateRepoOptions options for migrating repository's
/// this is used to interact with api v1
[]
@@ -1517,6 +1873,10 @@ type MigrateRepoOptions =
AuthToken : string option
[]
AuthUsername : string option
+ []
+ AwsAccessKeyId : string option
+ []
+ AwsSecretAccessKey : string option
[]
CloneAddr : string
[]
@@ -1553,6 +1913,18 @@ type MigrateRepoOptions =
Wiki : bool option
}
+/// NewIssuePinsAllowed represents an API response that says if new Issue Pins are allowed
+[]
+type NewIssuePinsAllowed =
+ {
+ []
+ AdditionalProperties : System.Collections.Generic.Dictionary
+ []
+ Issues : bool option
+ []
+ PullRequests : bool option
+ }
+
[]
type Type7 =
{
@@ -1632,6 +2004,8 @@ type OAuth2Application =
Name : string option
[