From fe0776a67a96208f84642a5177ea57fc2ad6db43 Mon Sep 17 00:00:00 2001 From: Paul MARTIN Date: Wed, 9 Sep 2026 23:10:05 +0200 Subject: [PATCH 1/5] Remove unused CI scripts Neither buildscripts/ci/linux/Dockerfile nor buildscripts/ci/tools/generateGitLog.sh has any consumer in muse_framework, MuseScore or Audacity. --- buildscripts/ci/linux/Dockerfile | 3 -- buildscripts/ci/tools/generateGitLog.sh | 46 ------------------------- 2 files changed, 49 deletions(-) delete mode 100644 buildscripts/ci/linux/Dockerfile delete mode 100755 buildscripts/ci/tools/generateGitLog.sh diff --git a/buildscripts/ci/linux/Dockerfile b/buildscripts/ci/linux/Dockerfile deleted file mode 100644 index be2606c80c..0000000000 --- a/buildscripts/ci/linux/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM library/ubuntu:18.04 -COPY setup.sh /setup.sh -RUN bash -ex setup.sh diff --git a/buildscripts/ci/tools/generateGitLog.sh b/buildscripts/ci/tools/generateGitLog.sh deleted file mode 100755 index 43cd207087..0000000000 --- a/buildscripts/ci/tools/generateGitLog.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: GPL-3.0-only -# MuseScore-Studio-CLA-applies -# -# MuseScore Studio -# Music Composition & Notation -# -# Copyright (C) 2021 MuseScore Limited and others -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see .set -e - -options="--all -10" -messages_command="git log --pretty=tformat:'%s' ${options[@]}" -lines_command="git log --pretty=tformat:'%h - __XX123XX__ ' ${options[@]}" - -# damn bash arrays -OLDIFS=$IFS -IFS=$'\n' - -messages=($(bash -c "$messages_command")) -lines=($(bash -c "$lines_command")) - -IFS=$OLDIFS - -mlen=${#messages[@]} -llen=${#lines[@]} - -OUTPUT=${OUTPUT}"" - -echo $OUTPUT - From 8d1f6b25387931e52a19a9161fb71cacda18d578 Mon Sep 17 00:00:00 2001 From: Paul MARTIN Date: Thu, 10 Sep 2026 19:20:57 +0200 Subject: [PATCH 2/5] Install requests before making the YouTube playlist info make_youtube_playlist_info.py imports requests, and its venv block only re-execs into an existing .venv rather than creating one. Skip the install when requests is already available, so this stays quiet on images that ship it and where pip refuses to touch a system Python. --- buildscripts/ci/learn/make_playlists_info_file.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildscripts/ci/learn/make_playlists_info_file.sh b/buildscripts/ci/learn/make_playlists_info_file.sh index 8a793ffb51..8ba1d84b3a 100644 --- a/buildscripts/ci/learn/make_playlists_info_file.sh +++ b/buildscripts/ci/learn/make_playlists_info_file.sh @@ -44,5 +44,7 @@ cat $ARTIFACTS_DIR/playlist.json echo "=== Make playlist for YouTube ===" +python3 -c "import requests" 2>/dev/null || pip install requests + HERE="$(cd "$(dirname "$0")" && pwd)" python3 $HERE/make_youtube_playlist_info.py ${YOUTUBE_API_KEY} ${YOUTUBE_PLAYLIST_ID} ${ARTIFACTS_DIR}/playlist.json From 9cc1302b605e9d769586d8654e9c914bc8a7522e Mon Sep 17 00:00:00 2001 From: Paul MARTIN Date: Thu, 10 Sep 2026 10:14:24 +0200 Subject: [PATCH 3/5] Take the coverage percentage as an argument in lcov_badger Audacity and MuseScore already compute it with lcov --summary and pass the number. Do the same here so all three callers share one interface, and drop the info-file parsing. --- .github/workflows/check_unit_tests.yml | 3 ++- buildscripts/ci/linux/tools/lcov_badger.py | 27 ++++------------------ 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/.github/workflows/check_unit_tests.yml b/.github/workflows/check_unit_tests.yml index ade507db50..42bf2d3ad0 100644 --- a/.github/workflows/check_unit_tests.yml +++ b/.github/workflows/check_unit_tests.yml @@ -94,7 +94,8 @@ jobs: lcov --capture --directory "$(pwd)/build.debug/" --output-file coverage.info lcov --remove coverage.info '/usr/*' '*/tests/*' '*/thirdparty/*' '*/moc_*' '*framework/Headers/*' '*/hb-*' '*/Qt/*' --output-file filtered_coverage.info - python3 buildscripts/ci/linux/tools/lcov_badger.py filtered_coverage.info coverage_badge.svg + COVERAGE=$(lcov --summary filtered_coverage.info --ignore-errors inconsistent,corrupt,unsupported,empty,negative,mismatch,gcov | grep -oP 'lines\.+:\s+\K[0-9.]+') + python3 buildscripts/ci/linux/tools/lcov_badger.py "${COVERAGE}" coverage_badge.svg - name: Push to S3 if: ( github.event_name == 'schedule' || inputs.code_coverage ) && github.repository == 'musescore/muse_framework' diff --git a/buildscripts/ci/linux/tools/lcov_badger.py b/buildscripts/ci/linux/tools/lcov_badger.py index 088f975f6f..a90d8207e8 100644 --- a/buildscripts/ci/linux/tools/lcov_badger.py +++ b/buildscripts/ci/linux/tools/lcov_badger.py @@ -1,9 +1,8 @@ -import io import sys -USAGE = "Usage: python lcov-badger.py (path-to-info-file) (path-for-output-svg)" +USAGE = "Usage: python lcov-badger.py (coverage-percent) (path-for-output-svg)" -SVG_TEMPLATE = """ +SVG_TEMPLATE = """ @@ -27,34 +26,16 @@ def create_svg(percent): return SVG_TEMPLATE.replace("{{PERCENT}}", str(percent)) -def extract_coverage(data): - lines = data.split("\n") - - lines_found = [float(line[3:]) for line in lines if line.startswith("LF:")] - lines_found_sum = sum(lines_found) - - lines_exec = [float(line[3:]) for line in lines if line.startswith("LH:")] - lines_exec_sum = sum(lines_exec) - - return int(round(lines_exec_sum / lines_found_sum * 100)) - if (len(sys.argv) != 3): print(USAGE) exit(-1) -source_path = sys.argv[1] +coverage = int(round(float(sys.argv[1]))) svg_path = sys.argv[2] -print("Reading coverage info from " + source_path) - -info = "" -with open(source_path, 'r') as info_file: - info = info_file.read() -coverage = extract_coverage(info) badge_data = create_svg(coverage) -print(repr(SVG_TEMPLATE)) - +print("Coverage: " + str(coverage) + "%") print("Creating a coverage badge " + svg_path) with open(svg_path, 'w') as badge_file: badge_file.write(badge_data) From dc4b00abd1d1631ca3f3c4f0ec59a5a849c02c81 Mon Sep 17 00:00:00 2001 From: Paul MARTIN Date: Thu, 10 Sep 2026 10:25:05 +0200 Subject: [PATCH 4/5] Add a cache control option for S3 uploads Replays Audacity cb5bb605f9. Without --cache_control the s3cmd invocation is unchanged. --- buildscripts/ci/tools/s3_push_file.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/buildscripts/ci/tools/s3_push_file.sh b/buildscripts/ci/tools/s3_push_file.sh index 1043505212..82f010ab38 100644 --- a/buildscripts/ci/tools/s3_push_file.sh +++ b/buildscripts/ci/tools/s3_push_file.sh @@ -24,6 +24,7 @@ S3_SECRET="" S3_URL="" FILE_PATH="" +CACHE_CONTROL="" while [[ "$#" -gt 0 ]]; do case $1 in @@ -31,6 +32,7 @@ while [[ "$#" -gt 0 ]]; do --s3_secret) S3_SECRET="$2"; shift ;; --s3_url) S3_URL="$2"; shift ;; --file_path) FILE_PATH="$2"; shift ;; + --cache_control) CACHE_CONTROL="$2"; shift ;; *) echo "Unknown parameter passed: $1"; exit 1 ;; esac shift @@ -40,4 +42,9 @@ bash ./buildscripts/ci/tools/s3_install.sh --s3_key ${S3_KEY} --s3_secret ${S3_S echo "=== Publish to S3 ===" -s3cmd put --acl-public --guess-mime-type $FILE_PATH "$S3_URL" +EXTRA_ARGS=() +if [ -n "$CACHE_CONTROL" ]; then + EXTRA_ARGS+=(--add-header="Cache-Control: ${CACHE_CONTROL}") +fi + +s3cmd put --acl-public --guess-mime-type "${EXTRA_ARGS[@]}" $FILE_PATH "$S3_URL" From 22ce2d3eccd342fc282ca96fa099b8f5d6389f2d Mon Sep 17 00:00:00 2001 From: Paul MARTIN Date: Thu, 10 Sep 2026 10:44:27 +0200 Subject: [PATCH 5/5] Resolve sibling scripts relative to the script directory These scripts are called from the app repositories, where ./buildscripts resolves to the app's own copy rather than the framework's. --- buildscripts/ci/release/make_previous_releases_notes.sh | 5 +++-- buildscripts/ci/tools/s3_push_file.sh | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/buildscripts/ci/release/make_previous_releases_notes.sh b/buildscripts/ci/release/make_previous_releases_notes.sh index 2f75627f10..dc87d843a3 100644 --- a/buildscripts/ci/release/make_previous_releases_notes.sh +++ b/buildscripts/ci/release/make_previous_releases_notes.sh @@ -42,9 +42,11 @@ while [[ "$#" -gt 0 ]]; do shift done +HERE="$(cd "$(dirname "$0")" && pwd)" + echo "=== Get release info ===" -bash ./buildscripts/ci/release/get_file_from_s3.sh \ +bash "$HERE"/get_file_from_s3.sh \ --s3_key "${S3_KEY}" \ --s3_secret "${S3_SECRET}" \ --s3_url "${S3_URL}" \ @@ -53,5 +55,4 @@ bash ./buildscripts/ci/release/get_file_from_s3.sh \ echo "=== Append release info to previous releases ===" -HERE="$(cd "$(dirname "$0")" && pwd)" python3 "$HERE"/append_release_to_previous_releases.py ${ARTIFACTS_DIR}/"${CURRENT_FILE_NAME}" ${ARTIFACTS_DIR}/"${PREVIOUS_FILE_NAME}" diff --git a/buildscripts/ci/tools/s3_push_file.sh b/buildscripts/ci/tools/s3_push_file.sh index 82f010ab38..f422fd54a2 100644 --- a/buildscripts/ci/tools/s3_push_file.sh +++ b/buildscripts/ci/tools/s3_push_file.sh @@ -38,7 +38,9 @@ while [[ "$#" -gt 0 ]]; do shift done -bash ./buildscripts/ci/tools/s3_install.sh --s3_key ${S3_KEY} --s3_secret ${S3_SECRET} +HERE="$(cd "$(dirname "$0")" && pwd)" + +bash "$HERE"/s3_install.sh --s3_key ${S3_KEY} --s3_secret ${S3_SECRET} echo "=== Publish to S3 ==="