mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
Merge branch 'ci/consider_more_components_dirs' into 'master'
ci: improve get_mr_components, take more components into consideration See merge request espressif/esp-idf!30673
This commit is contained in:
commit
5b93f4e552
@ -49,7 +49,6 @@ examples/ethernet/iperf:
|
|||||||
- console
|
- console
|
||||||
- esp_driver_gpio
|
- esp_driver_gpio
|
||||||
- esp_driver_spi
|
- esp_driver_spi
|
||||||
depends_filepatterns:
|
- cmd_system
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
- ethernet_init
|
||||||
- examples/system/console/advanced/components/cmd_system/**/*
|
- protocol_examples_common
|
||||||
- examples/ethernet/basic/components/ethernet_init/**/*
|
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
- esp_coex
|
- esp_coex
|
||||||
- esp_phy
|
- esp_phy
|
||||||
- ieee802154
|
- ieee802154
|
||||||
|
- cmd_system
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/ieee802154/**/*
|
- examples/ieee802154/**/*
|
||||||
- examples/system/console/advanced/components/cmd_system/**/*
|
|
||||||
|
|
||||||
examples/ieee802154/ieee802154_cli:
|
examples/ieee802154/ieee802154_cli:
|
||||||
enable:
|
enable:
|
||||||
|
@ -26,7 +26,6 @@ examples/network/simple_sniffer:
|
|||||||
reason: lack of runners
|
reason: lack of runners
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- tools/ci/python_packages/common_test_methods.py
|
- tools/ci/python_packages/common_test_methods.py
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- examples/protocols/**/*
|
- examples/protocols/**/*
|
||||||
- examples/wifi/**/*
|
- examples/wifi/**/*
|
||||||
- examples/network/simple_sniffer/**/*
|
- examples/network/simple_sniffer/**/*
|
||||||
@ -35,6 +34,7 @@ examples/network/simple_sniffer:
|
|||||||
depends_components:
|
depends_components:
|
||||||
- app_update
|
- app_update
|
||||||
- esp_https_ota
|
- esp_https_ota
|
||||||
|
- protocol_examples_common
|
||||||
|
|
||||||
examples/network/sta2eth:
|
examples/network/sta2eth:
|
||||||
disable:
|
disable:
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
|
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
|
||||||
|
|
||||||
.default_dependencies: &default_dependencies
|
.default_dependencies: &default_dependencies
|
||||||
depends_filepatterns:
|
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
depends_components:
|
depends_components:
|
||||||
- lwip
|
- lwip
|
||||||
- esp_netif
|
- esp_netif
|
||||||
@ -10,6 +8,7 @@
|
|||||||
- esp_phy
|
- esp_phy
|
||||||
- esp_eth
|
- esp_eth
|
||||||
- mbedtls
|
- mbedtls
|
||||||
|
- protocol_examples_common
|
||||||
|
|
||||||
examples/protocols/esp_http_client:
|
examples/protocols/esp_http_client:
|
||||||
<<: *default_dependencies
|
<<: *default_dependencies
|
||||||
@ -22,7 +21,6 @@ examples/protocols/esp_http_client:
|
|||||||
disable_test:
|
disable_test:
|
||||||
- if: IDF_TARGET not in ["esp32", "linux"]
|
- if: IDF_TARGET not in ["esp32", "linux"]
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/esp_http_client/**/*
|
- components/esp_http_client/**/*
|
||||||
|
|
||||||
examples/protocols/esp_local_ctrl:
|
examples/protocols/esp_local_ctrl:
|
||||||
@ -35,7 +33,6 @@ examples/protocols/esp_local_ctrl:
|
|||||||
- if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"]
|
- if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"]
|
||||||
reason: only test on these targets
|
reason: only test on these targets
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/protocomm/**/*
|
- components/protocomm/**/*
|
||||||
- tools/esp_prov/**/*
|
- tools/esp_prov/**/*
|
||||||
|
|
||||||
@ -59,7 +56,6 @@ examples/protocols/http_server:
|
|||||||
- if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"]
|
- if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"]
|
||||||
reason: only test on these targets
|
reason: only test on these targets
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/esp_http_server/**/*
|
- components/esp_http_server/**/*
|
||||||
|
|
||||||
examples/protocols/http_server/captive_portal:
|
examples/protocols/http_server/captive_portal:
|
||||||
@ -72,7 +68,6 @@ examples/protocols/http_server/captive_portal:
|
|||||||
- if: IDF_TARGET != "esp32"
|
- if: IDF_TARGET != "esp32"
|
||||||
reason: only test on esp32
|
reason: only test on esp32
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/esp_http_server/**/*
|
- components/esp_http_server/**/*
|
||||||
|
|
||||||
examples/protocols/http_server/restful_server:
|
examples/protocols/http_server/restful_server:
|
||||||
@ -82,7 +77,6 @@ examples/protocols/http_server/restful_server:
|
|||||||
temporary: true
|
temporary: true
|
||||||
reason: not supported yet # TODO: [ESP32C5] IDF-8697
|
reason: not supported yet # TODO: [ESP32C5] IDF-8697
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/esp_http_server/**/*
|
- components/esp_http_server/**/*
|
||||||
|
|
||||||
examples/protocols/http_server/ws_echo_server:
|
examples/protocols/http_server/ws_echo_server:
|
||||||
@ -95,7 +89,6 @@ examples/protocols/http_server/ws_echo_server:
|
|||||||
- if: IDF_TARGET != "esp32"
|
- if: IDF_TARGET != "esp32"
|
||||||
reason: only test on esp32
|
reason: only test on esp32
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/esp_http_server/**/*
|
- components/esp_http_server/**/*
|
||||||
|
|
||||||
examples/protocols/https_mbedtls:
|
examples/protocols/https_mbedtls:
|
||||||
@ -130,7 +123,6 @@ examples/protocols/https_server/simple:
|
|||||||
- if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"]
|
- if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"]
|
||||||
reason: only test on these targets
|
reason: only test on these targets
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/esp_https_server/**/*
|
- components/esp_https_server/**/*
|
||||||
- components/esp_tls/**/*
|
- components/esp_tls/**/*
|
||||||
|
|
||||||
@ -144,7 +136,6 @@ examples/protocols/https_server/wss_server:
|
|||||||
- if: IDF_TARGET != "esp32"
|
- if: IDF_TARGET != "esp32"
|
||||||
reason: only test on esp32
|
reason: only test on esp32
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/esp_https_server/**/*
|
- components/esp_https_server/**/*
|
||||||
|
|
||||||
examples/protocols/https_x509_bundle:
|
examples/protocols/https_x509_bundle:
|
||||||
@ -157,7 +148,6 @@ examples/protocols/https_x509_bundle:
|
|||||||
- if: IDF_TARGET != "esp32"
|
- if: IDF_TARGET != "esp32"
|
||||||
reason: only test on esp32
|
reason: only test on esp32
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/esp_tls/**/*
|
- components/esp_tls/**/*
|
||||||
|
|
||||||
examples/protocols/icmp_echo:
|
examples/protocols/icmp_echo:
|
||||||
@ -186,7 +176,6 @@ examples/protocols/modbus:
|
|||||||
temporary: true
|
temporary: true
|
||||||
reason: not supported yet # TODO: [ESP32C5] IDF-8722, IDF-8697
|
reason: not supported yet # TODO: [ESP32C5] IDF-8722, IDF-8697
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- examples/protocols/modbus/mb_example_common/**/*
|
- examples/protocols/modbus/mb_example_common/**/*
|
||||||
|
|
||||||
examples/protocols/mqtt:
|
examples/protocols/mqtt:
|
||||||
@ -196,7 +185,6 @@ examples/protocols/mqtt:
|
|||||||
temporary: true
|
temporary: true
|
||||||
reason: not supported on c5 # TODO: [ESP32C5] IDF-8697
|
reason: not supported on c5 # TODO: [ESP32C5] IDF-8697
|
||||||
depends_filepatterns:
|
depends_filepatterns:
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
- components/mqtt/**/*
|
- components/mqtt/**/*
|
||||||
|
|
||||||
examples/protocols/mqtt/custom_outbox:
|
examples/protocols/mqtt/custom_outbox:
|
||||||
|
@ -148,8 +148,7 @@ examples/system/ota/advanced_https_ota:
|
|||||||
- esp_wifi
|
- esp_wifi
|
||||||
- esp_phy
|
- esp_phy
|
||||||
- bt
|
- bt
|
||||||
depends_filepatterns:
|
- protocol_examples_common
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
|
|
||||||
examples/system/ota/native_ota_example:
|
examples/system/ota/native_ota_example:
|
||||||
disable:
|
disable:
|
||||||
@ -166,8 +165,7 @@ examples/system/ota/native_ota_example:
|
|||||||
- esp_eth
|
- esp_eth
|
||||||
- esp_driver_gpio
|
- esp_driver_gpio
|
||||||
- bootloader_support
|
- bootloader_support
|
||||||
depends_filepatterns:
|
- protocol_examples_common
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
|
|
||||||
examples/system/ota/otatool:
|
examples/system/ota/otatool:
|
||||||
disable:
|
disable:
|
||||||
@ -191,8 +189,7 @@ examples/system/ota/pre_encrypted_ota:
|
|||||||
- esp_eth
|
- esp_eth
|
||||||
- mbedtls
|
- mbedtls
|
||||||
- bootloader_support
|
- bootloader_support
|
||||||
depends_filepatterns:
|
- protocol_examples_common
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
|
|
||||||
examples/system/ota/simple_ota_example:
|
examples/system/ota/simple_ota_example:
|
||||||
disable:
|
disable:
|
||||||
|
@ -12,8 +12,7 @@
|
|||||||
- nvs_flash
|
- nvs_flash
|
||||||
- console
|
- console
|
||||||
- esp_pm
|
- esp_pm
|
||||||
depends_filepatterns:
|
- protocol_examples_common
|
||||||
- examples/common_components/protocol_examples_common/**/*
|
|
||||||
|
|
||||||
examples/wifi:
|
examples/wifi:
|
||||||
<<: *wifi_depends_default
|
<<: *wifi_depends_default
|
||||||
@ -52,9 +51,6 @@ examples/wifi/iperf:
|
|||||||
- esp_event
|
- esp_event
|
||||||
- esp_coex
|
- esp_coex
|
||||||
- wpa_supplicant
|
- wpa_supplicant
|
||||||
depends_filepatterns:
|
|
||||||
- examples/common_components/iperf/**/*
|
|
||||||
- examples/system/console/advanced/components/cmd_system/**/*
|
|
||||||
|
|
||||||
examples/wifi/itwt:
|
examples/wifi/itwt:
|
||||||
<<: *wifi_depends_default
|
<<: *wifi_depends_default
|
||||||
|
@ -3,10 +3,9 @@
|
|||||||
# internal use only for CI
|
# internal use only for CI
|
||||||
# get latest MR information by source branch
|
# get latest MR information by source branch
|
||||||
#
|
#
|
||||||
# SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
|
# SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -14,6 +13,7 @@ import typing as t
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from gitlab_api import Gitlab
|
from gitlab_api import Gitlab
|
||||||
|
from idf_ci_utils import IDF_PATH
|
||||||
|
|
||||||
if t.TYPE_CHECKING:
|
if t.TYPE_CHECKING:
|
||||||
from gitlab.v4.objects import ProjectCommit, ProjectMergeRequest
|
from gitlab.v4.objects import ProjectCommit, ProjectMergeRequest
|
||||||
@ -59,6 +59,43 @@ def get_mr_commits(source_branch: str) -> t.List['ProjectCommit']:
|
|||||||
return list(mr.commits())
|
return list(mr.commits())
|
||||||
|
|
||||||
|
|
||||||
|
_COMPONENT_NAME_DIR_RECORDS = {}
|
||||||
|
|
||||||
|
|
||||||
|
def get_modified_component(filepath: str) -> t.Optional[str]:
|
||||||
|
"""Return the component name if the file is in a component directory, otherwise None."""
|
||||||
|
try:
|
||||||
|
f_path = Path(filepath).resolve().relative_to(IDF_PATH)
|
||||||
|
except ValueError: # not in IDF_PATH
|
||||||
|
return None
|
||||||
|
|
||||||
|
# skip md files, etc.
|
||||||
|
if f_path.suffix in ['.md', '.yml']:
|
||||||
|
return None
|
||||||
|
|
||||||
|
# skip test_apps files
|
||||||
|
if 'test_apps' in f_path.parts:
|
||||||
|
return None
|
||||||
|
|
||||||
|
component_parent_dirs = [f_path.parts[0]]
|
||||||
|
for part in f_path.parts[1:]:
|
||||||
|
if component_parent_dirs[-1] == 'components' or component_parent_dirs[-1].endswith('common_components'):
|
||||||
|
if part not in _COMPONENT_NAME_DIR_RECORDS:
|
||||||
|
print('Found component "%s" in path "%s"' % (part, component_parent_dirs))
|
||||||
|
_COMPONENT_NAME_DIR_RECORDS[part] = component_parent_dirs
|
||||||
|
elif _COMPONENT_NAME_DIR_RECORDS.get(part) != component_parent_dirs:
|
||||||
|
print(
|
||||||
|
'WARNING!!! Found component "%s" in path "%s" and "%s"'
|
||||||
|
% (part, component_parent_dirs, _COMPONENT_NAME_DIR_RECORDS.get(part))
|
||||||
|
)
|
||||||
|
|
||||||
|
return part
|
||||||
|
|
||||||
|
component_parent_dirs.append(part)
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_mr_components(
|
def get_mr_components(
|
||||||
source_branch: t.Optional[str] = None, modified_files: t.Optional[t.List[str]] = None
|
source_branch: t.Optional[str] = None, modified_files: t.Optional[t.List[str]] = None
|
||||||
) -> t.List[str]:
|
) -> t.List[str]:
|
||||||
@ -70,13 +107,9 @@ def get_mr_components(
|
|||||||
modified_files = get_mr_changed_files(source_branch)
|
modified_files = get_mr_changed_files(source_branch)
|
||||||
|
|
||||||
for f in modified_files:
|
for f in modified_files:
|
||||||
file = Path(f)
|
modified_component = get_modified_component(f)
|
||||||
if (
|
if modified_component:
|
||||||
file.parts[0] == 'components'
|
components.add(modified_component)
|
||||||
and 'test_apps' not in file.parts
|
|
||||||
and file.parts[-1] != '.build-test-rules.yml'
|
|
||||||
):
|
|
||||||
components.add(file.parts[1])
|
|
||||||
|
|
||||||
return list(components)
|
return list(components)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user