Add pull request milestone features

This commit is contained in:
Georg Bauer
2026-07-31 14:22:21 +02:00
parent c5ecb8f87d
commit 86200b4668
9 changed files with 474 additions and 52 deletions

View File

@@ -633,6 +633,10 @@ public protocol GotchaCoreProtocol: AnyObject, Sendable {
func pullDiff(owner: String, repository: String, number: Int64, path: String) async throws -> DiffPage
func pullFilters() async throws -> PullFilterOptions
func pullFiltersActive() throws -> Bool
func pulls() async throws -> [PullRow]
func repositories() async throws -> [RepositoryRow]
@@ -651,6 +655,8 @@ public protocol GotchaCoreProtocol: AnyObject, Sendable {
func setIssueStatus(status: String) throws
func setPullFilters(milestone: String) throws
func setPullStatus(status: String) throws
func settings() -> Settings
@@ -942,6 +948,31 @@ open func pullDiff(owner: String, repository: String, number: Int64, path: Strin
)
}
open func pullFilters()async throws -> PullFilterOptions {
return
try await uniffiRustCallAsync(
rustFutureFunc: {
uniffi_gotcha_core_fn_method_gotchacore_pull_filters(
self.uniffiCloneHandle()
)
},
pollFunc: ffi_gotcha_core_rust_future_poll_rust_buffer,
completeFunc: ffi_gotcha_core_rust_future_complete_rust_buffer,
freeFunc: ffi_gotcha_core_rust_future_free_rust_buffer,
liftFunc: FfiConverterTypePullFilterOptions_lift,
errorHandler: FfiConverterTypeGotchaError_lift
)
}
open func pullFiltersActive()throws -> Bool {
return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeGotchaError_lift) {
uniffiCallStatus in
uniffi_gotcha_core_fn_method_gotchacore_pull_filters_active(
self.uniffiCloneHandle(),uniffiCallStatus
)
})
}
open func pulls()async throws -> [PullRow] {
return
try await uniffiRustCallAsync(
@@ -1054,6 +1085,15 @@ open func setIssueStatus(status: String)throws {try rustCallWithError(FfiConve
}
}
open func setPullFilters(milestone: String)throws {try rustCallWithError(FfiConverterTypeGotchaError_lift) {
uniffiCallStatus in
uniffi_gotcha_core_fn_method_gotchacore_set_pull_filters(
self.uniffiCloneHandle(),
FfiConverterString.lower(milestone),uniffiCallStatus
)
}
}
open func setPullStatus(status: String)throws {try rustCallWithError(FfiConverterTypeGotchaError_lift) {
uniffiCallStatus in
uniffi_gotcha_core_fn_method_gotchacore_set_pull_status(
@@ -1977,12 +2017,14 @@ public func FfiConverterTypeLabelRow_lower(_ value: LabelRow) -> RustBuffer {
public struct MilestonePage: Equatable, Hashable {
public var milestone: MilestoneRow
public var issues: [IssueRow]
public var pulls: [PullRow]
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(milestone: MilestoneRow, issues: [IssueRow]) {
public init(milestone: MilestoneRow, issues: [IssueRow], pulls: [PullRow]) {
self.milestone = milestone
self.issues = issues
self.pulls = pulls
}
@@ -2002,13 +2044,15 @@ public struct FfiConverterTypeMilestonePage: FfiConverterRustBuffer {
return
try MilestonePage(
milestone: FfiConverterTypeMilestoneRow.read(from: &buf),
issues: FfiConverterSequenceTypeIssueRow.read(from: &buf)
issues: FfiConverterSequenceTypeIssueRow.read(from: &buf),
pulls: FfiConverterSequenceTypePullRow.read(from: &buf)
)
}
public static func write(_ value: MilestonePage, into buf: inout [UInt8]) {
FfiConverterTypeMilestoneRow.write(value.milestone, into: &buf)
FfiConverterSequenceTypeIssueRow.write(value.issues, into: &buf)
FfiConverterSequenceTypePullRow.write(value.pulls, into: &buf)
}
}
@@ -2102,6 +2146,60 @@ public func FfiConverterTypeMilestoneRow_lower(_ value: MilestoneRow) -> RustBuf
}
public struct PullFilterOptions: Equatable, Hashable {
public var milestones: [String]
public var selectedMilestone: String
// Default memberwise initializers are never public by default, so we
// declare one manually.
public init(milestones: [String], selectedMilestone: String) {
self.milestones = milestones
self.selectedMilestone = selectedMilestone
}
}
#if compiler(>=6)
extension PullFilterOptions: Sendable {}
#endif
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypePullFilterOptions: FfiConverterRustBuffer {
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PullFilterOptions {
return
try PullFilterOptions(
milestones: FfiConverterSequenceString.read(from: &buf),
selectedMilestone: FfiConverterString.read(from: &buf)
)
}
public static func write(_ value: PullFilterOptions, into buf: inout [UInt8]) {
FfiConverterSequenceString.write(value.milestones, into: &buf)
FfiConverterString.write(value.selectedMilestone, into: &buf)
}
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypePullFilterOptions_lift(_ buf: RustBuffer) throws -> PullFilterOptions {
return try FfiConverterTypePullFilterOptions.lift(buf)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypePullFilterOptions_lower(_ value: PullFilterOptions) -> RustBuffer {
return FfiConverterTypePullFilterOptions.lower(value)
}
public struct PullPage: Equatable, Hashable {
public var title: String
public var meta: String
@@ -3153,6 +3251,12 @@ private let initializationResult: InitializationResult = {
if (uniffi_gotcha_core_checksum_method_gotchacore_pull_diff() != 61384) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_pull_filters() != 10064) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_pull_filters_active() != 20260) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_pulls() != 13092) {
return InitializationResult.apiChecksumMismatch
}
@@ -3180,6 +3284,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_gotcha_core_checksum_method_gotchacore_set_issue_status() != 44445) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_set_pull_filters() != 39023) {
return InitializationResult.apiChecksumMismatch
}
if (uniffi_gotcha_core_checksum_method_gotchacore_set_pull_status() != 1356) {
return InitializationResult.apiChecksumMismatch
}

View File

@@ -334,6 +334,16 @@ uint64_t uniffi_gotcha_core_fn_method_gotchacore_pull(uint64_t ptr, RustBuffer o
uint64_t uniffi_gotcha_core_fn_method_gotchacore_pull_diff(uint64_t ptr, RustBuffer owner, RustBuffer repository, int64_t number, RustBuffer path
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_PULL_FILTERS
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_PULL_FILTERS
uint64_t uniffi_gotcha_core_fn_method_gotchacore_pull_filters(uint64_t ptr
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_PULL_FILTERS_ACTIVE
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_PULL_FILTERS_ACTIVE
int8_t uniffi_gotcha_core_fn_method_gotchacore_pull_filters_active(uint64_t ptr, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_PULLS
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_PULLS
uint64_t uniffi_gotcha_core_fn_method_gotchacore_pulls(uint64_t ptr
@@ -379,6 +389,11 @@ void uniffi_gotcha_core_fn_method_gotchacore_set_issue_filters(uint64_t ptr, Rus
void uniffi_gotcha_core_fn_method_gotchacore_set_issue_status(uint64_t ptr, RustBuffer status, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_SET_PULL_FILTERS
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_SET_PULL_FILTERS
void uniffi_gotcha_core_fn_method_gotchacore_set_pull_filters(uint64_t ptr, RustBuffer milestone, RustCallStatus *_Nonnull out_status
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_SET_PULL_STATUS
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_FN_METHOD_GOTCHACORE_SET_PULL_STATUS
void uniffi_gotcha_core_fn_method_gotchacore_set_pull_status(uint64_t ptr, RustBuffer status, RustCallStatus *_Nonnull out_status
@@ -747,6 +762,18 @@ uint16_t uniffi_gotcha_core_checksum_method_gotchacore_pull(void
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_PULL_DIFF
uint16_t uniffi_gotcha_core_checksum_method_gotchacore_pull_diff(void
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_PULL_FILTERS
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_PULL_FILTERS
uint16_t uniffi_gotcha_core_checksum_method_gotchacore_pull_filters(void
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_PULL_FILTERS_ACTIVE
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_PULL_FILTERS_ACTIVE
uint16_t uniffi_gotcha_core_checksum_method_gotchacore_pull_filters_active(void
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_PULLS
@@ -801,6 +828,12 @@ uint16_t uniffi_gotcha_core_checksum_method_gotchacore_set_issue_filters(void
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_SET_ISSUE_STATUS
uint16_t uniffi_gotcha_core_checksum_method_gotchacore_set_issue_status(void
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_SET_PULL_FILTERS
#define UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_SET_PULL_FILTERS
uint16_t uniffi_gotcha_core_checksum_method_gotchacore_set_pull_filters(void
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_GOTCHA_CORE_CHECKSUM_METHOD_GOTCHACORE_SET_PULL_STATUS