syntax = "proto3";

import "google/protobuf/wrappers.proto";
import "wix/api/callback.proto";
import "google/protobuf/any.proto";

package com.wixpress.ci.gh.api;

service GcbEventsService {
}

message BazelBuildInvocationEvent {

    string build_id = 1;
    string invocation_id = 2;
    oneof buildServerIdentifier {
        GcbBuildIdentifier gcb_build_identifier = 3;
        BuildKiteBuildIdentifier buildkite_build_identifier = 4;
    }
    BuildStatus invocation_status = 5;
    string repo_url  = 6;
    string revision = 7;
    int64 push_time_in_seconds = 8;
    int64 max_push_time_in_seconds = 9;
    TriggeredBy triggered_by = 10;

    enum BuildStatus {
        QUEUED = 0;
        WORKING = 1;
        SUCCESS = 2;
        FAILURE = 3;
        CANCELLED = 4;
        INTERNAL_ERROR = 5;
        TIMEOUT = 6;
        STATUS_UNKNOWN = 7;
    }
}

message TriggeredBy {
    string repo_url = 1;
    string commit_hash = 2;
}

message GcbBuildIdentifier {
}

message BuildKiteBuildIdentifier {
    string org_slug = 1;
    string pipeline_slug = 2;
    string build_number = 3;
}

