Local PR/Issue metadata + GitHub sync (extension module for mizchi/bit)
Dependencies
impl Show for ClaimActionpub struct ClaimMessage {
issue_id : String
action : ClaimAction
claimer : String
timestamp : Int64
} derive(Eq, Debug)impl Show for ClaimMessagefn ClaimMessage::new(issue_id : String, action : ClaimAction, claimer : String, timestamp : Int64) -> ClaimMessagepub struct GhComment {
id : Int
node_id : String
body : String
user : String
created_at : String
updated_at : String
}pub struct GhPullRequest {
number : Int
node_id : String
title : String
body : String
state : String
user : String
head_ref : String
head_repo : String
base_ref : String
labels : Array[String]
created_at : String
updated_at : String
merged : Bool
merged_at : String
}fn Hub::add_issue_comment(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, issue_id : String, author : String, body : String, reply_to? : String?) -> IssueComment raise GitErrorfn Hub::can_merge(self : Hub, objects : &ObjectStore, refs : &RefStore, pr_id : String) -> Bool raise GitErrorfn Hub::check_merge_policy(self : Hub, objects : &ObjectStore, refs : &RefStore, pr_id : String, policy : PrMergePolicy, signing_key? : String?) -> Unit raise GitErrorfn Hub::create_pr(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, title : String, body : String, source_branch : String, target_branch : String, author : String, source_repo? : String?, source_ref? : String?) -> PullRequest raise GitErrorfn Hub::find_sync_link_by_remote(self : Hub, objects : &ObjectStore, provider : String, repo : String, remote_number : Int) -> SyncLink?fn Hub::get_sync_link(self : Hub, objects : &ObjectStore, local_id : String, provider : String) -> SyncLink?fn Hub::import_issues(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, issues : Array[Issue]) -> ImportStats raise GitErrorfn Hub::import_pr_proposals(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, prs : Array[PullRequest]) -> ImportStats raise GitErrorfn Hub::import_prs(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, prs : Array[PullRequest]) -> ImportStats raise GitErrorfn Hub::init(objects : &ObjectStore, refs : &RefStore, node_id? : String, signing_key? : String?, require_signed? : Bool) -> Hub raise GitErrorfn Hub::list_issue_comments(self : Hub, objects : &ObjectStore, issue_id : String) -> Array[IssueComment]fn Hub::list_pr_workflows(self : Hub, objects : &ObjectStore, pr_id : String) -> Array[PrWorkflowResult]fn Hub::list_sub_issues(self : Hub, objects : &ObjectStore, parent_id : String, state? : IssueState?) -> Array[Issue]fn Hub::list_work_items(self : Hub, objects : &ObjectStore, state? : WorkItemState?, kind? : WorkItemKind?) -> Array[WorkItem]fn Hub::load(objects : &ObjectStore, refs : &RefStore, node_id? : String, signing_key? : String?, require_signed? : Bool) -> Hub raise GitErrorfn Hub::merge_pr(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, pr_id : String, merger : String, strategy? : PrMergeStrategy) -> PrMergeResult raise GitErrorfn Hub::propose_pr(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, title : String, body : String, source_branch : String, target_branch : String, author : String, source_repo? : String?, source_ref? : String?, closes_issues? : Array[String]) -> PullRequest raise GitErrorfn Hub::record_pr_workflow(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, pr_id : String, task : String, status : PrWorkflowStatus, workspace_fingerprint : String, author : String, txn_id? : String?, summary? : String) -> PrWorkflowResult raise GitErrorfn Hub::submit_review(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, pr_id : String, author : String, verdict : ReviewVerdict, body : String, commit_id : ObjectId) -> PrReview raise GitErrorfn Hub::update_pr(self : Hub, objects : &ObjectStore, refs : &RefStore, clock : &Clock, pr_id : String, title? : String?, body? : String?, labels? : Array[String]?) -> PullRequest raise GitErrorpub struct HubRecord {
version : Int
key : String
kind : String
clock : Map[String, Int64]
timestamp : Int64
node : String
deleted : Bool
signature : String?
payload : String
}fn HubStore::list_records(self : HubStore, objects : &ObjectStore, prefix : String, include_deleted? : Bool) -> Array[HubRecord]fn HubStore::load(objects : &ObjectStore, refs : &RefStore, node_id? : String, signing_key? : String?, require_signed? : Bool) -> HubStore raise GitErrorpub struct ImportStats {
created : Int
updated : Int
}pub struct Issue {
id : String
title : String
body : String
author : String
created_at : Int64
updated_at : Int64
state : IssueState
labels : Array[String]
assignees : Array[String]
linked_prs : Array[String]
linked_issues : Array[String]
parent_id : String?
blocked_by : Array[String]
blocking : Array[String]
}fn Issue::new(id : String, title : String, body : String, author : String, created_at : Int64, updated_at : Int64, state : IssueState, labels? : Array[String], assignees? : Array[String], linked_prs? : Array[String], linked_issues? : Array[String], parent_id? : String?, blocked_by? : Array[String], blocking? : Array[String]) -> Issuepub struct IssueComment {
id : String
issue_id : String
author : String
body : String
created_at : Int64
reply_to : String?
}fn IssueComment::new(id : String, issue_id : String, author : String, body : String, created_at : Int64, reply_to? : String?) -> IssueCommentpub struct NodeHeartbeat {
node_id : String
commit_count : Int
main_tip : String
timestamp : Int64
clock : Map[String, Int64]
}pub struct Note {
commit_id : ObjectId
body : String
author : String
created_at : Int64
ns : String
}pub struct PrComment {
id : String
pr_id : String
author : String
body : String
created_at : Int64
reply_to : String?
file_path : String?
line_number : Int?
commit_id : ObjectId?
}pub struct PrMergePolicy {
required_approvals : Int
allow_request_changes : Bool
require_signed_records : Bool
required_workflows : Array[String]
}fn PrMergePolicy::new(required_approvals : Int, allow_request_changes : Bool, require_signed_records : Bool, required_workflows? : Array[String]) -> PrMergePolicypub struct PrReview {
id : String
pr_id : String
author : String
verdict : ReviewVerdict
body : String
created_at : Int64
commit_id : ObjectId
}fn PrReview::new(id : String, pr_id : String, author : String, verdict : ReviewVerdict, body : String, created_at : Int64, commit_id : ObjectId) -> PrReviewfn PrSyncResult::new(success : Bool, message : String, local_commit : ObjectId?, remote_commit : ObjectId?) -> PrSyncResultpub struct PrWorkflowResult {
pr_id : String
task : String
status : PrWorkflowStatus
workspace_fingerprint : String
txn_id : String?
author : String
updated_at : Int64
summary : String
}fn PrWorkflowResult::new(pr_id : String, task : String, status : PrWorkflowStatus, workspace_fingerprint : String, author : String, updated_at : Int64, txn_id? : String?, summary? : String) -> PrWorkflowResultimpl Show for PrWorkflowStatuspub struct PullRequest {
id : String
title : String
body : String
source_branch : String
source_repo : String?
source_ref : String?
source_commit : ObjectId
target_branch : String
target_commit : ObjectId
author : String
created_at : Int64
updated_at : Int64
state : PrState
labels : Array[String]
closes_issues : Array[String]
merge_commit : ObjectId?
}fn PullRequest::new(id : String, title : String, body : String, source_branch : String, source_commit : ObjectId, target_branch : String, target_commit : ObjectId, author : String, created_at : Int64, updated_at : Int64, state : PrState, labels : Array[String], closes_issues? : Array[String], merge_commit? : ObjectId?, source_repo? : String?, source_ref? : String?) -> PullRequestimpl Show for RecordTriggerClassimpl Show for ReviewVerdictpub struct SyncDiff {
title_changed : Bool
body_changed : Bool
state_changed : Bool
labels_changed : Bool
assignees_changed : Bool
has_changes : Bool
}pub struct SyncLink {
local_id : String
local_kind : String
provider : String
repo : String
remote_number : Int
remote_node_id : String
last_pull_at : Int64
last_push_at : Int64
remote_updated_at : Int64
}pub struct WorkItem {
id : String
title : String
body : String
author : String
created_at : Int64
updated_at : Int64
state : WorkItemState
labels : Array[String]
assignees : Array[String]
linked_prs : Array[String]
linked_issues : Array[String]
patch : WorkItemPatch?
parent_id : String?
blocked_by : Array[String]
blocking : Array[String]
}fn WorkItem::new(id : String, title : String, body : String, author : String, created_at : Int64, updated_at : Int64, state : WorkItemState, labels? : Array[String], assignees? : Array[String], linked_prs? : Array[String], linked_issues? : Array[String], patch? : WorkItemPatch?, parent_id? : String?, blocked_by? : Array[String], blocking? : Array[String]) -> WorkItemimpl Show for WorkItemKindfn WorkItemPatch::new(source_branch : String, source_commit : ObjectId, target_branch : String, target_commit : ObjectId, closes_issues? : Array[String], merge_commit? : ObjectId?, source_repo? : String?, source_ref? : String?) -> WorkItemPatchimpl Show for WorkItemStatefn merge_notes_commits(prs : Hub, fs : &FileSystem, git_dir : String, objects : &ObjectStore, refs : &RefStore, local_id : ObjectId, remote_id : ObjectId, conflict_policy? : RecordMergePolicy) -> PrSyncResult raise GitErrorfn merge_record_bytes_with_policy(ours : Bytes, theirs : Bytes, conflict_policy : RecordMergePolicy) -> Bytesfn parse_iso8601_to_unix(iso_str : String) -> Int64fn unix_to_iso8601(unix : Int64) -> Stringfn write_object_bytes(fs : &FileSystem, git_dir : String, id : ObjectId, compressed : Bytes) -> Unit raise GitErrorLocal PR/Issue metadata + GitHub sync (extension module for mizchi/bit)
Dependencies