# *************************************************************
# Declare Backstage Component that represents the Logstash tool
# *************************************************************
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: logstash
  description: Logstash is a server-side data processing pipeline that ingests data from a multitude of sources simultaneously, transforms it, and then sends it to your favorite "stash."
  annotations:
    backstage.io/source-location: url:https://github.com/elastic/logstash/
    github.com/project-slug: elastic/logstash
    github.com/team-slug: elastic/logstash
    buildkite.com/project-slug: elastic/logstash
  tags:
    - logstash
    - dra
  links:
    - title: Logstash
      url: https://elastic.co/logstash
spec:
  type: tool
  owner: group:logstash
  system: platform-ingest
  lifecycle: production
  dependsOn:
    - resource:buildkite-logstash-serverless-integration-testing
    - resource:logstash-snyk-report
    - resource:logstash-dra-snapshot-pipeline
    - resource:logstash-dra-staging-pipeline
    - resource:logstash-linux-jdk-matrix-pipeline
    - resource:logstash-windows-jdk-matrix-pipeline
    - resource:logstash-benchmark-pipeline
    - resource:logstash-health-report-tests-pipeline
    - resource:logstash-jdk-availability-check-pipeline

# ***********************************
# Declare serverless IT pipeline
# ***********************************
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: buildkite-logstash-serverless-integration-testing
  description: Buildkite pipeline for the Serverless Integration Test
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: logstash-serverless-integration-testing
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/serverless_integration_pipeline.yml"
      maximum_timeout_in_minutes: 90
      provider_settings:
        trigger_mode: none # don't trigger jobs from github activity
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
      schedules:
        Daily serverless test on core_serverless_test branch:
          branch: main
          cronline: "@daily"
          message: "Run the serverless integration test every day."


# ***********************************
# Declare snyk-repo pipeline
# ***********************************
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-snyk-report
  description: 'The logstash-snyk-report pipeline.'
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: logstash-snyk-report-ci
      description: ':logstash: The logstash-snyk-report :pipeline:'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/snyk_report_pipeline.yml"
      maximum_timeout_in_minutes: 60
      provider_settings:
        trigger_mode: none # don't trigger jobs
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
      schedules:
        Daily Snyk scan:
          branch: main
          cronline: "@daily"
          message: "Run the Logstash Snyk report every day."

# ***********************************
# SECTION START: DRA pipelines
# ***********************************

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-dra-snapshot-pipeline
  description: 'Logstash DRA SNAPSHOT (Daily, Auto) pipeline'
  links:
    - title: 'Logstash DRA SNAPSHOT (Daily, Auto) pipeline'
      url: https://buildkite.com/elastic/logstash-dra-snapshot-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: logstash-dra-snapshot-pipeline
      description: ':logstash: The DRA SNAPSHOT pipeline'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/dra_pipeline.yml"
      maximum_timeout_in_minutes: 120
      skip_intermediate_builds: true
      provider_settings:
        trigger_mode: none
      env:
        WORKFLOW_TYPE: 'snapshot'
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-dra-staging-pipeline
  description: 'Logstash DRA RELEASE (Staging) pipeline'
  links:
    - title: 'Logstash DRA RELEASE (Staging) pipeline'
      url: https://buildkite.com/elastic/logstash-dra-staging-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: logstash-dra-staging-pipeline
      description: ':logstash: The DRA RELEASE (Staging) pipeline'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/dra_pipeline.yml"
      maximum_timeout_in_minutes: 120
      skip_intermediate_builds: true
      provider_settings:
        trigger_mode: none
      env:
        WORKFLOW_TYPE: 'staging'
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'        
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

# ***********************************
# SECTION END: DRA pipelines
# ***********************************

# ***********************************
# SECTION START: Pull requests
# ***********************************

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-pull-request-pipeline
  description: 'Logstash Pull Request pipeline'
  links:
    - title: 'Logstash Pull Request pipeline'
      url: https://buildkite.com/elastic/logstash-pull-request-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: logstash-pull-request-pipeline
      description: ':logstash: Testing for Logstash Pull Requests'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/pull_request_pipeline.yml"
      maximum_timeout_in_minutes: 120
      provider_settings:
        build_pull_request_forks: false
        build_pull_requests: true # requires filter_enabled and filter_condition settings as below when used with buildkite-pr-bot
        build_branches: false
        build_tags: false
        filter_enabled: true
        filter_condition: >-
          build.creator.name == 'elasticmachine' && build.pull_request.id != null
      cancel_intermediate_builds: true
      skip_intermediate_builds: true
      env:
        ELASTIC_PR_COMMENTS_ENABLED: 'true'
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

# ***********************************
# SECTION END: Pull requests
# ***********************************

# *******************************
# SECTION START: aarch64 pipeline
# *******************************

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-aarch64-pipeline
  description: 'Logstash aarch64 pipeline'
  links:
    - title: 'Logstash aarch64 pipeline'
      url: https://buildkite.com/elastic/logstash-aarch64-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: "Logstash aarch64 pipeline"
      description: ':logstash: Exhaustive tests for the aarch64 architecture'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/aarch64_pipeline.yml"
      maximum_timeout_in_minutes: 90
      provider_settings:
        trigger_mode: none
      cancel_intermediate_builds: true
      skip_intermediate_builds: true
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

# *****************************
# SECTION END: aarch64 pipeline
# *****************************

# *************************************************************
# SECTION START: JDK matrix tests (Linux and Windows) pipelines
# *************************************************************

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-linux-jdk-matrix-pipeline
  description: 'Logstash Linux JDK matrix pipeline'
  links:
    - title: 'Logstash Linux JDK matrix pipeline'
      url: https://buildkite.com/elastic/logstash-linux-jdk-matrix-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: "Logstash Linux JDK matrix pipeline"
      description: ':java: :linux: Test Logstash against a matrix of JDKs and Linux Distributions'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/linux_jdk_matrix_pipeline.yml"
      maximum_timeout_in_minutes: 120
      provider_settings:
        trigger_mode: none
      cancel_intermediate_builds: true
      skip_intermediate_builds: true
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-windows-jdk-matrix-pipeline
  description: 'Logstash Windows JDK matrix pipeline'
  links:
    - title: 'Logstash Windows JDK matrix pipeline'
      url: https://buildkite.com/elastic/logstash-windows-jdk-matrix-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: "Logstash Windows JDK matrix pipeline"
      description: ':java: :windows: Test Logstash against a matrix of JDKs and Windows releases'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/windows_jdk_matrix_pipeline.yml"
      maximum_timeout_in_minutes: 120
      provider_settings:
        trigger_mode: none
      cancel_intermediate_builds: true
      skip_intermediate_builds: true
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'        
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

# ***********************************************************
# SECTION END: JDK matrix tests (Linux and Windows) pipelines
# ***********************************************************

# ****************************************
# SECTION START: Exhaustive tests pipeline
# ****************************************

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-exhaustive-tests-pipeline
  description: 'Logstash Exhaustive tests pipeline'
  links:
    - title: 'Logstash Exhaustive tests pipeline'
      url: https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: "Logstash Exhaustive tests pipeline"
      description: '🔍 Run exhaustive tests against Logstash using different operating systems'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/exhaustive_tests_pipeline.yml"
      provider_settings:
        build_branches: true
        build_pull_request_forks: false
        build_pull_requests: false
        build_tags: false
        trigger_mode: code
        filter_condition: >-
          build.branch !~ /^backport.*$/ && build.branch !~ /^mergify\/bp\/.*$/
        filter_enabled: true
      cancel_intermediate_builds: false
      skip_intermediate_builds: false
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'        
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

# **************************************
# SECTION END: Exhaustive tests pipeline
# **************************************

# ********************************************
# Declare supported plugin tests pipeline
# ********************************************
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-supported-plugins-test-pipeline
  description: "Execute spec tests af all supported tier1 and tier2 plugins using the current branch's Logstash"
  links:
    - title: 'Logstash supported plugins test pipeline'
      url: https://buildkite.com/elastic/logstash-supported-plugins-test-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: 'Logstash supported plugins test pipeline'
      description: ':logstash: Supported plugins test pipeline'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/supported_plugins_test_pipeline.yml"
      maximum_timeout_in_minutes: 90
      skip_intermediate_builds: true
      provider_settings:
        trigger_mode: none
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

# **************************************************************
# SECTION START: Scheduler pipeline 
# (Definitions for scheduled runs of various Logstash pipelines)
# **************************************************************

---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-pipeline-scheduler
  description: 'Scheduled runs of Logstash pipelines per release branch'
  links:
    - title: 'Scheduled runs of Logstash pipelines per release branch'
      url: https://buildkite.com/elastic/logstash-pipeline-scheduler
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: Logstash Pipeline Scheduler
      description: ':alarm_clock: Scheduled runs of Logstash pipelines per release branch'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/trigger_pipelines.yml"
      maximum_timeout_in_minutes: 240
      schedules:
        Daily Snapshot DRA:
          branch: main
          cronline: 30 02 * * *
          message: Daily trigger of Snapshot DRA Pipeline per branch
          env:
            PIPELINES_TO_TRIGGER: 'logstash-dra-snapshot-pipeline'
        Weekly JDK matrix:
          branch: main
          cronline: 0 1 * * 2
          message: Weekly trigger of JDK matrix pipelines per branch
          env:
            PIPELINES_TO_TRIGGER: 'logstash-linux-jdk-matrix-pipeline,logstash-windows-jdk-matrix-pipeline'
        AARCH64 Tests:
          branch: main
          cronline: 0 2 * * 1  # every Monday@2AM UTC
          message: Weekly trigger of AARCH64 pipeline per branch
          env:
            PIPELINES_TO_TRIGGER: 'logstash-aarch64-pipeline'
        Exhaustive Tests:
          branch: main
          cronline: 0 3 * * 1%2  # every other Wednesday@3AM UTC, see https://buildkite.com/docs/pipelines/scheduled-builds#schedule-intervals-crontab-time-syntax
          message: Biweekly trigger of Exhaustive pipeline for non-main branches
          env:
            PIPELINES_TO_TRIGGER: 'logstash-exhaustive-tests-pipeline'
            EXCLUDE_BRANCHES: 'main'
      skip_intermediate_builds: true
      provider_settings:
        trigger_mode: none
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'false'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

# *******************************
# SECTION END: Scheduler pipeline
# *******************************

# ***********************************
# Declare Benchmark pipeline
# ***********************************
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-benchmark-pipeline
  description: Buildkite pipeline for the Logstash benchmark
  links:
    - title: 'Logstash Benchmark (Daily, Auto) pipeline'
      url: https://buildkite.com/elastic/logstash-benchmark-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: logstash-benchmark-pipeline
      description: ':running: The Benchmark pipeline for snapshot version'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/benchmark_pipeline.yml"
      maximum_timeout_in_minutes: 90
      provider_settings:
        trigger_mode: none # don't trigger jobs from github activity
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'false'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
      schedules:
        Daily serverless test on core_serverless_test branch:
          branch: main
          cronline: 30 04 * * *
          message: Daily trigger of Benchmark Pipeline

# *******************************
# SECTION END: Benchmark pipeline
# *******************************

# ***********************************
# SECTION START: Benchmark Marathon
# ***********************************
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-benchmark-marathon-pipeline
  description: Buildkite pipeline for benchmarking multi-version
  links:
    - title: 'Logstash Benchmark Marathon'
      url: https://buildkite.com/elastic/logstash-benchmark-marathon-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: logstash-benchmark-marathon-pipeline
      description: ':running: The Benchmark Marathon for multi-version'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/benchmark_marathon_pipeline.yml"
      maximum_timeout_in_minutes: 480
      provider_settings:
        trigger_mode: none # don't trigger jobs from github activity
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'false'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY

# *******************************
# SECTION END: Benchmark Marathon
# *******************************

# ***********************************
# Declare Health Report Tests pipeline
# ***********************************
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-health-report-tests-pipeline
  description: Buildkite pipeline for the Logstash Health Report Tests
  links:
    - title: ':logstash Logstash Health Report Tests (Daily, Auto) pipeline'
      url: https://buildkite.com/elastic/logstash-health-report-tests-pipeline
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: logstash-health-report-tests-pipeline
      description: ':logstash: Logstash Health Report tests :pipeline:'
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/health_report_tests_pipeline.yml"
      maximum_timeout_in_minutes: 30 # usually tests last max ~17mins
      provider_settings:
        trigger_mode: none # don't trigger jobs from github activity
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        ingest-fp:
          access_level: MANAGE_BUILD_AND_READ
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
      schedules:
        Daily Health Report tests on main branch:
          branch: main
          cronline: 30 20 * * *
          message: Daily trigger of Health Report Tests Pipeline

# *******************************
# SECTION END: Health Report Tests pipeline
# *******************************

# ***********************************
# Declare JDK check pipeline
# ***********************************
---
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: logstash-jdk-availability-check-pipeline
  description: ":logstash: check availability of new JDK version"
spec:
  type: buildkite-pipeline
  owner: group:logstash
  system: platform-ingest
  implementation:
    apiVersion: buildkite.elastic.dev/v1
    kind: Pipeline
    metadata:
      name: logstash-jdk-availability-check-pipeline
    spec:
      repository: elastic/logstash
      pipeline_file: ".buildkite/jdk_availability_check_pipeline.yml"
      maximum_timeout_in_minutes: 10
      provider_settings:
        trigger_mode: none # don't trigger jobs from github activity
      env:
        ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
        SLACK_NOTIFICATIONS_CHANNEL: '#logstash-build'
        SLACK_NOTIFICATIONS_ON_SUCCESS: 'false'
        SLACK_NOTIFICATIONS_SKIP_FOR_RETRIES: 'true'
      teams:
        logstash:
          access_level: MANAGE_BUILD_AND_READ
        ingest-eng-prod:
          access_level: MANAGE_BUILD_AND_READ
        everyone:
          access_level: READ_ONLY
      schedules:
        Weekly JDK availability check (main):
          branch: main
          cronline: 0 2 * * 1  # every Monday@2AM UTC
          message: Weekly trigger of JDK update availability pipeline per branch
          env:
            PIPELINES_TO_TRIGGER: 'logstash-jdk-availability-check-pipeline'
        Weekly JDK availability check (8.19):
          branch: "8.19"
          cronline: 0 2 * * 1  # every Monday@2AM UTC
          message: Weekly trigger of JDK update availability pipeline per branch
          env:
            PIPELINES_TO_TRIGGER: 'logstash-jdk-availability-check-pipeline'

# *******************************
# SECTION END: JDK check pipeline
# *******************************
