Explorer

definy.event-summary-lines

description
(en) The lines of an event in definy_list_events: 'Event <hash> <type> at <ms> by <account ID> <account name>', then ' name: ' for create_account, or ' project: ', ' branch: ', ' parts: ' and ' message: ' (the first line) for a snapshot in the snapshot cache
type
Fn(
  event: @definy.stored-event,
  names: List<@definy.account-name-entry>,
  commits: List<@definy.event-snapshot>,
  statuses: List<@core.branch-status-record>
) -> List<String>
expression
fn(event$0, names$1, commits$2, statuses$90) =>
  let header$3 = @definy.event-header-line(event: $0, names: $1);
  match @core.equal(left: $0.event_type, right: "create_account") {
    true =>
      [
        $3,
        @core.string-concat(
          left: "  name: ",
          right: @definy.account-name-find(names: $1, key: $0.event_hash, by_event: true, index: 0)
        )
      ],
    false =>
      match @core.equal(left: $0.event_type, right: "project_branch_status") {
        true =>
          @definy.branch-status-event-lines(header: $3, records: $90, event_hash: $0.event_hash),
        false =>
          match @definy.event-snapshot-find(commits: $2, event_hash: $0.event_hash, index: 0) {
            #some(found$5) =>
              [
                $3,
                @core.string-concat(left: "  project: ", right: $5.commit.project_name),
                @core.string-concat(left: "  branch: ", right: $5.commit.branch),
                @core.string-concat(
                  left: "  message: ",
                  right: match @core.list-get(list: @core.string-split(text: $5.commit.message, separator: "\n"), index: 0) {
                    #some(line$6) =>
                      $6,
                    #none(_) =>
                      ""
                  }
                )
              ],
            #none(_) =>
              [$3]
          }
      }
  }
visibility
public
definy.event-summary-lines (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: -0_f3ZnOPhUIzTD7J2vi4PAXmPn-vAr0k0siARPwkCM
content hash: lXvihn9ZJht0Y7JPNUY2a6BZ8ahkS9Vteg9P3NxlfeE