# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

triggers:
- repos:
  - kubeflow
  join_org_url: "https://www.kubeflow.org/docs/about/contributing/"
  only_org_members: true
  trigger_github_workflows: true
- repos:
  - GoogleCloudPlatform/compute-daisy
  - GoogleCloudPlatform/cloud-image-tests
  - GoogleCloudPlatform/guest-configs
  - GoogleCloudPlatform/galog
  - GoogleCloudPlatform/google-guest-agent
  trusted_apps:
    - copybara-service

config_updater:
  maps:
    prow/oss/config.yaml:
      name: config
    prow/oss/plugins.yaml:
      name: plugins
    prow/prowjobs/**/*.{yaml,yml}:
      name: job-config

approve:
- repos:
  - GoogleCloudPlatform
  - google
  - grpc-ecosystem
  - chaotoppicks
  require_self_approval: false
  commandHelpLink: https://oss.gprow.dev/command-help
- repos:
  - GoogleCloudPlatform/k8s-config-connector
  - GoogleContainerTools
  require_self_approval: true
  commandHelpLink: https://oss.gprow.dev/command-help
- repos:
  - kubeflow
  lgtm_acts_as_approve: false
  require_self_approval: true
  # We treat GitHub approve as LGTM (not approve) to avoid accidental merges.
  # Note, we set `review_acts_as_lgtm=true` in `lgtm` plugin.
  ignore_review_state: true
  commandHelpLink: https://oss.gprow.dev/command-help

blunderbuss:
  use_status_availability: true

lgtm:
- repos:
  - GoogleCloudPlatform
  - GoogleContainerTools
  - chaotoppicks
  - google
  - grpc-ecosystem
  review_acts_as_lgtm: true
- repos:
  - GoogleContainerTools/kpt-config-sync
  review_acts_as_lgtm: false
- repos:
  - GoogleCloudPlatform/testgrid
  review_acts_as_lgtm: true
  trusted_team_for_sticky_lgtm: 'TestGrid Admins'
- repos:
  - kubeflow
  # We treat GitHub approve as LGTM (not approve) to avoid accidental merges.
  # Note, we also set `ignore_review_state=true` in `approve` plugin.
  review_acts_as_lgtm: true

label:
  additional_labels:
  # These labels are used to make Tide merge with a non-default merge method
  - tide/merge-method-merge
  - tide/merge-method-rebase
  - tide/merge-method-squash
  # This is used to triage issues in Kubeflow repositories.
  - lifecycle/needs-triage

repo_milestone:
  kubeflow/trainer:
    maintainers_team: kubeflow-trainer-team
    maintainers_friendly_name: Kubeflow Trainer Team
  kubeflow/sdk:
    maintainers_team: kubeflow-trainer-team
    maintainers_friendly_name: Kubeflow Trainer Team

milestone_applier:
  kubeflow/trainer:
    master: v2.0
  kubeflow/sdk:
    main: v0.1

plugins:
  GoogleCloudPlatform:
    plugins:
    - assign
    - cat
    - dog
    - golint
    - hold
    - label
    - pony
    - shrug
    - trigger
    - yuks

  GoogleCloudPlatform/artifact-registry-apt-transport:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/artifact-registry-yum-plugin:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/blueprints:
    plugins:
    - approve
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/compute-daisy:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/cloud-image-tests:
    plugins:
    - size
  GoogleCloudPlatform/compute-image-tools:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/compute-image-windows:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/elcarro-oracle-operator:
    plugins:
    - approve
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/esp-v2:
    plugins:
    - approve
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/galog:
    plugins:
    - size
  GoogleCloudPlatform/google-guest-agent:
    plugins:
    - size
  GoogleCloudPlatform/guest-agent:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/guest-configs:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/guest-diskexpand:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/guest-logging-go:
    plugins:
    - approve
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/guest-oslogin:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/guest-test-infra:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/k8s-cloud-provider:
    plugins:
    - approve
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/gke-networking-api:
    plugins:
    - approve
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/netd:
    plugins:
    - approve
    - help
    - lgtm
    - size
    - verify-owners
    - wip
  GoogleCloudPlatform/osconfig:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
  GoogleCloudPlatform/oss-test-infra:
    plugins:
    - approve
    - blunderbuss
    - config-updater
    - heart
    - lgtm
    - lifecycle
    - override
    - owners-label
    - size
    - verify-owners
    - wip
  GoogleCloudPlatform/testgrid:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - owners-label
    - size
    - verify-owners
    - wip
  GoogleCloudPlatform/compute-image-import:
    plugins:
    - approve
    - blunderbuss
    - lgtm
    - size
    - verify-owners
    - wip

  GoogleCloudPlatform/k8s-config-connector:
    plugins:
    # Inherited from GoogleCloudPlatform:
    #- assign
    #- hold
    #- label
    - approve
    - lgtm
    - lifecycle   # Close PRs with /close
    - verify-owners
    - wip

  GoogleContainerTools/kpt-config-sync:
    plugins:
    - approve
    - assign
    - blunderbuss
    - cat
    - dog
    - golint
    - label
    - lgtm
    - pony
    - shrug
    - size
    - trigger
    - verify-owners
    - yuks
    - wip

  google:
    plugins:
    - approve
    - assign
    - cat
    - dog
    - golint
    - hold
    - label
    - lgtm
    - owners-label
    - pony
    - shrug
    - size
    - trigger
    - verify-owners
    - wip
    - yuks

  kubeflow:
    plugins:
    - approve   # Enable /approve and /assign commands.
    - assign
    - blunderbuss
    - golint
    - help
    - hold
    - label
    - lgtm
    - lifecycle   # Lets PRs & issues be flagged as stale
    - milestone # Applies a milestone for issues or PRs.
    - milestoneapplier
    - override
    - project # Lets issues be tagged into projects
    - retitle
    - size
    - skip  # Allows cleaning up stale commit statuses
    - transfer-issue # Transfer issue to a different repo in the same org.
    - trigger # Enable /ok-to-test command to trigger GitHub actions with /rerun-all
    - verify-owners   # Validates OWNERS file changes in PRs.
    - wip   # Applies a label to PRs with wip in the title to block merge

  # This is a gerrit repo so this config doesn't do anything. It is included
  # to satisfy the checkconfig tool which expects all repos that configure
  # jobs to enable the trigger plugin if a plugins.yaml is specified.
  # https://github.com/kubernetes/test-infra/issues/14743
  https://kunit-review.googlesource.com/linux:
    plugins:
    - trigger

  # This is a gerrit repo so this config doesn't do anything. It is included
  # to satisfy the checkconfig tool which expects all repos that configure
  # jobs to enable the trigger plugin if a plugins.yaml is specified.
  # https://github.com/kubernetes/test-infra/issues/14743
  https://linux-review.googlesource.com/linux/kernel/git/torvalds/linux:
    plugins:
    - trigger

  grpc-ecosystem/grpc-httpjson-transcoding:
    plugins:
    - approve
    - assign
    - cat
    - dog
    - golint
    - hold
    - label
    - lgtm
    - owners-label
    - pony
    - shrug
    - size
    - trigger
    - verify-owners
    - yuks

  chaotoppicks:
    plugins:
    - approve
    - assign
    - cat
    - dog
    - golint
    - hold
    - label
    - lgtm
    - owners-label
    - pony
    - shrug
    - size
    - trigger
    - verify-owners
    - yuks

external_plugins:
  kubeflow:
  - name: cherrypicker
    events:
    - issue_comment
    - pull_request
    endpoint: http://cherrypicker
