This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch form-in-issues in repository https://gitbox.apache.org/repos/asf/airflow.git
commit e48ab99a2f45f1d60cb20f87b183d7a9c27efb24 Author: Jarek Potiuk <[email protected]> AuthorDate: Thu Aug 26 20:30:02 2021 +0200 fixup! Convert issue templates into forms --- .../{bug_report.yml => airflow_bug_report.yml} | 32 ++++-- .../ISSUE_TEMPLATE/airflow_doc_issue_report.yml | 68 ++++++++++++ ...report.yml => airflow_providers_bug_report.yml} | 122 ++++++++++++++++++--- .github/ISSUE_TEMPLATE/feature_request.yml | 17 ++- .pre-commit-config.yaml | 6 +- .../pre_commit_check_provider_yaml_files.py | 23 ++++ 6 files changed, 244 insertions(+), 24 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/airflow_bug_report.yml similarity index 80% copy from .github/ISSUE_TEMPLATE/bug_report.yml copy to .github/ISSUE_TEMPLATE/airflow_bug_report.yml index 25aa6f4..0557a66 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/airflow_bug_report.yml @@ -1,8 +1,22 @@ --- -name: Bug report -description: Problems and issues with code or docs -labels: ["kind:bug"] +name: Airflow Bug report +description: Problems and issues with code of Apache Airflow core +labels: ["kind:bug", "area:core"] body: + - type: markdown + attributes: + # yamllint disable rule:line-length + value: " + <img src='https://raw.githubusercontent.com/apache/airflow/main/docs/apache-airflow/img/logos/airflow_64x64_emoji_transparent.png' align='left' width='80' height='80'> + Thank you for finding the time to report the problem! + + We really appreciate the community efforts to improve Airflow. + + Note, that you do not need to create an issue if you have a change ready to submit! + + You can open [Pull Request](https://github.com/apache/airflow/pulls) immediately. + <br clear='left'/>" + # yamllint enable rule:line-length - type: dropdown attributes: label: Apache Airflow version @@ -11,14 +25,14 @@ body: discuss Airflow 1.10, open [Discussion](https://github.com/apache/airflow/discussions) instead! multiple: false options: - - "2.1.3 (latest)" + - "2.1.3 (latest released)" - "2.1.2" - "2.1.1" - "2.1.0" - "2.0.2" - "2.0.1" - "2.0.0" - - "main" + - "main (development)" validations: required: true - type: input @@ -68,7 +82,8 @@ body: placeholder: > Please explain why you think the behaviour is erroneous. It is extremely helpful if you copy&paste the fragment of logs showing the exact error messages or wrong behaviour and screenshots for - UI problems or YouTube link to a video of you demonstrating the problem. You can include files by dragging and dropping them here. + UI problems or YouTube link to a video of you demonstrating the problem. You can include files by + dragging and dropping them here. - type: textarea attributes: label: How to reproduce @@ -76,9 +91,10 @@ body: 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/apache/airflow/discussions) instead. placeholder: > - Please make sure you provide a reproducible step-by-step case of how to reproduce the problem + 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 cluster or DAGs. - Remember that non-reproducible issues will be closed! Opening a discussion is recommended as a first step. + Remember that non-reproducible issues will be closed! Opening a discussion is recommended as a + first step. - type: textarea attributes: label: Anything else diff --git a/.github/ISSUE_TEMPLATE/airflow_doc_issue_report.yml b/.github/ISSUE_TEMPLATE/airflow_doc_issue_report.yml new file mode 100644 index 0000000..f010e96 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/airflow_doc_issue_report.yml @@ -0,0 +1,68 @@ +--- +name: Airflow Doc issue report +description: Problems and issues with docs of Apache Airflow +labels: ["kind:bug", "area:docs"] +body: + - type: markdown + attributes: + # yamllint disable rule:line-length + value: " + <img src='https://raw.githubusercontent.com/apache/airflow/main/docs/apache-airflow/img/logos/airflow_64x64_emoji_transparent.png' align='left' width='80' height='80'> + Thank you for finding the time to report the problem! + + We really appreciate the community efforts to improve Airflow. + + Note, that you do not need to create an issue if you have a change ready to submit! + + You can open [Pull Request](https://github.com/apache/airflow/pulls) immediately. + <br clear='left'/>" + # yamllint enable rule:line-length + - type: textarea + attributes: + label: Describe the issue with documentation + description: Please describe the issue with documentation you have. + placeholder: > + Please include links to the documentation that has the problem and possibly screenshots showing + the problem. Explain why do you think it is an issue. Make sure you include view of the target + audience of the documentation. Please explain why you think the docs are wrong. + - type: textarea + attributes: + label: How to solve the problem + description: How do you think the problem can be solved? + placeholder: > + Please explain how you think the documentation could be fixed. Ideally specify where a new or missing + documentation should be added and what kind of information should be included. Sometimes people + writing the documentation do not realise that some assumptions the have might not be in the heads + of the reader, so try to explain exactly what you would like to see in the docs and why. + - 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 foldable details tag if it's long: + <details><summary>x.log</summary> lots of stuff </details> + - 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. + Airflow is a community-managed project and we love to bring new contributors in. + Find us in #airflow-how-to-pr on Slack! + 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://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md) + required: true + - type: markdown + attributes: + value: "Thanks for completing our form!" diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/airflow_providers_bug_report.yml similarity index 60% rename from .github/ISSUE_TEMPLATE/bug_report.yml rename to .github/ISSUE_TEMPLATE/airflow_providers_bug_report.yml index 25aa6f4..280cf56 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/airflow_providers_bug_report.yml @@ -1,8 +1,105 @@ --- -name: Bug report -description: Problems and issues with code or docs -labels: ["kind:bug"] +name: Airflow Providers Bug report +description: Problems and issues with code of Apache Airflow Provider +labels: ["kind:bug", "area:providers"] body: + - type: markdown + attributes: + # yamllint disable rule:line-length + value: " + <img src='https://raw.githubusercontent.com/apache/airflow/main/docs/apache-airflow/img/logos/airflow_64x64_emoji_transparent.png' align='left' width='80' height='80'> + Thank you for finding the time to report a problem! + + We really appreciate the community efforts to improve Airflow. + + Note, that you do not need to create an issue if you have a change ready to submit! + + You can open [Pull Request](https://github.com/apache/airflow/pulls) immediately. + <br clear='left'/>" + # yamllint enable rule:line-length + - type: dropdown + attributes: + label: Apache Airflow Provider(s) + description: Provider(s) that the issue report is about (you can choose more than one) + multiple: true + options: + - airbyte + - alibaba + - amazon + - apache-beam + - apache-cassandra + - apache-drill + - apache-druid + - apache-hdfs + - apache-hive + - apache-kylin + - apache-livy + - apache-pig + - apache-pinot + - apache-spark + - apache-sqoop + - asana + - celery + - cloudant + - cncf-kubernetes + - databricks + - datadog + - dingding + - discord + - docker + - elasticsearch + - exasol + - facebook + - ftp + - google + - grpc + - hashicorp + - http + - imap + - jdbc + - jenkins + - jira + - microsoft-azure + - microsoft-mssql + - microsoft-psrp + - microsoft-winrm + - mongo + - mysql + - neo4j + - odbc + - openfaas + - opsgenie + - oracle + - pagerduty + - papermill + - plexus + - postgres + - presto + - qubole + - redis + - salesforce + - samba + - segment + - sendgrid + - sftp + - singularity + - slack + - snowflake + - sqlite + - ssh + - tableau + - telegram + - trino + - vertica + - yandex + - zendesk + validations: + required: true + - type: textarea + attributes: + label: Versions of Apache Airflow Providers + description: What Apache Airflow Providers versions are you using? + placeholder: You can use `pip freeze | grep apache-airflow-providers` (you can leave only relevant ones) - type: dropdown attributes: label: Apache Airflow version @@ -11,14 +108,14 @@ body: discuss Airflow 1.10, open [Discussion](https://github.com/apache/airflow/discussions) instead! multiple: false options: - - "2.1.3 (latest)" + - "2.1.3 (latest released)" - "2.1.2" - "2.1.1" - "2.1.0" - "2.0.2" - "2.0.1" - "2.0.0" - - "main" + - "main (development)" validations: required: true - type: input @@ -28,11 +125,6 @@ body: placeholder: "You can get it via `cat /etc/os-release` for example" validations: required: true - - type: textarea - attributes: - label: Versions of Apache Airflow Providers - description: What Apache Airflow Providers versions are you using? - placeholder: You can use `pip freeze | grep apache-airflow-providers` (you can leave only relevant ones) - type: dropdown attributes: label: Deployment @@ -68,7 +160,8 @@ body: placeholder: > Please explain why you think the behaviour is erroneous. It is extremely helpful if you copy&paste the fragment of logs showing the exact error messages or wrong behaviour and screenshots for - UI problems or YouTube link to a video of you demonstrating the problem. You can include files by dragging and dropping them here. + UI problems or YouTube link to a video of you demonstrating the problem. You can include files by + dragging and dropping them here. - type: textarea attributes: label: How to reproduce @@ -76,9 +169,10 @@ body: 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/apache/airflow/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 cluster or DAGs. - Remember that non-reproducible issues will be closed! Opening a discussion is recommended as a first step. + 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 cluster or + DAGs. Remember that non-reproducible issues will be closed! Opening a discussion is + recommended as a first step. - type: textarea attributes: label: Anything else diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 9a0aa31..3f3615b 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,8 +1,23 @@ --- -name: Feature request +name: Airflow feature request description: Suggest an idea for this project or its docs labels: ["kind:feature"] body: + - type: markdown + attributes: + # yamllint disable rule:line-length + value: " + <img src='https://raw.githubusercontent.com/apache/airflow/main/docs/apache-airflow/img/logos/airflow_64x64_emoji_transparent.png' align='left' width='80' height='80'> + Thank you for finding the time to propose new feature! + + We really appreciate the community efforts to improve Airflow. + + Note, that you do not need to create an issue if you have a change ready to submit! + + You can open [Pull Request](https://github.com/apache/airflow/pulls) immediately. + <br clear='left'/>" + + # yamllint enable rule:line-length - type: textarea attributes: label: Description diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e71573f..3956796 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -520,7 +520,11 @@ repos: language: python require_serial: true files: provider\.yaml$|scripts/ci/pre_commit/pre_commit_check_provider_yaml_files\.py$|^docs/ - additional_dependencies: ['PyYAML==5.3.1', 'jsonschema==3.2.0', 'tabulate==0.8.7'] + additional_dependencies: + - 'PyYAML==5.3.1' + - 'jsonschema==3.2.0' + - 'tabulate==0.8.7' + - 'jsonpath-ng==1.5.3' - id: mermaid name: Generate mermaid images entry: ./scripts/ci/pre_commit/pre_commit_mermaid.sh diff --git a/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py b/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py index 6019a60..b36c024 100755 --- a/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py +++ b/scripts/ci/pre_commit/pre_commit_check_provider_yaml_files.py @@ -27,6 +27,7 @@ from typing import Any, Dict, Iterable, List import jsonschema import yaml +from jsonpath_ng.ext import parse from tabulate import tabulate try: @@ -42,6 +43,9 @@ if __name__ != "__main__": ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir)) DOCS_DIR = os.path.join(ROOT_DIR, 'docs') PROVIDER_DATA_SCHEMA_PATH = os.path.join(ROOT_DIR, "airflow", "provider.yaml.schema.json") +PROVIDER_ISSUE_TEMPLATE_PATH = os.path.join( + ROOT_DIR, ".github", "ISSUE_TEMPLATE", "airflow_providers_bug_report.yml" +) CORE_INTEGRATIONS = ["SQL", "Local"] errors = [] @@ -329,6 +333,24 @@ def check_unique_provider_name(yaml_files: Dict[str, Dict]): errors.append(f"Provider name must be unique. Duplicates: {duplicates}") +def check_providers_are_mentioned_in_issue_template(yaml_files: Dict[str, Dict]): + prefix_len = len("apache-airflow-providers-") + short_provider_names = [d['package-name'][prefix_len:] for d in yaml_files.values()] + jsonpath_expr = parse('$.body[?(@.attributes.label == "Apache Airflow Provider")]..options[*]') + with open(PROVIDER_ISSUE_TEMPLATE_PATH) as issue_file: + issue_template = yaml.safe_load(issue_file) + all_mentioned_providers = [match.value for match in jsonpath_expr.find(issue_template)] + try: + print( + f" -- Checking providers: present in code(left), " + f"mentioned in {PROVIDER_ISSUE_TEMPLATE_PATH} (right)" + ) + assert_sets_equal(set(short_provider_names), set(all_mentioned_providers)) + except AssertionError as ex: + print(ex) + sys.exit(1) + + if __name__ == '__main__': all_provider_files = sorted(glob(f"{ROOT_DIR}/airflow/providers/**/provider.yaml", recursive=True)) if len(sys.argv) > 1: @@ -348,6 +370,7 @@ if __name__ == '__main__': check_duplicates_in_list_of_transfers(all_parsed_yaml_files) check_hook_classes(all_parsed_yaml_files) check_unique_provider_name(all_parsed_yaml_files) + check_providers_are_mentioned_in_issue_template(all_parsed_yaml_files) if all_files_loaded: # Only check those if all provider files are loaded
