From 85c672f167523f5493ede894a51e6ea498368a0f Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 25 Feb 2025 13:04:11 +0100 Subject: [PATCH 1/5] add new script to update copyright header --- .gitlab-ci.yml | 43 ++++++++++++++++++++++++++++++++++++ ci/check_update_copyright.sh | 34 ++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100755 ci/check_update_copyright.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ab15a78b6..4d01e8c689 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1161,6 +1161,49 @@ clang-format-check: name: "$ARTIFACT_BASE_NAME" expose_as: "formatting patch" +copyright-header-check: + extends: + - .test-job-linux + - .rules-merge-request + variables: + ARTIFACT_BASE_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--copyright-fix" + stage: prevalidate + needs: [] + timeout: "5 minutes" + script: + # Set up variables. This can't be done in the "variables" section because variables are not expanded properly there + - PATCH_FILE_NAME="$ARTIFACT_BASE_NAME".patch + - > + INSTRUCTIONS_GITLAB="To fix the copyright header:\n + - download the diff patch available as artifact of this job\n + - unzip the artifact and place the patch file in the root directory of your local IVAS repo\n + - run: git apply $PATCH_FILE_NAME\n + - commit new changes" + - > + INSTRUCTIONS_README="To fix the copyright header:\n + - place the patch file in the root directory of your local IVAS repo\n + - run: git apply $PATCH_FILE_NAME\n + - commit new changes" + + - mkdir tmp-copyright-fix + - changes=$(ci/check_update_copyright.sh tmp-copyright-fix/$PATCH_FILE_NAME) + - if [[ $changes -eq 0 ]]; then exit 0; fi + + # Print instructions to job output + - echo -e "$INSTRUCTIONS_GITLAB" + + # Include readme in the artifact, in case someone misses the job printout (e.g. getting the artifact via MR interface) + - echo -e "$INSTRUCTIONS_README" > "tmp-copyright-fix/readme.txt" + + - exit $changes + artifacts: + expire_in: 1 day + paths: + - tmp-copyright-fix/ + when: on_failure + name: "$ARTIFACT_BASE_NAME" + expose_as: "copyright patch" + # check for crashes if first received frame on decoder side is an SID check-first-frame-is-sid: extends: diff --git a/ci/check_update_copyright.sh b/ci/check_update_copyright.sh new file mode 100755 index 0000000000..195322cf20 --- /dev/null +++ b/ci/check_update_copyright.sh @@ -0,0 +1,34 @@ +#!/bin/bash +if [[ $# -ne 1 ]]; then + echo "USAGE: $0 " + exit -1 +fi + +PATCH_FILE_NAME=$1 +curr_year=$(date +'%Y') +changes=0 + +lfs_files=$(git lfs ls-files -n) +sed_list=$(mktemp) + +# iterate through tracked files +for file in $(git ls-files); do + # skip LFS files + if [[ "$lfs_Files" == *"$file"* ]]; then + continue + fi + + # process only text files + if file "$file" | grep -q 'text'; then + echo $file >>$sed_list + fi +done + +xargs -n 1 -P 8 sed -i -E "s/\(C\)\s+202[0-9]-202[0-9]/(C) 2022-$curr_year/g" <$sed_list + +if [[ $(git status --porcelain --untracked-files=no) ]]; then + changes=1 + git diff >"$PATCH_FILE_NAME" +fi + +exit $changes -- GitLab From 71c5569bfda5759acd92b3094924aefc15506c54 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 25 Feb 2025 13:06:13 +0100 Subject: [PATCH 2/5] add copyright header to script to update copyright header --- ci/check_update_copyright.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ci/check_update_copyright.sh b/ci/check_update_copyright.sh index 195322cf20..a848a42dfb 100755 --- a/ci/check_update_copyright.sh +++ b/ci/check_update_copyright.sh @@ -1,4 +1,33 @@ #!/bin/bash + +# (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +# contributors to this repository. All Rights Reserved. + +# This software is protected by copyright law and by international treaties. +# The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +# contributors to this repository retain full ownership rights in their respective contributions in +# the software. This notice grants no license of any kind, including but not limited to patent +# license, nor is any license granted by implication, estoppel or otherwise. + +# Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +# contributions. + +# This software is provided "AS IS", without any express or implied warranties. The software is in the +# development stage. It is intended exclusively for experts who have experience with such software and +# solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +# and fitness for a particular purpose are hereby disclaimed and excluded. + +# Any dispute, controversy or claim arising under or in relation to providing this software shall be +# submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +# accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +# the United Nations Convention on Contracts on the International Sales of Goods. + if [[ $# -ne 1 ]]; then echo "USAGE: $0 " exit -1 -- GitLab From 34354af2707f59e80c959433f6ac64a0cb9d5557 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 25 Feb 2025 13:10:12 +0100 Subject: [PATCH 3/5] [fix] typo in variable name --- ci/check_update_copyright.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/check_update_copyright.sh b/ci/check_update_copyright.sh index a848a42dfb..1cdabbdce5 100755 --- a/ci/check_update_copyright.sh +++ b/ci/check_update_copyright.sh @@ -43,7 +43,7 @@ sed_list=$(mktemp) # iterate through tracked files for file in $(git ls-files); do # skip LFS files - if [[ "$lfs_Files" == *"$file"* ]]; then + if [[ "$lfs_files" == *"$file"* ]]; then continue fi -- GitLab From 51b9ffb056ad19e36256f4f10bd9e9b783ed3e8d Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 25 Feb 2025 13:29:11 +0100 Subject: [PATCH 4/5] change copyright job to run only on manual pipelines --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d01e8c689..e3859ed072 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,6 +25,7 @@ variables: - 'ivas-conformance-linux' - 'check-clipping' - 'test-branch-vs-input-passthrough' + - 'update-copyright' GIT_CLEAN_FLAGS: -ffdxq TESTCASE_TIMEOUT_STV_SANITIZERS: 180 @@ -68,6 +69,9 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux' variables: IVAS_PIPELINE_NAME: 'Draft IVAS Conformance test -- Linux: $CI_COMMIT_BRANCH' + - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'update-copyright' + variables: + IVAS_PIPELINE_NAME: 'Update copyright header -- Linux: $CI_COMMIT_BRANCH' - if: $CI_PIPELINE_SOURCE == 'trigger' - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'check-clipping' variables: @@ -1164,7 +1168,8 @@ clang-format-check: copyright-header-check: extends: - .test-job-linux - - .rules-merge-request + rules: + - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'update-copyright' variables: ARTIFACT_BASE_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--copyright-fix" stage: prevalidate -- GitLab From 21ad9df74b16e715d599ca4aaf6ff6b7ec68121b Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 6 Mar 2025 15:55:13 +0100 Subject: [PATCH 5/5] revert changes to .gitlab-ci.yml --- .gitlab-ci.yml | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3859ed072..2ab15a78b6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,6 @@ variables: - 'ivas-conformance-linux' - 'check-clipping' - 'test-branch-vs-input-passthrough' - - 'update-copyright' GIT_CLEAN_FLAGS: -ffdxq TESTCASE_TIMEOUT_STV_SANITIZERS: 180 @@ -69,9 +68,6 @@ workflow: - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux' variables: IVAS_PIPELINE_NAME: 'Draft IVAS Conformance test -- Linux: $CI_COMMIT_BRANCH' - - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'update-copyright' - variables: - IVAS_PIPELINE_NAME: 'Update copyright header -- Linux: $CI_COMMIT_BRANCH' - if: $CI_PIPELINE_SOURCE == 'trigger' - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'check-clipping' variables: @@ -1165,50 +1161,6 @@ clang-format-check: name: "$ARTIFACT_BASE_NAME" expose_as: "formatting patch" -copyright-header-check: - extends: - - .test-job-linux - rules: - - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'update-copyright' - variables: - ARTIFACT_BASE_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--copyright-fix" - stage: prevalidate - needs: [] - timeout: "5 minutes" - script: - # Set up variables. This can't be done in the "variables" section because variables are not expanded properly there - - PATCH_FILE_NAME="$ARTIFACT_BASE_NAME".patch - - > - INSTRUCTIONS_GITLAB="To fix the copyright header:\n - - download the diff patch available as artifact of this job\n - - unzip the artifact and place the patch file in the root directory of your local IVAS repo\n - - run: git apply $PATCH_FILE_NAME\n - - commit new changes" - - > - INSTRUCTIONS_README="To fix the copyright header:\n - - place the patch file in the root directory of your local IVAS repo\n - - run: git apply $PATCH_FILE_NAME\n - - commit new changes" - - - mkdir tmp-copyright-fix - - changes=$(ci/check_update_copyright.sh tmp-copyright-fix/$PATCH_FILE_NAME) - - if [[ $changes -eq 0 ]]; then exit 0; fi - - # Print instructions to job output - - echo -e "$INSTRUCTIONS_GITLAB" - - # Include readme in the artifact, in case someone misses the job printout (e.g. getting the artifact via MR interface) - - echo -e "$INSTRUCTIONS_README" > "tmp-copyright-fix/readme.txt" - - - exit $changes - artifacts: - expire_in: 1 day - paths: - - tmp-copyright-fix/ - when: on_failure - name: "$ARTIFACT_BASE_NAME" - expose_as: "copyright patch" - # check for crashes if first received frame on decoder side is an SID check-first-frame-is-sid: extends: -- GitLab