From 6a95939bf902711c08c406923d4ba9e811fb28b8 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Wed, 13 Nov 2024 09:59:09 +0100 Subject: [PATCH 1/4] Do not fail fast for ci runs We still would like to see the other versions' results if one version fails. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 006f2cda..cf71cba8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ jobs: runs-on: ubuntu-latest name: build (${{matrix.env.URSIM_VERSION}}-${{matrix.env.ROBOT_MODEL}}) strategy: + fail-fast: false matrix: env: - DOCKER_RUN_OPTS: --network ursim_net From 4b7ad3d56cdb9dd84486800a02d14fe843b6c3e0 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Wed, 13 Nov 2024 10:08:37 +0100 Subject: [PATCH 2/4] Add debug-logging the dashboard call's answer --- src/ur/dashboard_client.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ur/dashboard_client.cpp b/src/ur/dashboard_client.cpp index 95a26617..8469a766 100644 --- a/src/ur/dashboard_client.cpp +++ b/src/ur/dashboard_client.cpp @@ -156,6 +156,7 @@ bool DashboardClient::sendRequest(const std::string& command, const std::string& { URCL_LOG_DEBUG("Send Request: %s", command.c_str()); std::string response = sendAndReceive(command); + URCL_LOG_DEBUG("Got Response: %s", response.c_str()); bool ret = std::regex_match(response, std::regex(expected)); if (!ret) { From 060f7a702266667e0f0355158781b9aaf5214d64 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Wed, 13 Nov 2024 12:40:29 +0100 Subject: [PATCH 3/4] Add a short sleep after powering on the robot It seems like this could lead to flakiness in CI otherwise. --- examples/dashboard_example.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/dashboard_example.cpp b/examples/dashboard_example.cpp index 9f4515b7..81eda8cb 100644 --- a/examples/dashboard_example.cpp +++ b/examples/dashboard_example.cpp @@ -36,6 +36,7 @@ #include #include #include +#include using namespace urcl; @@ -96,6 +97,8 @@ int main(int argc, char* argv[]) return 1; } + sleep(1); + // Play loaded program if (!my_dashboard->commandPlay()) { From 26f59498f8a9df5a5a052a899236a8196630be02 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Fri, 15 Nov 2024 10:31:57 +0100 Subject: [PATCH 4/4] Update check_links script and add kernel URL to ignore pattern The updated check_links script is already used in the ROS 2 driver repo. It seems to be working great so far and allows regular expressions to ignore specific URLs. --- .github/helpers/check_urls.sh | 46 ++++++++++++++++++++++++++++++++--- .github/workflows/ci.yml | 14 +++-------- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/.github/helpers/check_urls.sh b/.github/helpers/check_urls.sh index 2bccc8d7..5d3662ee 100755 --- a/.github/helpers/check_urls.sh +++ b/.github/helpers/check_urls.sh @@ -2,14 +2,54 @@ set -e +IGNORE_FILES="" +IGNORE_PATTERNS="" + +while getopts ":f:d:p:" opt; do + case "${opt}" in + f) + IGNORE_FILES="${OPTARG}";; + d) + IGNORE_DIRS="${OPTARG}";; + p) + IGNORE_PATTERNS="${OPTARG}";; + \?) + echo "Invalid option -$OPTARG" + exit;; + esac +done + +read -r -a ignore_files <<<"$IGNORE_FILES" +read -r -a ignore_dirs <<<"$IGNORE_DIRS" +read -r -a ignore_patterns <<<"$IGNORE_PATTERNS" + +IGNORE_FILES_ARG="" +for item in "${ignore_files[@]}"; do + IGNORE_FILES_ARG="$IGNORE_FILES_ARG --exclude=$item" +done +IGNORE_DIRS_ARG="" +for item in "${ignore_dirs[@]}"; do + IGNORE_DIRS_ARG="$IGNORE_DIRS_ARG --exclude-dir=$item" +done + #Find URLs in code: -urls=$(grep -oP "(http|ftp|https):\/\/([a-zA-Z0-9_-]+(?:(?:\.[a-zA-Z0-9_-]+)+))([a-zA-Z0-9_.,@?^=%&:\/~+#-]*[a-zA-Z0-9_@?^=%&\/~+#-])?" "$@") +urls=$(grep -oP '(http|ftp|https):\/\/([a-zA-Z0-9_-]+(?:(?:\.[a-zA-Z0-9_-]+)+))([a-zA-Z0-9_.,@?^=%&:\/~+#-]*[a-zA-Z0-9_@?^=%&\/~+#-])?' -rI $IGNORE_FILES_ARG $IGNORE_DIRS_ARG) fail_counter=0 FAILED_LINKS=() for item in $urls; do -# echo $item +# echo $item + skip=0 + for pattern in "${ignore_patterns[@]}"; do + [[ "$item" =~ $pattern ]] && skip=1 + done + + if [[ $skip == 1 ]]; then + echo "SKIPPING $item" + continue + fi + filename=$(echo "$item" | cut -d':' -f1) url=$(echo "$item" | cut -d':' -f2-) echo -n "Checking $url from file $filename" @@ -24,4 +64,4 @@ done echo "Failed files:" printf '%s\n' "${FAILED_LINKS[@]}" -exit $fail_counter +exit $fail_counter \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf71cba8..d70ba729 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,16 +99,10 @@ jobs: - uses: actions/checkout@v2 - name: Check URLs run: | - .github/helpers/check_urls.sh -rI \ - --exclude-dir=.git \ - --exclude-dir=build/ \ - --exclude-dir=tests \ - --exclude=package.xml \ - --exclude-dir=CMakeModules \ - --exclude=tcp_socket.cpp \ - --exclude-dir=debian \ - --exclude=dataflow.graphml \ - --exclude=start_ursim.sh + .github/helpers/check_urls.sh \ + -d ".git build CMakeModules debian" \ + -f "package.xml architecture_coarse.svg dataflow.graphml start_ursim.sh" \ + -p "vnc\.html opensource\.org\/licenses\/BSD-3-Clause kernel\.org\/pub\/linux\/kernel" rosdoc_lite_check: runs-on: ubuntu-latest