Explorer

definy.branch-merges

description
The snapshots of the main branches that merged another snapshot, as core.branch-merge (core.branch-status-of makes the merged branch done)
type
Fn(commits: List<@definy.event-snapshot>) -> List<@core.branch-merge>
expression
fn(commits$0) =>
  @core.list-fold(
    T: @definy.event-snapshot,
    A: List<@core.branch-merge>,
    reducer: fn(acc$1, item$2) =>
      match @core.equal(left: $2.commit.branch, right: "main") {
        false =>
          $1,
        true =>
          match $2.commit.merged_commit_hash {
            #none(_) =>
              $1,
            #some(merged$3) =>
              @core.list-append(
                list: $1,
                item: {project_name: $2.commit.project_name, merged_commit_hash: $3, time: $2.commit.time_ms}
              )
          }
      },
    init: [],
    xs: $0
  )
visibility
public
definy.branch-merges (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: Tmx0raUIRPl-B1LTOHNuCzQmepHcVKMTRaMUOxjLsU0
content hash: G_9NqV8GboTt03fql3DxpoQMcb_9_1HWQqsf5dwQfnY