#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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
#
#     http://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.
#

name: Bug report
title: "[Bug] [Module Name] Bug title "
description: Problems and issues with code of Dinky
labels: [ "bug", "Waiting for reply" ]
body:
  - type: markdown
    attributes:
      value: |
        Please make sure what you are reporting is indeed a bug with reproducible steps.

        For better global communication, Please write in English.

        If you feel the description in English is not clear, then you can append description in Chinese, thanks!

  - type: checkboxes
    attributes:
      label: Search before asking
      description: >
        Please make sure to search in the [issues](https://github.com/DataLinkDC/dlink/issues?q=is%3Aissue)
        first to see whether the same issue was reported already.
      options:
        - label: >
            I had searched in the [issues](https://github.com/DataLinkDC/dlink/issues?q=is%3Aissue) and found
            no similar issues.
          required: true

  - type: textarea
    attributes:
      label: What happened
      description: Describe what happened.
      placeholder: >
        Please provide the context in which the problem occurred and explain what happened
    validations:
      required: true

  - type: textarea
    attributes:
      label: What you expected to happen
      description: What do you think went wrong?
      placeholder: >
        Please explain why you think the behaviour is erroneous. It is extremely helpful if you copy and paste
        the fragment of logs showing the exact error messages or wrong behaviour and screenshots for
        UI problems. You can include files by dragging and dropping them here.

        **NOTE**: please copy and paste texts instead of taking screenshots of them for easy future search.
    validations:
      required: true

  - type: textarea
    attributes:
      label: How to reproduce
      description: >
        What should we do to reproduce the problem? If you are not able to provide a reproducible case,
        please open a [Discussion](https://github.com/DataLinkDC/dlink/discussions) instead.
      placeholder: >
        Please make sure you provide a reproducible step-by-step case of how to reproduce the problem
        as minimally and precisely as possible. Keep in mind we do not have access to your deployment.
        Remember that non-reproducible issues will be closed! Opening a discussion is recommended as a
        first step.
    validations:
      required: true

  - type: textarea
    attributes:
      label: Anything else
      description: Anything else we need to know?
      placeholder: >
        How often does this problem occur? (Once? Every time? Only when certain conditions are met?)
        Any relevant logs to include? Put them here inside fenced
        ``` ``` blocks or inside a collapsable details tag if it's too long:
        <details><summary>x.log</summary> lots of stuff </details>

  - type: dropdown
    id: version
    attributes:
      label: Version
      description: >
        Which version of Dinky are you running? We only accept bugs report from the LTS projects.
      options:
        - dev
        - 0.6.6
        - 0.6.5
        - 0.6.4
        - 0.6.3
        - 0.6.2
        - 0.6.1
        - 0.6.0
        - 0.5.1
        - 0.5.0
    validations:
      required: true

  - type: checkboxes
    attributes:
      label: Are you willing to submit PR?
      description: >
        This is absolutely not required, but we are happy to guide you in the contribution process
        especially if you already have a good understanding of how to implement the fix.
        Dinky is a totally community-driven project and we love to bring new contributors in.
      options:
        - label: Yes I am willing to submit a PR!

  - type: checkboxes
    attributes:
      label: Code of Conduct
      description: |
        The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
      options:
        - label: >
            I agree to follow this project's
            [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
          required: true

  - type: markdown
    attributes:
      value: "Thanks for completing our form!"
