From d97319c317de596a8d76bbb7d90259bd73f96880 Mon Sep 17 00:00:00 2001 From: Ilia Kurenkov Date: Wed, 11 Sep 2024 14:30:51 +0200 Subject: [PATCH] Adjust labeler config and ddev tests to how pyyaml indents lists (#18565) - We update the labeler config to satisfy the validation. - We change our tests so that they catch this next time it changes from under us. --- .github/workflows/config/labeler.yml | 560 ++++++++++++------------ ddev/tests/cli/validate/test_labeler.py | 23 +- 2 files changed, 293 insertions(+), 290 deletions(-) diff --git a/.github/workflows/config/labeler.yml b/.github/workflows/config/labeler.yml index e558230a0bf92..0ad31ea98bfa1 100644 --- a/.github/workflows/config/labeler.yml +++ b/.github/workflows/config/labeler.yml @@ -1,571 +1,571 @@ base_package: - - datadog_checks_base/**/* +- datadog_checks_base/**/* changelog/no-changelog: - - any: - - requirements-agent-release.txt - - "**/__about__.py" - - all: - - "!*/datadog_checks/**" - - "!*/pyproject.toml" - - "!ddev/src/**" +- any: + - requirements-agent-release.txt + - '**/__about__.py' +- all: + - '!*/datadog_checks/**' + - '!*/pyproject.toml' + - '!ddev/src/**' ddev: - - ddev/**/* +- ddev/**/* dependencies: - - agent_requirements.in +- agent_requirements.in dependency_provider: - - datadog_checks_dependency_provider/**/* +- datadog_checks_dependency_provider/**/* dev/testing: - - .github/workflows/** - - .codecov.yml +- .github/workflows/** +- .codecov.yml dev/tooling: - - .github/workflows/** - - .github/stale.yml - - .gitlab/** - - .gitlab-ci.yml - - datadog_checks_dev/datadog_checks/dev/tooling/** +- .github/workflows/** +- .github/stale.yml +- .gitlab/** +- .gitlab-ci.yml +- datadog_checks_dev/datadog_checks/dev/tooling/** dev_package: - - datadog_checks_dev/**/* +- datadog_checks_dev/**/* documentation: - - "*/manifest.json" - - "*/assets/configuration/**" - - "*/CHANGELOG.md" - - "*/README.md" - - docs/** +- '*/manifest.json' +- '*/assets/configuration/**' +- '*/CHANGELOG.md' +- '*/README.md' +- docs/** downloader: - - datadog_checks_downloader/**/* +- datadog_checks_downloader/**/* integration/active_directory: - - active_directory/**/* +- active_directory/**/* integration/activemq: - - activemq/**/* +- activemq/**/* integration/activemq_xml: - - activemq_xml/**/* +- activemq_xml/**/* integration/aerospike: - - aerospike/**/* +- aerospike/**/* integration/agent_metrics: - - agent_metrics/**/* +- agent_metrics/**/* integration/airbyte: - - airbyte/**/* +- airbyte/**/* integration/airflow: - - airflow/**/* +- airflow/**/* integration/amazon_eks: - - amazon_eks/**/* +- amazon_eks/**/* integration/amazon_eks_blueprints: - - amazon_eks_blueprints/**/* +- amazon_eks_blueprints/**/* integration/amazon_msk: - - amazon_msk/**/* +- amazon_msk/**/* integration/ambari: - - ambari/**/* +- ambari/**/* integration/apache: - - apache/**/* +- apache/**/* integration/arangodb: - - arangodb/**/* +- arangodb/**/* integration/argo_rollouts: - - argo_rollouts/**/* +- argo_rollouts/**/* integration/argo_workflows: - - argo_workflows/**/* +- argo_workflows/**/* integration/argocd: - - argocd/**/* +- argocd/**/* integration/aspdotnet: - - aspdotnet/**/* +- aspdotnet/**/* integration/avi_vantage: - - avi_vantage/**/* +- avi_vantage/**/* integration/aws_neuron: - - aws_neuron/**/* +- aws_neuron/**/* integration/azure_active_directory: - - azure_active_directory/**/* +- azure_active_directory/**/* integration/azure_iot_edge: - - azure_iot_edge/**/* +- azure_iot_edge/**/* integration/boundary: - - boundary/**/* +- boundary/**/* integration/btrfs: - - btrfs/**/* +- btrfs/**/* integration/cacti: - - cacti/**/* +- cacti/**/* integration/calico: - - calico/**/* +- calico/**/* integration/cassandra: - - cassandra/**/* +- cassandra/**/* integration/cassandra_nodetool: - - cassandra_nodetool/**/* +- cassandra_nodetool/**/* integration/ceph: - - ceph/**/* +- ceph/**/* integration/cert_manager: - - cert_manager/**/* +- cert_manager/**/* integration/checkpoint_quantum_firewall: - - checkpoint_quantum_firewall/**/* +- checkpoint_quantum_firewall/**/* integration/cilium: - - cilium/**/* +- cilium/**/* integration/cisco_aci: - - cisco_aci/**/* +- cisco_aci/**/* integration/cisco_duo: - - cisco_duo/**/* +- cisco_duo/**/* integration/cisco_sdwan: - - cisco_sdwan/**/* +- cisco_sdwan/**/* integration/cisco_secure_email_threat_defense: - cisco_secure_email_threat_defense/**/* integration/cisco_secure_endpoint: - - cisco_secure_endpoint/**/* +- cisco_secure_endpoint/**/* integration/cisco_secure_firewall: - - cisco_secure_firewall/**/* +- cisco_secure_firewall/**/* integration/cisco_umbrella_dns: - - cisco_umbrella_dns/**/* +- cisco_umbrella_dns/**/* integration/citrix_hypervisor: - - citrix_hypervisor/**/* +- citrix_hypervisor/**/* integration/clickhouse: - - clickhouse/**/* +- clickhouse/**/* integration/cloud_foundry_api: - - cloud_foundry_api/**/* +- cloud_foundry_api/**/* integration/cloudera: - - cloudera/**/* +- cloudera/**/* integration/cockroachdb: - - cockroachdb/**/* +- cockroachdb/**/* integration/confluent_platform: - - confluent_platform/**/* +- confluent_platform/**/* integration/consul: - - consul/**/* +- consul/**/* integration/consul_connect: - - consul_connect/**/* +- consul_connect/**/* integration/container: - - container/**/* +- container/**/* integration/containerd: - containerd/**/* integration/contentful: - contentful/**/* integration/coredns: - - coredns/**/* +- coredns/**/* integration/couch: - - couch/**/* +- couch/**/* integration/couchbase: - - couchbase/**/* +- couchbase/**/* integration/cri: - - cri/**/* +- cri/**/* integration/crio: - - crio/**/* +- crio/**/* integration/databricks: - - databricks/**/* +- databricks/**/* integration/datadog_checks_tests_helper: - - datadog_checks_tests_helper/**/* +- datadog_checks_tests_helper/**/* integration/datadog_cluster_agent: - - datadog_cluster_agent/**/* +- datadog_cluster_agent/**/* integration/datadog_operator: - - datadog_operator/**/* +- datadog_operator/**/* integration/dcgm: - - dcgm/**/* +- dcgm/**/* integration/directory: - - directory/**/* +- directory/**/* integration/disk: - - disk/**/* +- disk/**/* integration/dns_check: - - dns_check/**/* +- dns_check/**/* integration/docker_daemon: - docker_daemon/**/* integration/docusign: - docusign/**/* integration/dotnetclr: - - dotnetclr/**/* +- dotnetclr/**/* integration/druid: - - druid/**/* +- druid/**/* integration/ecs_fargate: - - ecs_fargate/**/* +- ecs_fargate/**/* integration/eks_anywhere: - - eks_anywhere/**/* +- eks_anywhere/**/* integration/eks_fargate: - - eks_fargate/**/* +- eks_fargate/**/* integration/elastic: - - elastic/**/* +- elastic/**/* integration/envoy: - - envoy/**/* +- envoy/**/* integration/esxi: - - esxi/**/* +- esxi/**/* integration/etcd: - - etcd/**/* +- etcd/**/* integration/exchange_server: - - exchange_server/**/* +- exchange_server/**/* integration/external_dns: - - external_dns/**/* +- external_dns/**/* integration/flink: - - flink/**/* +- flink/**/* integration/fluentd: - - fluentd/**/* +- fluentd/**/* integration/fluxcd: - - fluxcd/**/* +- fluxcd/**/* integration/fly_io: - - fly_io/**/* +- fly_io/**/* integration/foundationdb: - - foundationdb/**/* +- foundationdb/**/* integration/gearmand: - - gearmand/**/* +- gearmand/**/* integration/gitlab: - - gitlab/**/* +- gitlab/**/* integration/gitlab_runner: - - gitlab_runner/**/* +- gitlab_runner/**/* integration/gke: - - gke/**/* +- gke/**/* integration/glusterfs: - glusterfs/**/* -integration/godaddy: -- godaddy/**/* integration/go-metro: - - go-metro/**/* +- go-metro/**/* integration/go_expvar: - - go_expvar/**/* +- go_expvar/**/* +integration/godaddy: +- godaddy/**/* integration/gunicorn: - - gunicorn/**/* +- gunicorn/**/* integration/haproxy: - - haproxy/**/* +- haproxy/**/* integration/harbor: - - harbor/**/* +- harbor/**/* integration/hazelcast: - - hazelcast/**/* +- hazelcast/**/* integration/hdfs_datanode: - - hdfs_datanode/**/* +- hdfs_datanode/**/* integration/hdfs_namenode: - - hdfs_namenode/**/* +- hdfs_namenode/**/* integration/helm: - - helm/**/* +- helm/**/* integration/hive: - - hive/**/* +- hive/**/* integration/hivemq: - - hivemq/**/* +- hivemq/**/* integration/http_check: - - http_check/**/* +- http_check/**/* integration/hudi: - - hudi/**/* +- hudi/**/* integration/hyperv: - - hyperv/**/* +- hyperv/**/* integration/iam_access_analyzer: - - iam_access_analyzer/**/* +- iam_access_analyzer/**/* integration/ibm_ace: - - ibm_ace/**/* +- ibm_ace/**/* integration/ibm_db2: - - ibm_db2/**/* +- ibm_db2/**/* integration/ibm_i: - - ibm_i/**/* +- ibm_i/**/* integration/ibm_mq: - - ibm_mq/**/* +- ibm_mq/**/* integration/ibm_was: - - ibm_was/**/* +- ibm_was/**/* integration/ignite: - - ignite/**/* +- ignite/**/* integration/iis: - - iis/**/* +- iis/**/* integration/impala: - - impala/**/* +- impala/**/* integration/istio: - - istio/**/* +- istio/**/* integration/jboss_wildfly: - - jboss_wildfly/**/* +- jboss_wildfly/**/* integration/jmeter: - - jmeter/**/* +- jmeter/**/* integration/journald: - - journald/**/* +- journald/**/* integration/kafka: - - kafka/**/* +- kafka/**/* integration/kafka_consumer: - - kafka_consumer/**/* +- kafka_consumer/**/* integration/karpenter: - - karpenter/**/* +- karpenter/**/* integration/kong: - - kong/**/* +- kong/**/* integration/kube_apiserver_metrics: - - kube_apiserver_metrics/**/* +- kube_apiserver_metrics/**/* integration/kube_controller_manager: - - kube_controller_manager/**/* +- kube_controller_manager/**/* integration/kube_dns: - - kube_dns/**/* +- kube_dns/**/* integration/kube_metrics_server: - - kube_metrics_server/**/* +- kube_metrics_server/**/* integration/kube_proxy: - - kube_proxy/**/* +- kube_proxy/**/* integration/kube_scheduler: - - kube_scheduler/**/* +- kube_scheduler/**/* integration/kubeflow: - - kubeflow/**/* +- kubeflow/**/* integration/kubelet: - - kubelet/**/* +- kubelet/**/* integration/kubernetes: - - kubernetes/**/* +- kubernetes/**/* integration/kubernetes_cluster_autoscaler: - - kubernetes_cluster_autoscaler/**/* +- kubernetes_cluster_autoscaler/**/* integration/kubernetes_state: - - kubernetes_state/**/* +- kubernetes_state/**/* integration/kubernetes_state_core: - kubernetes_state_core/**/* integration/kubevirt_api: - kubevirt_api/**/* integration/kyototycoon: - - kyototycoon/**/* +- kyototycoon/**/* integration/kyverno: - - kyverno/**/* +- kyverno/**/* integration/langchain: - langchain/**/* integration/lastpass: - lastpass/**/* integration/lighttpd: - - lighttpd/**/* +- lighttpd/**/* integration/linkerd: - - linkerd/**/* +- linkerd/**/* integration/linux_proc_extras: - linux_proc_extras/**/* integration/mailchimp: - mailchimp/**/* integration/mapr: - - mapr/**/* +- mapr/**/* integration/mapreduce: - - mapreduce/**/* +- mapreduce/**/* integration/marathon: - - marathon/**/* +- marathon/**/* integration/marklogic: - - marklogic/**/* +- marklogic/**/* integration/mcache: - - mcache/**/* +- mcache/**/* integration/mesos_master: - - mesos_master/**/* +- mesos_master/**/* integration/mesos_slave: - - mesos_slave/**/* +- mesos_slave/**/* integration/mimecast: - - mimecast/**/* +- mimecast/**/* integration/mongo: - - mongo/**/* +- mongo/**/* integration/mysql: - - mysql/**/* +- mysql/**/* integration/nagios: - - nagios/**/* +- nagios/**/* integration/network: - - network/**/* +- network/**/* integration/network_path: - - network_path/**/* +- network_path/**/* integration/nfsstat: - - nfsstat/**/* +- nfsstat/**/* integration/nginx: - - nginx/**/* +- nginx/**/* integration/nginx_ingress_controller: - - nginx_ingress_controller/**/* +- nginx_ingress_controller/**/* integration/ntp: - - ntp/**/* +- ntp/**/* integration/nvidia_jetson: - - nvidia_jetson/**/* +- nvidia_jetson/**/* integration/nvidia_triton: - - nvidia_triton/**/* +- nvidia_triton/**/* integration/oke: - - oke/**/* +- oke/**/* integration/oom_kill: - - oom_kill/**/* +- oom_kill/**/* integration/openai: - - openai/**/* +- openai/**/* integration/openldap: - - openldap/**/* +- openldap/**/* integration/openmetrics: - - openmetrics/**/* +- openmetrics/**/* integration/openshift: - - openshift/**/* +- openshift/**/* integration/openstack: - - openstack/**/* +- openstack/**/* integration/openstack_controller: - - openstack_controller/**/* +- openstack_controller/**/* integration/oracle: - - oracle/**/* +- oracle/**/* integration/ossec_security: - - ossec_security/**/* +- ossec_security/**/* integration/otel: - - otel/**/* +- otel/**/* integration/palo_alto_cortex_xdr: - - palo_alto_cortex_xdr/**/* +- palo_alto_cortex_xdr/**/* integration/palo_alto_panorama: - - palo_alto_panorama/**/* +- palo_alto_panorama/**/* integration/pan_firewall: - - pan_firewall/**/* +- pan_firewall/**/* integration/pdh_check: - - pdh_check/**/* +- pdh_check/**/* integration/pgbouncer: - - pgbouncer/**/* +- pgbouncer/**/* integration/php_fpm: - - php_fpm/**/* +- php_fpm/**/* integration/ping_federate: - - ping_federate/**/* +- ping_federate/**/* integration/ping_one: - - ping_one/**/* +- ping_one/**/* integration/pivotal_pks: - - pivotal_pks/**/* +- pivotal_pks/**/* integration/podman: - - podman/**/* +- podman/**/* integration/postfix: - - postfix/**/* +- postfix/**/* integration/postgres: - - postgres/**/* +- postgres/**/* integration/powerdns_recursor: - - powerdns_recursor/**/* +- powerdns_recursor/**/* integration/presto: - - presto/**/* +- presto/**/* integration/process: - - process/**/* +- process/**/* integration/prometheus: - - prometheus/**/* +- prometheus/**/* integration/proxysql: - - proxysql/**/* +- proxysql/**/* integration/pulsar: - - pulsar/**/* +- pulsar/**/* integration/rabbitmq: - - rabbitmq/**/* +- rabbitmq/**/* integration/ray: - - ray/**/* +- ray/**/* integration/redisdb: - - redisdb/**/* +- redisdb/**/* integration/rethinkdb: - - rethinkdb/**/* +- rethinkdb/**/* integration/riak: - - riak/**/* +- riak/**/* integration/riakcs: - riakcs/**/* integration/ringcentral: - ringcentral/**/* integration/sap_hana: - - sap_hana/**/* +- sap_hana/**/* integration/scylla: - - scylla/**/* +- scylla/**/* integration/sidekiq: - - sidekiq/**/* +- sidekiq/**/* integration/silk: - - silk/**/* +- silk/**/* integration/singlestore: - - singlestore/**/* +- singlestore/**/* integration/snmp: - - snmp/**/* +- snmp/**/* integration/snmp_american_power_conversion: - - snmp_american_power_conversion/**/* +- snmp_american_power_conversion/**/* integration/snmp_arista: - - snmp_arista/**/* +- snmp_arista/**/* integration/snmp_aruba: - - snmp_aruba/**/* +- snmp_aruba/**/* integration/snmp_chatsworth_products: - - snmp_chatsworth_products/**/* +- snmp_chatsworth_products/**/* integration/snmp_check_point: - - snmp_check_point/**/* +- snmp_check_point/**/* integration/snmp_cisco: - - snmp_cisco/**/* +- snmp_cisco/**/* integration/snmp_dell: - - snmp_dell/**/* +- snmp_dell/**/* integration/snmp_f5: - - snmp_f5/**/* +- snmp_f5/**/* integration/snmp_fortinet: - - snmp_fortinet/**/* +- snmp_fortinet/**/* integration/snmp_hewlett_packard_enterprise: - - snmp_hewlett_packard_enterprise/**/* +- snmp_hewlett_packard_enterprise/**/* integration/snmp_juniper: - - snmp_juniper/**/* +- snmp_juniper/**/* integration/snmp_netapp: - - snmp_netapp/**/* +- snmp_netapp/**/* integration/snowflake: - - snowflake/**/* +- snowflake/**/* integration/solr: - - solr/**/* +- solr/**/* integration/sonarqube: - - sonarqube/**/* +- sonarqube/**/* integration/sophos_central_cloud: - - sophos_central_cloud/**/* +- sophos_central_cloud/**/* integration/spark: - - spark/**/* +- spark/**/* integration/sqlserver: - - sqlserver/**/* +- sqlserver/**/* integration/squid: - - squid/**/* +- squid/**/* integration/ssh_check: - - ssh_check/**/* +- ssh_check/**/* integration/statsd: - - statsd/**/* +- statsd/**/* integration/strimzi: - - strimzi/**/* +- strimzi/**/* integration/supervisord: - - supervisord/**/* +- supervisord/**/* integration/suricata: - - suricata/**/* +- suricata/**/* integration/system_core: - - system_core/**/* +- system_core/**/* integration/system_swap: - - system_swap/**/* +- system_swap/**/* integration/systemd: - - systemd/**/* +- systemd/**/* integration/tcp_check: - - tcp_check/**/* +- tcp_check/**/* integration/tcp_queue_length: - - tcp_queue_length/**/* +- tcp_queue_length/**/* integration/teamcity: - - teamcity/**/* +- teamcity/**/* integration/tekton: - - tekton/**/* +- tekton/**/* integration/teleport: - - teleport/**/* +- teleport/**/* integration/temporal: - - temporal/**/* +- temporal/**/* integration/tenable: - - tenable/**/* +- tenable/**/* integration/teradata: - - teradata/**/* +- teradata/**/* integration/terraform: - - terraform/**/* +- terraform/**/* integration/tibco_ems: - - tibco_ems/**/* +- tibco_ems/**/* integration/tls: - - tls/**/* +- tls/**/* integration/tokumx: - - tokumx/**/* +- tokumx/**/* integration/tomcat: - - tomcat/**/* +- tomcat/**/* integration/torchserve: - - torchserve/**/* +- torchserve/**/* integration/traefik_mesh: - - traefik_mesh/**/* +- traefik_mesh/**/* integration/traffic_server: - - traffic_server/**/* +- traffic_server/**/* integration/trend_micro_email_security: - - trend_micro_email_security/**/* +- trend_micro_email_security/**/* integration/trend_micro_vision_one_endpoint_security: - - trend_micro_vision_one_endpoint_security/**/* +- trend_micro_vision_one_endpoint_security/**/* integration/trend_micro_vision_one_xdr: - trend_micro_vision_one_xdr/**/* integration/twemproxy: - - twemproxy/**/* +- twemproxy/**/* integration/twistlock: - - twistlock/**/* +- twistlock/**/* integration/varnish: - - varnish/**/* +- varnish/**/* integration/vault: - - vault/**/* +- vault/**/* integration/vertica: - - vertica/**/* +- vertica/**/* integration/vllm: - - vllm/**/* +- vllm/**/* integration/voltdb: - - voltdb/**/* +- voltdb/**/* integration/vsphere: - - vsphere/**/* +- vsphere/**/* integration/weaviate: - - weaviate/**/* +- weaviate/**/* integration/weblogic: - - weblogic/**/* +- weblogic/**/* integration/win32_event_log: - - win32_event_log/**/* +- win32_event_log/**/* integration/wincrashdetect: - - wincrashdetect/**/* +- wincrashdetect/**/* integration/windows_performance_counters: - - windows_performance_counters/**/* +- windows_performance_counters/**/* integration/windows_registry: - - windows_registry/**/* +- windows_registry/**/* integration/windows_service: - - windows_service/**/* +- windows_service/**/* integration/winkmem: - - winkmem/**/* +- winkmem/**/* integration/wmi_check: - - wmi_check/**/* +- wmi_check/**/* integration/yarn: - - yarn/**/* +- yarn/**/* integration/zeek: - - zeek/**/* +- zeek/**/* integration/zk: - - zk/**/* +- zk/**/* qa/skip-qa: - - "**/__about__.py" - - requirements-agent-release.txt - - "*/CHANGELOG.md" +- '**/__about__.py' +- requirements-agent-release.txt +- '*/CHANGELOG.md' release: - - "**/__about__.py" +- '**/__about__.py' diff --git a/ddev/tests/cli/validate/test_labeler.py b/ddev/tests/cli/validate/test_labeler.py index 6fada7407c904..981d3edac1415 100644 --- a/ddev/tests/cli/validate/test_labeler.py +++ b/ddev/tests/cli/validate/test_labeler.py @@ -4,7 +4,6 @@ import os import pytest -import yaml @pytest.mark.parametrize('repo_fixture', ['fake_extras_repo', 'fake_marketplace_repo']) @@ -113,7 +112,8 @@ def test_labeler_sync_add_integration_in_config(fake_repo, ddev): def test_labeler_fix_existing_integration_in_config(fake_repo, ddev): (fake_repo.path / '.github' / 'workflows' / 'config' / 'labeler.yml').write_text( - """changelog/no-changelog: + """\ +changelog/no-changelog: - any: - requirements-agent-release.txt - '*/__about__.py' @@ -129,7 +129,7 @@ def test_labeler_fix_existing_integration_in_config(fake_repo, ddev): - something release: - '*/__about__.py' - """, +""", ) result = ddev('validate', 'labeler', '--sync') @@ -144,8 +144,7 @@ def test_labeler_fix_existing_integration_in_config(fake_repo, ddev): def labeler_test_config(integrations): - config = yaml.safe_load( - """ + config = """\ changelog/no-changelog: - any: - requirements-agent-release.txt @@ -156,12 +155,16 @@ def labeler_test_config(integrations): - '!ddev/src/**' integration/datadog_checks_tests_helper: - datadog_checks_tests_helper/**/* -release: -- '*/__about__.py' """ - ) for integration in integrations: - config[f"integration/{integration}"] = [f"{integration}/**/*"] + config += f"""\ +integration/{integration}: +- {integration}/**/* +""" + config += """\ +release: +- '*/__about__.py' +""" - return yaml.dump(config, default_flow_style=False, sort_keys=True) + return config