bitx_hub

    Local PR/Issue metadata + GitHub sync (extension module for mizchi/bit)

    git
    hub
    pr
    issue
    Download zip
    Author
    Version
    0.48.0
    License
    Apache-2.0
    Last updated
    9 days ago
    Downloads
    129

    PrError

    pub(all) suberror PrError {
    NotFound(String)
    InvalidFormat(String)
    InvalidState(String)
    MergeConflict(Array[String])
    } derive(Eq,
    Debug
    )

    PR operation error

    ClaimAction

    pub(all) enum ClaimAction {
    Claim
    Unclaim
    } derive(Eq,
    Debug
    )

    impl Show for ClaimAction

    ClaimAction::to_string

    fn ClaimAction::to_string(self : ClaimAction) -> String

    ClaimMessage

    pub struct ClaimMessage {
    issue_id : String
    action : ClaimAction
    claimer : String
    timestamp : Int64
    } derive(Eq,
    Debug
    )

    ClaimMessage::action

    fn ClaimMessage::action(self : ClaimMessage) -> ClaimAction

    ClaimMessage::claimer

    fn ClaimMessage::claimer(self : ClaimMessage) -> String

    ClaimMessage::is_stale

    fn ClaimMessage::is_stale(self : ClaimMessage, now : Int64, threshold_hours? : Int) -> Bool

    Check if a claim is stale based on the threshold.

    ClaimMessage::issue_id

    fn ClaimMessage::issue_id(self : ClaimMessage) -> String

    ClaimMessage::new

    fn ClaimMessage::new(issue_id : String, action : ClaimAction, claimer : String, timestamp : Int64) -> ClaimMessage

    ClaimMessage::timestamp

    fn ClaimMessage::timestamp(self : ClaimMessage) -> Int64

    ClaimMessage::to_json

    fn ClaimMessage::to_json(self : ClaimMessage) -> Json

    GhComment

    pub struct GhComment {
    id : Int
    node_id : String
    body : String
    user : String
    created_at : String
    updated_at : String
    }

    GitHub Comment from REST API

    GhComment::from_json

    fn GhComment::from_json(obj : Map[String, Json]) -> GhComment

    GhIssue

    pub struct GhIssue {
    number : Int
    node_id : String
    title : String
    body : String
    state : String
    user : String
    labels : Array[String]
    assignees : Array[String]
    created_at : String
    updated_at : String
    }

    GitHub Issue from REST API

    GhIssue::from_json

    fn GhIssue::from_json(obj : Map[String, Json]) -> GhIssue

    GhPullRequest

    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
    }

    GitHub Pull Request from REST API

    GhPullRequest::from_json

    fn GhPullRequest::from_json(obj : Map[String, Json]) -> GhPullRequest

    Hub

    pub struct Hub {
    store : HubStore
    }

    Hub manages Pull Requests and Issues stored in git notes

    Hub::add_comment

    fn Hub::add_comment(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , pr_id : String, author : String, body : String, reply_to? : String?, file_path? : String?, line_number? : Int?, commit_id? :
    ObjectId
    ?) -> PrComment raise
    GitError

    Add a comment to a Pull Request

    Hub::add_dep

    fn Hub::add_dep(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , source_id : String, target_id : String) -> Unit raise
    GitError

    Add a dependency relationship between two issues. source_id is blocked by target_id. Both issues are updated in separate put_record calls.

    Hub::add_issue_comment

    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
    GitError

    Add a comment to an Issue

    Hub::add_note

    fn Hub::add_note(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , commit_id :
    ObjectId
    , body : String, author : String, timestamp : Int64, ns? : String) -> Note raise
    GitError

    Add a note to a commit (Git compatible)

    Hub::add_note_plain

    fn Hub::add_note_plain(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , commit_id :
    ObjectId
    , body : String, ns? : String) -> Unit raise
    GitError

    Add a plain note (Git standard, no metadata)

    Hub::broadcast_feature

    fn Hub::broadcast_feature(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , branch_name : String, tip_commit : String, author : String, summary? : String, closes_issues? : Array[String], session_url? : String?) -> Unit raise
    GitError

    Broadcast a feature completion notification (notify-only record)

    Hub::can_merge

    fn Hub::can_merge(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , pr_id : String) -> Bool raise
    GitError

    Check if a PR can be merged (no conflicts, PR is open)

    Hub::check_merge_policy

    fn Hub::check_merge_policy(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , pr_id : String, policy : PrMergePolicy, signing_key? : String?) -> Unit raise
    GitError

    Hub::close_issue

    fn Hub::close_issue(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , issue_id : String) -> Unit raise
    GitError

    Close an Issue

    Hub::close_pr

    Close a Pull Request

    Hub::create_issue

    fn Hub::create_issue(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , title : String, body : String, author : String, labels? : Array[String], assignees? : Array[String], parent_id? : String?) -> Issue raise
    GitError

    Create a new Issue

    Hub::create_pr

    fn 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
    GitError

    Create a new Pull Request

    Hub::delete_issue_comment

    fn Hub::delete_issue_comment(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , issue_id : String, comment_id : String) -> Unit raise
    GitError

    Delete a comment from an Issue

    Hub::find_canonical_node

    fn Hub::find_canonical_node(self : Hub, objects : &
    ObjectStore
    ) -> String?

    Determine the canonical node from heartbeat records. Returns the node_id of the most active node (highest vector clock, then highest commit count).
    fn Hub::find_sync_link_by_remote(self : Hub, objects : &
    ObjectStore
    , provider : String, repo : String, remote_number : Int) -> SyncLink?

    Find a SyncLink by provider, repo, and remote number

    Hub::get_issue

    fn Hub::get_issue(self : Hub, objects : &
    ObjectStore
    , issue_id : String) -> Issue?

    Get an Issue by ID

    Hub::get_note

    Get a note for a commit

    Hub::get_pr

    fn Hub::get_pr(self : Hub, objects : &
    ObjectStore
    , pr_id : String) -> PullRequest?

    Get a Pull Request by ID
    fn Hub::get_sync_link(self : Hub, objects : &
    ObjectStore
    , local_id : String, provider : String) -> SyncLink?

    Retrieve a SyncLink by local_id and provider

    Hub::get_work_item

    fn Hub::get_work_item(self : Hub, objects : &
    ObjectStore
    , work_item_id : String) -> WorkItem?

    Hub::init

    fn Hub::init(objects : &
    ObjectStore
    , refs : &
    RefStore
    , node_id? : String, signing_key? : String?, require_signed? : Bool) -> Hub raise
    GitError

    Initialize a new Hub

    Hub::is_approved

    fn Hub::is_approved(self : Hub, objects : &
    ObjectStore
    , pr_id : String) -> Bool

    Check if a PR is approved (has at least one Approved review with no RequestChanges after it)
    fn Hub::link_issue(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , issue_id : String, target_ref : String) -> Unit raise
    GitError

    Link a cross-repo issue reference to an Issue
    fn Hub::link_pr_to_issue(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , issue_id : String, pr_id : String) -> Unit raise
    GitError

    Link a PR to an Issue

    Hub::list_comments

    fn Hub::list_comments(self : Hub, objects : &
    ObjectStore
    , pr_id : String) -> Array[PrComment]

    List comments for a Pull Request

    Hub::list_feature_broadcasts

    fn Hub::list_feature_broadcasts(self : Hub, objects : &
    ObjectStore
    ) -> Array[HubRecord]

    List feature broadcast records

    Hub::list_issue_comments

    fn Hub::list_issue_comments(self : Hub, objects : &
    ObjectStore
    , issue_id : String) -> Array[IssueComment]

    List comments for an Issue

    Hub::list_issues

    fn Hub::list_issues(self : Hub, objects : &
    ObjectStore
    , state? : IssueState?) -> Array[Issue]

    List Issues, optionally filtered by state

    Hub::list_node_heartbeats

    fn Hub::list_node_heartbeats(self : Hub, objects : &
    ObjectStore
    ) -> Array[NodeHeartbeat]

    List all node heartbeats and determine which node is canonical. The canonical node is the one with the highest vector clock.

    Hub::list_notes

    List all notes in a ns

    Hub::list_pr_proposals

    fn Hub::list_pr_proposals(self : Hub, objects : &
    ObjectStore
    ) -> Array[PullRequest]

    Hub::list_pr_workflows

    fn Hub::list_pr_workflows(self : Hub, objects : &
    ObjectStore
    , pr_id : String) -> Array[PrWorkflowResult]

    Hub::list_prs

    fn Hub::list_prs(self : Hub, objects : &
    ObjectStore
    , state? : PrState?) -> Array[PullRequest]

    List Pull Requests, optionally filtered by state

    Hub::list_reviews

    fn Hub::list_reviews(self : Hub, objects : &
    ObjectStore
    , pr_id : String) -> Array[PrReview]

    List reviews for a Pull Request

    Hub::list_sub_issues

    fn Hub::list_sub_issues(self : Hub, objects : &
    ObjectStore
    , parent_id : String, state? : IssueState?) -> Array[Issue]

    List sub-issues of a parent issue
    fn Hub::list_sync_links(self : Hub, objects : &
    ObjectStore
    , repo? : String) -> Array[SyncLink]

    List all SyncLinks, optionally filtered by repo

    Hub::list_work_items

    fn Hub::list_work_items(self : Hub, objects : &
    ObjectStore
    , state? : WorkItemState?, kind? : WorkItemKind?) -> Array[WorkItem]

    Hub::load

    fn Hub::load(objects : &
    ObjectStore
    , refs : &
    RefStore
    , node_id? : String, signing_key? : String?, require_signed? : Bool) -> Hub raise
    GitError

    Load an existing Hub from git notes

    Hub::merge_pr

    fn Hub::merge_pr(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , pr_id : String, merger : String, strategy? : PrMergeStrategy) -> PrMergeResult raise
    GitError

    Merge a Pull Request

    Hub::propose_pr

    fn 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
    GitError

    Create a PR proposal record (notify-only event stream)

    Hub::publish_node_heartbeat

    fn Hub::publish_node_heartbeat(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , node_id : String, commit_count? : Int, main_tip? : String) -> Unit raise
    GitError

    Publish node heartbeat record for canonical node election. Each node periodically publishes its metadata (commit count, last update time).

    Store a SyncLink as a hub record

    Hub::record_pr_workflow

    fn 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
    GitError

    Hub::reload_store

    Reload store from current object/ref state

    Hub::remove_dep

    fn Hub::remove_dep(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , source_id : String, target_id : String) -> Unit raise
    GitError

    Remove a dependency relationship between two issues. source_id is no longer blocked by target_id.

    Hub::remove_note

    Remove a note from a commit

    Hub::reopen_issue

    fn Hub::reopen_issue(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , issue_id : String) -> Unit raise
    GitError

    Reopen a closed Issue

    Hub::reopen_pr

    Reopen a closed Pull Request

    Hub::submit_review

    fn 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
    GitError

    Submit a review for a Pull Request

    Hub::update_issue

    fn Hub::update_issue(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , issue_id : String, title? : String?, body? : String?, labels? : Array[String]?, assignees? : Array[String]?) -> Issue raise
    GitError

    Update an Issue (title, body, labels, assignees)

    Hub::update_issue_comment

    fn Hub::update_issue_comment(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , issue_id : String, comment_id : String, body : String, author : String) -> Unit raise
    GitError

    Update an existing comment on an Issue (replace body, keep id/timestamps)

    Hub::update_pr

    fn Hub::update_pr(self : Hub, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , pr_id : String, title? : String?, body? : String?, labels? : Array[String]?) -> PullRequest raise
    GitError

    Update a Pull Request (title, body, labels)

    HubRecord

    pub struct HubRecord {
    version : Int
    key : String
    kind : String
    clock : Map[String, Int64]
    timestamp : Int64
    node : String
    deleted : Bool
    signature : String?
    payload : String
    }

    HubRecord::new

    fn HubRecord::new(key : String, kind : String, payload : String, node : String, timestamp : Int64, clock? : Map[String, Int64], deleted? : Bool, version? : Int, signature? : String?) -> HubRecord

    HubRecord::serialize

    fn HubRecord::serialize(self : HubRecord) -> String

    HubStore

    pub struct HubStore {
    node_id : String
    signing_key : String?
    require_signed : Bool
    entries : Map[String,
    ObjectId
    ]
    head :
    ObjectId
    ?
    }

    HubStore::delete_record

    fn HubStore::delete_record(self : HubStore, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , key : String, kind : String, node : String) -> HubRecord raise
    GitError

    HubStore::get_record

    fn HubStore::get_record(self : HubStore, objects : &
    ObjectStore
    , key : String) -> HubRecord?

    HubStore::list_records

    fn HubStore::list_records(self : HubStore, objects : &
    ObjectStore
    , prefix : String, include_deleted? : Bool) -> Array[HubRecord]

    HubStore::load

    fn HubStore::load(objects : &
    ObjectStore
    , refs : &
    RefStore
    , node_id? : String, signing_key? : String?, require_signed? : Bool) -> HubStore raise
    GitError

    HubStore::node_id

    fn HubStore::node_id(self : HubStore) -> String

    HubStore::put_record

    fn HubStore::put_record(self : HubStore, objects : &
    ObjectStore
    , refs : &
    RefStore
    , clock : &
    Clock
    , key : String, kind : String, payload : String, node : String) -> HubRecord raise
    GitError

    HubStore::require_signed

    fn HubStore::require_signed(self : HubStore) -> Bool

    HubStore::signing_key

    fn HubStore::signing_key(self : HubStore) -> String?

    ImportStats

    pub struct ImportStats {
    created : Int
    updated : Int
    }

    ImportStats::created

    fn ImportStats::created(self : ImportStats) -> Int

    ImportStats::new

    fn ImportStats::new(created : Int, updated : Int) -> ImportStats

    ImportStats::updated

    fn ImportStats::updated(self : ImportStats) -> Int

    Issue

    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]
    }

    Issue data

    Issue::assignees

    fn Issue::assignees(self : Issue) -> Array[String]

    Issue::author

    fn Issue::author(self : Issue) -> String

    Issue::blocked_by

    fn Issue::blocked_by(self : Issue) -> Array[String]

    Issue::blocking

    fn Issue::blocking(self : Issue) -> Array[String]

    Issue::body

    fn Issue::body(self : Issue) -> String

    Issue::created_at

    fn Issue::created_at(self : Issue) -> Int64

    Issue::id

    fn Issue::id(self : Issue) -> String

    Issue::labels

    fn Issue::labels(self : Issue) -> Array[String]

    Issue::linked_issues

    fn Issue::linked_issues(self : Issue) -> Array[String]

    Issue::linked_prs

    fn Issue::linked_prs(self : Issue) -> Array[String]

    Issue::new

    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]) -> Issue

    Issue::serialize

    fn Issue::serialize(self : Issue) -> String

    Serialize Issue to Git-style text format

    Issue::state

    fn Issue::state(self : Issue) -> IssueState

    Issue::title

    fn Issue::title(self : Issue) -> String

    Issue::to_work_item

    fn Issue::to_work_item(self : Issue) -> WorkItem

    Issue::updated_at

    fn Issue::updated_at(self : Issue) -> Int64

    IssueComment

    pub struct IssueComment {
    id : String
    issue_id : String
    author : String
    body : String
    created_at : Int64
    reply_to : String?
    }

    Comment on an Issue

    IssueComment::author

    fn IssueComment::author(self : IssueComment) -> String

    IssueComment::body

    fn IssueComment::body(self : IssueComment) -> String

    IssueComment::created_at

    fn IssueComment::created_at(self : IssueComment) -> Int64

    IssueComment::id

    fn IssueComment::id(self : IssueComment) -> String

    IssueComment::issue_id

    fn IssueComment::issue_id(self : IssueComment) -> String

    IssueComment::new

    fn IssueComment::new(id : String, issue_id : String, author : String, body : String, created_at : Int64, reply_to? : String?) -> IssueComment

    IssueComment::reply_to

    fn IssueComment::reply_to(self : IssueComment) -> String?

    IssueComment::serialize

    fn IssueComment::serialize(self : IssueComment) -> String

    Serialize IssueComment to Git-style text format

    IssueState

    pub(all) enum IssueState {
    Open
    Closed
    } derive(Eq,
    Debug
    )

    State of an Issue
    impl Show for IssueState

    IssueState::to_string

    fn IssueState::to_string(self : IssueState) -> String

    IssueState::to_work_item_state

    fn IssueState::to_work_item_state(self : IssueState) -> WorkItemState

    NodeHeartbeat

    pub struct NodeHeartbeat {
    node_id : String
    commit_count : Int
    main_tip : String
    timestamp : Int64
    clock : Map[String, Int64]
    }

    Node metadata extracted from heartbeat records

    Note

    pub struct Note {
    commit_id :
    ObjectId

    body : String
    author : String
    created_at : Int64
    ns : String
    }

    Note attached to a commit (Git notes compatible)

    Note::author

    fn Note::author(self : Note) -> String

    Note::body

    fn Note::body(self : Note) -> String

    Note::commit_id

    Note::created_at

    fn Note::created_at(self : Note) -> Int64

    Note::new

    fn Note::new(commit_id :
    ObjectId
    , body : String, author : String, created_at : Int64, ns? : String) -> Note

    Note::ns

    fn Note::ns(self : Note) -> String

    Note::serialize

    fn Note::serialize(self : Note) -> String

    Serialize Note to Git-style text format Note: Git standard notes are plain text, but we add metadata for Hub

    Note::serialize_plain

    fn Note::serialize_plain(self : Note) -> String

    Serialize Note as plain text (Git compatible, no metadata)

    PrComment

    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
    ?
    }

    Comment on a Pull Request

    PrComment::author

    fn PrComment::author(self : PrComment) -> String

    PrComment::body

    fn PrComment::body(self : PrComment) -> String

    PrComment::commit_id

    PrComment::created_at

    fn PrComment::created_at(self : PrComment) -> Int64

    PrComment::file_path

    fn PrComment::file_path(self : PrComment) -> String?

    PrComment::id

    fn PrComment::id(self : PrComment) -> String

    PrComment::line_number

    fn PrComment::line_number(self : PrComment) -> Int?

    PrComment::new

    fn PrComment::new(id : String, pr_id : String, author : String, body : String, created_at : Int64, reply_to? : String?, file_path? : String?, line_number? : Int?, commit_id? :
    ObjectId
    ?) -> PrComment

    PrComment::pr_id

    fn PrComment::pr_id(self : PrComment) -> String

    PrComment::reply_to

    fn PrComment::reply_to(self : PrComment) -> String?

    PrComment::serialize

    fn PrComment::serialize(self : PrComment) -> String

    Serialize PrComment to Git-style text format

    PrMergePolicy

    pub struct PrMergePolicy {
    required_approvals : Int
    allow_request_changes : Bool
    require_signed_records : Bool
    required_workflows : Array[String]
    }

    PrMergePolicy::allow_request_changes

    fn PrMergePolicy::allow_request_changes(self : PrMergePolicy) -> Bool

    PrMergePolicy::default

    fn PrMergePolicy::default() -> PrMergePolicy

    PrMergePolicy::new

    fn PrMergePolicy::new(required_approvals : Int, allow_request_changes : Bool, require_signed_records : Bool, required_workflows? : Array[String]) -> PrMergePolicy

    PrMergePolicy::require_signed_records

    fn PrMergePolicy::require_signed_records(self : PrMergePolicy) -> Bool

    PrMergePolicy::required_approvals

    fn PrMergePolicy::required_approvals(self : PrMergePolicy) -> Int

    PrMergePolicy::required_workflows

    fn PrMergePolicy::required_workflows(self : PrMergePolicy) -> Array[String]

    PrMergeResult

    pub struct PrMergeResult {
    success : Bool
    commit_id :
    ObjectId
    ?
    conflicts : Array[String]
    message : String
    }

    PrMergeResult::commit_id

    PrMergeResult::conflicts

    fn PrMergeResult::conflicts(self : PrMergeResult) -> Array[String]

    PrMergeResult::message

    fn PrMergeResult::message(self : PrMergeResult) -> String

    PrMergeResult::success

    fn PrMergeResult::success(self : PrMergeResult) -> Bool

    PrMergeStrategy

    pub(all) enum PrMergeStrategy {
    Merge
    Squash
    FastForward
    }

    PrReview

    pub struct PrReview {
    id : String
    pr_id : String
    author : String
    verdict : ReviewVerdict
    body : String
    created_at : Int64
    commit_id :
    ObjectId

    }

    Review on a Pull Request

    PrReview::author

    fn PrReview::author(self : PrReview) -> String

    PrReview::body

    fn PrReview::body(self : PrReview) -> String

    PrReview::commit_id

    PrReview::created_at

    fn PrReview::created_at(self : PrReview) -> Int64

    PrReview::id

    fn PrReview::id(self : PrReview) -> String

    PrReview::new

    fn PrReview::new(id : String, pr_id : String, author : String, verdict : ReviewVerdict, body : String, created_at : Int64, commit_id :
    ObjectId
    ) -> PrReview

    PrReview::pr_id

    fn PrReview::pr_id(self : PrReview) -> String

    PrReview::serialize

    fn PrReview::serialize(self : PrReview) -> String

    Serialize PrReview to Git-style text format

    PrReview::verdict

    fn PrReview::verdict(self : PrReview) -> ReviewVerdict

    PrState

    pub(all) enum PrState {
    Open
    Merged
    Closed
    } derive(Eq,
    Debug
    )

    State of a Pull Request
    impl Show for PrState

    PrState::to_string

    fn PrState::to_string(self : PrState) -> String

    PrState::to_work_item_state

    fn PrState::to_work_item_state(self : PrState) -> WorkItemState

    PrSyncResult

    pub struct PrSyncResult {
    success : Bool
    message : String
    local_commit :
    ObjectId
    ?
    remote_commit :
    ObjectId
    ?
    }

    PrSyncResult::local_commit

    PrSyncResult::message

    fn PrSyncResult::message(self : PrSyncResult) -> String

    PrSyncResult::new

    fn PrSyncResult::new(success : Bool, message : String, local_commit :
    ObjectId
    ?, remote_commit :
    ObjectId
    ?) -> PrSyncResult

    PrSyncResult::remote_commit

    PrSyncResult::success

    fn PrSyncResult::success(self : PrSyncResult) -> Bool

    PrWorkflowResult

    pub struct PrWorkflowResult {
    pr_id : String
    task : String
    status : PrWorkflowStatus
    workspace_fingerprint : String
    txn_id : String?
    author : String
    updated_at : Int64
    summary : String
    }

    PrWorkflowResult::author

    fn PrWorkflowResult::author(self : PrWorkflowResult) -> String

    PrWorkflowResult::new

    fn PrWorkflowResult::new(pr_id : String, task : String, status : PrWorkflowStatus, workspace_fingerprint : String, author : String, updated_at : Int64, txn_id? : String?, summary? : String) -> PrWorkflowResult

    PrWorkflowResult::pr_id

    fn PrWorkflowResult::pr_id(self : PrWorkflowResult) -> String

    PrWorkflowResult::serialize

    fn PrWorkflowResult::serialize(self : PrWorkflowResult) -> String

    PrWorkflowResult::status

    PrWorkflowResult::summary

    fn PrWorkflowResult::summary(self : PrWorkflowResult) -> String

    PrWorkflowResult::task

    fn PrWorkflowResult::task(self : PrWorkflowResult) -> String

    PrWorkflowResult::txn_id

    fn PrWorkflowResult::txn_id(self : PrWorkflowResult) -> String?

    PrWorkflowResult::updated_at

    fn PrWorkflowResult::updated_at(self : PrWorkflowResult) -> Int64

    PrWorkflowResult::workspace_fingerprint

    fn PrWorkflowResult::workspace_fingerprint(self : PrWorkflowResult) -> String

    PrWorkflowStatus

    pub(all) enum PrWorkflowStatus {
    Pending
    Running
    Success
    Failed
    } derive(Eq,
    Debug
    )

    PrWorkflowStatus::to_string

    fn PrWorkflowStatus::to_string(self : PrWorkflowStatus) -> String

    PullRequest

    pub 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
    ?
    }

    Pull Request data

    PullRequest::author

    fn PullRequest::author(self : PullRequest) -> String

    PullRequest::body

    fn PullRequest::body(self : PullRequest) -> String

    PullRequest::closes_issues

    fn PullRequest::closes_issues(self : PullRequest) -> Array[String]

    PullRequest::created_at

    fn PullRequest::created_at(self : PullRequest) -> Int64

    PullRequest::id

    fn PullRequest::id(self : PullRequest) -> String

    PullRequest::labels

    fn PullRequest::labels(self : PullRequest) -> Array[String]

    PullRequest::merge_commit

    PullRequest::new

    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?) -> PullRequest

    PullRequest::serialize

    fn PullRequest::serialize(self : PullRequest) -> String

    Serialize PullRequest to Git-style text format

    PullRequest::source_branch

    fn PullRequest::source_branch(self : PullRequest) -> String

    PullRequest::source_commit

    PullRequest::source_ref

    fn PullRequest::source_ref(self : PullRequest) -> String?

    PullRequest::source_repo

    fn PullRequest::source_repo(self : PullRequest) -> String?

    PullRequest::state

    fn PullRequest::state(self : PullRequest) -> PrState

    PullRequest::target_branch

    fn PullRequest::target_branch(self : PullRequest) -> String

    PullRequest::target_commit

    PullRequest::title

    fn PullRequest::title(self : PullRequest) -> String

    PullRequest::to_work_item

    fn PullRequest::to_work_item(self : PullRequest) -> WorkItem

    PullRequest::updated_at

    fn PullRequest::updated_at(self : PullRequest) -> Int64

    RecordMergePolicy

    pub enum RecordMergePolicy {
    Lww
    TombstoneWins
    }

    RecordTriggerClass

    pub(all) enum RecordTriggerClass {
    Full
    NotifyOnly
    } derive(Eq,
    Debug
    )

    ReviewVerdict

    pub(all) enum ReviewVerdict {
    Approved
    RequestChanges
    Comment
    } derive(Eq,
    Debug
    )

    Review verdict

    ReviewVerdict::to_string

    fn ReviewVerdict::to_string(self : ReviewVerdict) -> String

    SyncDiff

    pub struct SyncDiff {
    title_changed : Bool
    body_changed : Bool
    state_changed : Bool
    labels_changed : Bool
    assignees_changed : Bool
    has_changes : Bool
    }

    Describes what changed between a local Issue and a GitHub GhIssue
    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
    }

    Tracks the mapping between a local bit work item and a remote GitHub issue/PR

    SyncLink::last_pull_at

    fn SyncLink::last_pull_at(self : SyncLink) -> Int64

    SyncLink::last_push_at

    fn SyncLink::last_push_at(self : SyncLink) -> Int64

    SyncLink::local_id

    fn SyncLink::local_id(self : SyncLink) -> String

    SyncLink::local_kind

    fn SyncLink::local_kind(self : SyncLink) -> String

    SyncLink::new

    fn SyncLink::new(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) -> SyncLink

    SyncLink::provider

    fn SyncLink::provider(self : SyncLink) -> String

    SyncLink::remote_node_id

    fn SyncLink::remote_node_id(self : SyncLink) -> String

    SyncLink::remote_number

    fn SyncLink::remote_number(self : SyncLink) -> Int

    SyncLink::remote_updated_at

    fn SyncLink::remote_updated_at(self : SyncLink) -> Int64

    SyncLink::repo

    fn SyncLink::repo(self : SyncLink) -> String

    SyncLink::serialize

    fn SyncLink::serialize(self : SyncLink) -> String

    Serialize SyncLink to Git-style text format

    WorkItem

    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]
    }

    Unified work item view of issue and pull request

    WorkItem::assignees

    fn WorkItem::assignees(self : WorkItem) -> Array[String]

    WorkItem::author

    fn WorkItem::author(self : WorkItem) -> String

    WorkItem::blocked_by

    fn WorkItem::blocked_by(self : WorkItem) -> Array[String]

    WorkItem::blocking

    fn WorkItem::blocking(self : WorkItem) -> Array[String]

    WorkItem::body

    fn WorkItem::body(self : WorkItem) -> String

    WorkItem::created_at

    fn WorkItem::created_at(self : WorkItem) -> Int64

    WorkItem::id

    fn WorkItem::id(self : WorkItem) -> String

    WorkItem::kind

    fn WorkItem::kind(self : WorkItem) -> WorkItemKind

    WorkItem::labels

    fn WorkItem::labels(self : WorkItem) -> Array[String]

    WorkItem::linked_issues

    fn WorkItem::linked_issues(self : WorkItem) -> Array[String]

    WorkItem::linked_prs

    fn WorkItem::linked_prs(self : WorkItem) -> Array[String]

    WorkItem::new

    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]) -> WorkItem

    WorkItem::patch

    fn WorkItem::patch(self : WorkItem) -> WorkItemPatch?

    WorkItem::serialize

    fn WorkItem::serialize(self : WorkItem) -> String

    Serialize WorkItem to Git-style text format

    WorkItem::state

    fn WorkItem::state(self : WorkItem) -> WorkItemState

    WorkItem::title

    fn WorkItem::title(self : WorkItem) -> String

    WorkItem::to_issue

    fn WorkItem::to_issue(self : WorkItem) -> Issue?

    WorkItem::to_pull_request

    fn WorkItem::to_pull_request(self : WorkItem) -> PullRequest?

    WorkItem::updated_at

    fn WorkItem::updated_at(self : WorkItem) -> Int64

    WorkItemKind

    pub(all) enum WorkItemKind {
    Issue
    PullRequest
    } derive(Eq,
    Debug
    )

    Work item kind

    WorkItemKind::to_string

    fn WorkItemKind::to_string(self : WorkItemKind) -> String

    WorkItemPatch

    pub struct WorkItemPatch {
    source_branch : String
    source_repo : String?
    source_ref : String?
    source_commit :
    ObjectId

    target_branch : String
    target_commit :
    ObjectId

    closes_issues : Array[String]
    merge_commit :
    ObjectId
    ?
    }

    Patch capability of a work item

    WorkItemPatch::closes_issues

    fn WorkItemPatch::closes_issues(self : WorkItemPatch) -> Array[String]

    WorkItemPatch::merge_commit

    WorkItemPatch::new

    fn 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?) -> WorkItemPatch

    WorkItemPatch::source_branch

    fn WorkItemPatch::source_branch(self : WorkItemPatch) -> String

    WorkItemPatch::source_commit

    WorkItemPatch::source_ref

    fn WorkItemPatch::source_ref(self : WorkItemPatch) -> String?

    WorkItemPatch::source_repo

    fn WorkItemPatch::source_repo(self : WorkItemPatch) -> String?

    WorkItemPatch::target_branch

    fn WorkItemPatch::target_branch(self : WorkItemPatch) -> String

    WorkItemPatch::target_commit

    WorkItemState

    pub(all) enum WorkItemState {
    Open
    Merged
    Closed
    } derive(Eq,
    Debug
    )

    Unified state of an Issue/PullRequest work item

    WorkItemState::to_issue_state

    fn WorkItemState::to_issue_state(self : WorkItemState) -> IssueState?

    WorkItemState::to_pr_state

    fn WorkItemState::to_pr_state(self : WorkItemState) -> PrState

    WorkItemState::to_string

    fn WorkItemState::to_string(self : WorkItemState) -> String

    canonical_work_item_record_kind

    fn canonical_work_item_record_kind() -> String

    claim_topic

    fn claim_topic() -> String

    Topic string for claim messages.

    classify_record_trigger

    fn classify_record_trigger(record : HubRecord) -> RecordTriggerClass

    compare_vector_clocks

    fn compare_vector_clocks(a : Map[String, Int64], b : Map[String, Int64]) -> Int

    Compare two vector clocks. Returns 1 if a > b, -1 if b > a, 0 if concurrent.

    default_record_merge_policy

    fn default_record_merge_policy() -> RecordMergePolicy

    find_remote_notes_ref

    fn find_remote_notes_ref(refs : Array[(
    ObjectId
    , String)]) -> (
    ObjectId
    , String)

    find_upload_notes_ref

    fn find_upload_notes_ref(refs : Array[(
    ObjectId
    , String)]) -> (
    ObjectId
    , String)?

    gh_issue_to_issue

    fn gh_issue_to_issue(gh : GhIssue, existing_id? : String) -> Issue

    Convert a GitHub API issue to a local Issue

    gh_pr_to_pull_request

    fn gh_pr_to_pull_request(gh : GhPullRequest, existing_id? : String) -> PullRequest

    Convert a GitHub API pull request to a local PullRequest

    hub_notes_ns_name

    fn hub_notes_ns_name() -> String

    hub_notes_ref_name

    fn hub_notes_ref_name() -> String

    fn is_sync_link_record_kind(kind : String) -> Bool

    is_work_item_record_kind

    fn is_work_item_record_kind(kind : String) -> Bool

    issue_comment_key

    fn issue_comment_key(issue_id : String, comment_id : String) -> String

    issue_comment_prefix

    fn issue_comment_prefix(issue_id : String) -> String

    issue_diff_for_github

    fn issue_diff_for_github(current : Issue, _link : SyncLink, gh : GhIssue) -> SyncDiff

    Compare a local Issue with a GitHub GhIssue and return a SyncDiff

    merge_record_bytes

    fn merge_record_bytes(ours : Bytes, theirs : Bytes) -> Bytes

    merge_record_bytes_with_policy

    fn merge_record_bytes_with_policy(ours : Bytes, theirs : Bytes, conflict_policy : RecordMergePolicy) -> Bytes

    parse_claim_action

    fn parse_claim_action(s : String) -> ClaimAction?

    parse_claim_message

    fn parse_claim_message(json : Json) -> ClaimMessage?

    parse_claims_from_envelopes

    fn parse_claims_from_envelopes(envelopes : Array[Json]) -> Array[ClaimMessage]

    Parse claim messages from relay poll envelopes. Each envelope has shape: { "payload": { ... }, "topic": "...", ... }

    parse_hub_record

    fn parse_hub_record(text : String) -> HubRecord

    parse_iso8601_to_unix

    fn parse_iso8601_to_unix(iso_str : String) -> Int64

    Parse ISO 8601 timestamp string to Unix seconds. Supports "YYYY-MM-DDThh:mm:ssZ" and "YYYY-MM-DDThh:mm:ss+00:00" formats. Returns 0 for empty or unparseable strings.

    parse_issue_comment

    fn parse_issue_comment(text : String) -> IssueComment raise PrError

    Parse IssueComment from Git-style text format

    parse_legacy_issue

    fn parse_legacy_issue(text : String) -> Issue raise PrError

    Parse legacy Issue payload (issue ...) from Git-style text format

    parse_legacy_pull_request

    fn parse_legacy_pull_request(text : String) -> PullRequest raise PrError

    Parse legacy PullRequest payload (pr ...) from Git-style text format

    parse_note

    fn parse_note(text : String) -> Note

    Parse Note from Git-style text format (with metadata)

    parse_note_plain

    fn parse_note_plain(commit_id :
    ObjectId
    , text : String) -> Note

    Parse Note from plain text (Git compatible, creates minimal Note)

    parse_pr_comment

    fn parse_pr_comment(text : String) -> PrComment raise PrError

    Parse PrComment from Git-style text format

    parse_pr_review

    fn parse_pr_review(text : String) -> PrReview raise PrError

    Parse PrReview from Git-style text format

    parse_pr_workflow_result

    fn parse_pr_workflow_result(text : String) -> PrWorkflowResult raise PrError

    parse_pr_workflow_status

    fn parse_pr_workflow_status(value : String) -> PrWorkflowStatus?

    parse_record_merge_policy

    fn parse_record_merge_policy(value : String) -> RecordMergePolicy?

    fn parse_sync_link(text : String) -> SyncLink raise PrError

    Parse SyncLink from Git-style text format

    parse_work_item

    fn parse_work_item(text : String) -> WorkItem raise PrError

    Parse WorkItem from Git-style text format

    pr_comment_key

    fn pr_comment_key(pr_id : String, comment_id : String) -> String

    pr_comment_prefix

    fn pr_comment_prefix(pr_id : String) -> String

    pr_diff_for_github

    fn pr_diff_for_github(current : PullRequest, _link : SyncLink, gh : GhPullRequest) -> SyncDiff

    Compare a local PullRequest with a GitHub GhPullRequest and return a SyncDiff

    pr_proposal_meta_key

    fn pr_proposal_meta_key(pr_id : String) -> String

    pr_proposal_prefix

    fn pr_proposal_prefix() -> String

    pr_review_key

    fn pr_review_key(pr_id : String, review_id : String) -> String

    pr_review_prefix

    fn pr_review_prefix(pr_id : String) -> String

    pr_workflow_key

    fn pr_workflow_key(pr_id : String, task : String) -> String

    pr_workflow_prefix

    fn pr_workflow_prefix(pr_id : String) -> String

    record_notify_topic

    fn record_notify_topic(record : HubRecord) -> String?

    resolve_active_claims

    fn resolve_active_claims(claims : Array[ClaimMessage]) -> Array[ClaimMessage]

    Resolve active claims: for each issue_id, keep only the latest action. If the latest action is Unclaim, the issue is not actively claimed.

    short_ref_name

    fn short_ref_name(refname : String) -> String

    fn sync_link_key(local_id : String, provider : String) -> String

    fn sync_link_record_kind() -> String

    unix_to_iso8601

    fn unix_to_iso8601(unix : Int64) -> String

    Convert Unix seconds to ISO 8601 string in UTC ("YYYY-MM-DDThh:mm:ssZ").

    work_item_meta_key

    fn work_item_meta_key(work_item_id : String) -> String

    work_item_meta_prefix

    fn work_item_meta_prefix() -> String

    write_object_bytes

    fn write_object_bytes(fs : &
    FileSystem
    , git_dir : String, id :
    ObjectId
    , compressed : Bytes) -> Unit raise
    GitError