################################################################################
###################### catalog-info for connectors ######################
# Declare a Backstage Component for connectors
# When doing changes validate them using https://backstage.elastic.dev/entity-validation
---
# yaml-language-server: $schema=https://json.schemastore.org/catalog-info.json
apiVersion: "backstage.io/v1alpha1"
kind: "Component"
metadata:
  name: "elastic-connectors"
  description: "Ingestion service hosting connectors that can be used to ingest data into Elasticsearch"
  annotations:
    backstage.io/source-location: "url:https://github.com/elastic/connectors/"
    github.com/project-slug: "elastic/connectors"
    github.com/team-slug: "elastic/search-extract-and-transform"
    buildkite.com/project-slug: "elastic/connectors"
    pagerduty.com/service-id: "PN2MP2P"
  tags:
    - "python"
    - "buildkite"
spec:
  type: "service"
  lifecycle: "production"
  owner: "group:search-extract-and-transform"

# ------------------------------------------------------------------------------
# this is the main pipeline, triggered via pull requests and merges

---
apiVersion: "backstage.io/v1alpha1"
kind: "Resource"
metadata:
  name: "connectors"
  description: "Lints and tests Elastic connector framework and connector implementations"
  links:
    - title: "connectors Main Pipeline"
      url: "https://buildkite.com/elastic/connectors"
spec:
  type: "buildkite-pipeline"
  owner: "group:search-extract-and-transform"
  system: "buildkite"
  implementation:
    apiVersion: "buildkite.elastic.dev/v1"
    kind: "Pipeline"
    metadata:
      name: "connectors"
      description: "Your Connector Service to ingest data into Elasticsearch"
    spec:
      branch_configuration: "main"
      pipeline_file: ".buildkite/pipeline.yml"
      repository: "elastic/connectors"
      schedules:
        Daily main:
          branch: main
          cronline: '@daily'
          message: "Builds, tests, and pushes daily `main` DRA artifacts"
        Daily 9.0:
          branch: "9.0"
          cronline: '@daily'
          message: "Builds, tests, and pushes daily `9.0` DRA artifacts"
        Daily 8.19:
          branch: "8.19"
          cronline: '@daily'
          message: "Builds, tests, and pushes daily `8.19` DRA artifacts"
        Daily 8.18:
          branch: "8.18"
          cronline: '@daily'
          message: "Builds, tests, and pushes daily `8.18` DRA artifacts"
        Daily 8.17:
          branch: "8.17"
          cronline: '@daily'
          message: "Builds, tests, and pushes daily `8.17` DRA artifacts"
      provider_settings:
        skip_pull_request_builds_for_existing_commits: false
        build_pull_request_labels_changed: true
      teams:
        everyone:
          access_level: "READ_ONLY"
        search-extract-and-transform: {}
        search-productivity-team: {}

# ------------------------------------------------------------------------------
# nightly pipelines

---
apiVersion: "backstage.io/v1alpha1"
kind: "Resource"
metadata:
  name: "connectors-nightly"
  description: "Nightly Connector Service Tests"
  links:
    - title: "connectors Nightly Buildkite Jobs"
      url: "https://buildkite.com/elastic/connectors"
spec:
  type: "buildkite-pipeline"
  owner: "group:search-extract-and-transform"
  system: "buildkite"
  implementation:
    apiVersion: "buildkite.elastic.dev/v1"
    kind: "Pipeline"
    metadata:
      name: "connectors-nightly"
      description: "Connectors Service Nightly Tests"
      links:
        - title: "Connector Service Nightly Pipeline"
          url: "https://buildkite.com/elastic/connectors-nightly"
    spec:
      pipeline_file: ".buildkite/nightly.py"
      provider_settings:
        trigger_mode: "none"
      repository: "elastic/connectors"
      schedules:
        Daily 8_18:
          branch: '8.18'
          cronline: '@daily'
          message: "Runs daily `8.18` e2e test"
        Daily 8_17:
          branch: '8.17'
          cronline: '@daily'
          message: "Runs daily `8.17` e2e test"
        Daily 8_19:
          branch: '8.19'
          cronline: '@daily'
          message: "Runs daily `8.19` e2e test"
        Daily 9_0:
          branch: '9.0'
          cronline: '@daily'
          message: "Runs daily `9.0` e2e test"
        Daily main:
          branch: main
          cronline: '@daily'
          message: "Runs daily `main` e2e test"
      teams:
        everyone:
          access_level: "READ_ONLY"
        search-extract-and-transform: {}
        search-productivity-team: {}

---
apiVersion: "backstage.io/v1alpha1"
kind: "Resource"
metadata:
  name: "connectors-nightly-aarch64"
  description: "Nightly Connector Service Tests on aarch64"
  links:
    - title: "connectors Nightly Buildkite Jobs"
      url: "https://buildkite.com/elastic/connectors"
spec:
  type: "buildkite-pipeline"
  owner: "group:search-extract-and-transform"
  system: "buildkite"
  implementation:
    apiVersion: "buildkite.elastic.dev/v1"
    kind: "Pipeline"
    metadata:
      name: "connectors-nightly-aarch64"
      description: "Connectors Service Nightly Tests on aarch64"
      links:
        - title: "Connector Service Nightly Pipeline"
          url: "https://buildkite.com/elastic/connectors-nightly-aarch64"
    spec:
      pipeline_file: ".buildkite/nightly_aarch64.py"
      provider_settings:
        trigger_mode: "none"
      repository: "elastic/connectors"
      schedules:
        Daily 8_18:
          branch: '8.18'
          cronline: '@daily'
          message: "Runs daily `8.18` e2e aarch64 test"
        Daily 8_17:
          branch: '8.17'
          cronline: '@daily'
          message: "Runs daily `8.17` e2e aarch64 test"
        Daily 8_19:
          branch: '8.19'
          cronline: '@daily'
          message: "Runs daily `8.19` e2e aarch64 test"
        Daily 9_0:
          branch: '9.0'
          cronline: '@daily'
          message: "Runs daily `9.0` e2e aarch64 test"
        Daily main:
          branch: main
          cronline: '@daily'
          message: "Runs daily `main` e2e aarch64 test"
      teams:
        everyone:
          access_level: "READ_ONLY"
        search-extract-and-transform: {}
        search-productivity-team: {}

########
# Docker image build and publish - manual release
########
---
apiVersion: "backstage.io/v1alpha1"
kind: "Resource"
metadata:
  name: "connectors-docker-build-publish"
  description: "Docker image build and publish for Elastic connectors"
  links:
    - title: "Connectors Docker Build and Publish"
      url: "https://buildkite.com/elastic/connectors-docker-build-publish"
spec:
  type: "buildkite-pipeline"
  owner: "group:search-extract-and-transform"
  system: "buildkite"
  implementation:
    apiVersion: "buildkite.elastic.dev/v1"
    kind: "Pipeline"
    metadata:
      name: "connectors-docker-build-publish"
    spec:
      repository: "elastic/connectors"
      pipeline_file: ".buildkite/release-pipeline.yml"
      provider_settings:
        trigger_mode: "none"
      teams:
        search-extract-and-transform: {}
        search-productivity-team: {}
        everyone:
          access_level: "READ_ONLY"
