From dabad720e76191b3325fa5afadc3bb3ed3e39bca Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 18 Oct 2024 08:04:29 -0400 Subject: [PATCH 1/8] Use build_no 144 --- .forgejo/workflows/release-build.yaml | 2 +- .forgejo/workflows/test-build.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 8d97fca..5fa553c 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -10,7 +10,7 @@ jobs: image: ubuntu:22.04 env: pkgver: 8.2.0 - buildno: 143 + buildno: 144 qtver: 5.15.3 steps: - name: Environment setup diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index 4bd4ce9..1c47cbc 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -9,7 +9,7 @@ jobs: image: ubuntu:22.04 env: pkgver: 8.2.0 - buildno: 143 + buildno: 144 qtver: 5.15.3 steps: - name: Environment setup From 18b17a1e23938184651719be1034d4380dbb1b3e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 18 Oct 2024 08:04:29 -0400 Subject: [PATCH 2/8] Use build_no 144 --- .forgejo/workflows/release-build.yaml | 2 +- .forgejo/workflows/test-build.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 8d97fca..5fa553c 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -10,7 +10,7 @@ jobs: image: ubuntu:22.04 env: pkgver: 8.2.0 - buildno: 143 + buildno: 144 qtver: 5.15.3 steps: - name: Environment setup diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index 4bd4ce9..1c47cbc 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -9,7 +9,7 @@ jobs: image: ubuntu:22.04 env: pkgver: 8.2.0 - buildno: 143 + buildno: 144 qtver: 5.15.3 steps: - name: Environment setup From 7bf927c2c34926c2106500ed0809fb44bb876c1e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 10 Nov 2024 00:17:48 -0500 Subject: [PATCH 3/8] Initial pkg version checker --- .forgejo/bin/check_ver.sh | 34 +++++++ .forgejo/bin/create_issue.sh | 165 +++++++++++++++++++++++++++++++ .forgejo/workflows/check-pkg.yml | 24 +++++ 3 files changed, 223 insertions(+) create mode 100755 .forgejo/bin/check_ver.sh create mode 100755 .forgejo/bin/create_issue.sh create mode 100644 .forgejo/workflows/check-pkg.yml diff --git a/.forgejo/bin/check_ver.sh b/.forgejo/bin/check_ver.sh new file mode 100755 index 0000000..ed17d5e --- /dev/null +++ b/.forgejo/bin/check_ver.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# expects the following env variables: +# downstream: downstream repo + +repo=${downstream/*\/} + +curl --silent $downstream/binary-amd64/Packages > Packages + +owned_by_you=$(awk -F ': ' '{if($1=="Package"){print $2}}' Packages | sort | uniq) + +echo "Found $(printf '%s\n' $owned_by_you | wc -l ) packages" + +rm -f out_of_date not_in_anitya + +for pkg in $owned_by_you; do + upstream_version=$(curl --fail -X GET -sS -H 'Content-Type: application/json' "https://release-monitoring.org/api/v2/packages/?name=$pkg&distribution=Debian" | jq -r '.items.[].stable_version') + downstream_version=$(sed -n "/^Package: $pkg$/,/^$/p" Packages| awk -F ': ' '{if($1=="Version"){print $2 }}' | sort -V | tail -n 1) + downstream_version=${downstream_version/-*} + + echo $upstream_version + echo $downstream_version + + if [ -z "$upstream_version" ]; then + echo "$pkg not in anitya" + echo "$pkg" >> not_in_anitya + elif [ "$downstream_version" != "$(printf '%s\n' $upstream_version $downstream_version | sort -V | head -n 1)" ]; then + echo "$pkg higher downstream" + continue + elif [ "$upstream_version" != "$downstream_version" ]; then + echo "$pkg upstream version $upstream_version does not match downstream version $downstream_version" + echo "$pkg $downstream_version $upstream_version $repo" >> out_of_date + fi +done diff --git a/.forgejo/bin/create_issue.sh b/.forgejo/bin/create_issue.sh new file mode 100755 index 0000000..d162758 --- /dev/null +++ b/.forgejo/bin/create_issue.sh @@ -0,0 +1,165 @@ +#!/bin/bash + +# expects: +# env variable FORGEJO_TOKEN +# file out_of_date + +IFS=' +' +repo=${downstream/*\/} + +does_it_exist() { + name=$1 + downstream_version=$2 + upstream_version=$3 + repo=$4 + + query="$repo/$name: upgrade to $upstream_version" + query="$(echo $query | sed 's| |%20|g' | sed 's|:|%3A|g' | sed 's|/|%2F|g' )" + + result="$(curl --silent -X 'GET' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" + )" + + if [ "$result" == "[]" ]; then + return 1 + fi +} + +is_it_old() { + name=$1 + downstream_version=$2 + upstream_version=$3 + repo=$4 + + query="$repo/$name: upgrade to" + query="$(echo $query | sed 's| |%20|g' | sed 's|:|%3A|g' | sed 's|/|%2F|g' )" + + result="$(curl --silent -X 'GET' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" + )" + + result_title="$(echo $result | jq -r '.[].title' )" + result_id="$(echo $result | jq -r '.[].number' )" + result_upstream_version="$(echo $result_title | awk '{print $4}')" + + if [ "$upstream_version" != "$result_upstream_version" ]; then + echo $result_id + else + echo 0 + fi +} + +update_title() { + name=$1 + downstream_version=$2 + upstream_version=$3 + repo=$4 + id=$5 + + result=$(curl --silent -X 'PATCH' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$id" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{ + \"title\": \"$repo/$name: upgrade to $upstream_version\" + }" + ) + + return 0 +} + +create_issue() { + name=$1 + downstream_version=$2 + upstream_version=$3 + repo=$4 + + result=$(curl --silent -X 'POST' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{ + \"title\": \"$repo/$name: upgrade to $upstream_version\", + \"labels\": [ + $LABEL_NUMBER + ] + }") + + return 0 +} + +if [ -f out_of_date ]; then + out_of_date="$(cat out_of_date)" + + echo "Detected $(wc -l out_of_date) out-of-date packages, creating issues" + + for pkg in $out_of_date; do + name="$(echo $pkg | awk '{print $1}')" + downstream_version="$(echo $pkg | awk '{print $2}')" + upstream_version="$(echo $pkg | awk '{print $3}')" + repo="$(echo $pkg | awk '{print $4}')" + + if does_it_exist $name $downstream_version $upstream_version $repo; then + echo "Issue for $repo/$name already exists" + continue + fi + + id=$(is_it_old $name $downstream_version $upstream_version $repo) + + if [ "$id" != "0" ] && [ -n "$id" ]; then + echo "Issue for $repo/$name needs updating" + update_title $name $downstream_version $upstream_version $repo $id + continue + fi + + echo "Creating issue for $repo/$name" + create_issue $name $downstream_version $upstream_version $repo + done +fi + +if [ -f not_in_anitya ]; then + query="Add missing $repo packages to anitya" + query="$(echo $query | sed 's| |%20|g')" + + result="$(curl --silent -X 'GET' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues?state=open&q=$query&type=issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" + )" + + if [ "$result" == "[]" ]; then + echo "Creating anitya issue" + result=$(curl --silent -X 'POST' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{ + \"title\": \"Add missing $repo packages to anitya\", + \"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\", + \"labels\": [ + $LABEL_NUMBER + ] + }") + + else + echo "Updating anitya issue" + result_id="$(echo $result | jq -r '.[].number' )" + result=$(curl --silent -X 'PATCH' \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/issues/$result_id" \ + -H 'accept: application/json' \ + -H "authorization: Basic $FORGEJO_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{ + \"body\": \"- [ ] $(sed '{:q;N;s/\n/\\n- [ ] /g;t q}' not_in_anitya)\" + }" + ) + fi +fi diff --git a/.forgejo/workflows/check-pkg.yml b/.forgejo/workflows/check-pkg.yml new file mode 100644 index 0000000..b7c5778 --- /dev/null +++ b/.forgejo/workflows/check-pkg.yml @@ -0,0 +1,24 @@ +on: + workflow_dispatch: + +jobs: + check-user: + name: Check user repo + runs-on: x86_64 + container: + image: alpine:latest + env: + downstream: https://forge.ilot.io/api/packages/ilot/debian/dists/jammy/main + FORGEJO_TOKEN: ${{ secrets.forgejo_token }} + LABEL_NUMBER: 4 + steps: + - name: Environment setup + run: apk add grep coreutils gawk curl wget bash nodejs git jq sed + - name: Get scripts + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Check out-of-date packages + run: ${{ github.workspace }}/.forgejo/bin/check_ver.sh + - name: Create issues + run: ${{ github.workspace }}/.forgejo/bin/create_issue.sh From 22502496a66ba93bc1e0196ba7c325ef883d186b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 28 Nov 2024 10:58:38 -0500 Subject: [PATCH 4/8] Upgrade to 8.2.2-22 --- .forgejo/workflows/release-build.yaml | 4 ++-- .forgejo/workflows/test-build.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 5fa553c..6f59067 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.2.0 - buildno: 144 + pkgver: 8.2.2 + buildno: 22 qtver: 5.15.3 steps: - name: Environment setup diff --git a/.forgejo/workflows/test-build.yaml b/.forgejo/workflows/test-build.yaml index 1c47cbc..96d3280 100644 --- a/.forgejo/workflows/test-build.yaml +++ b/.forgejo/workflows/test-build.yaml @@ -8,8 +8,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.2.0 - buildno: 144 + pkgver: 8.2.2 + buildno: 22 qtver: 5.15.3 steps: - name: Environment setup From 4fa4653f8fb6f19c2492a96d669f7e6ca6f44ebb Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 15 Feb 2025 15:57:05 -0500 Subject: [PATCH 5/8] Upgrade to 8.3.0-98 --- .forgejo/workflows/release-build.yaml | 5 +++-- disable-licensing-limits.patch | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 6f59067..9e64a9d 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.2.2 - buildno: 22 + pkgver: 8.3.0 + buildno: 98 qtver: 5.15.3 steps: - name: Environment setup @@ -18,6 +18,7 @@ jobs: cat /etc/os-release apt-get update apt-get install -y git make g++ bzip2 sudo patch python2 curl lsb-release p7zip-full qtbase5-dev debhelper clang-14 lld-14 + # node version set in build_tools/scripts/build_server variable pkg_target curl -sL https://deb.nodesource.com/setup_16.x | bash - apt-get install -y nodejs npm install -g pkg grunt grunt-cli diff --git a/disable-licensing-limits.patch b/disable-licensing-limits.patch index 3f82618..3160f0e 100644 --- a/disable-licensing-limits.patch +++ b/disable-licensing-limits.patch @@ -119,10 +119,10 @@ index 2209e8c9..feef6247 100644 } else { const converter = require('./converter'); diff --git a/server/Common/sources/license.js b/server/Common/sources/license.js -index 8813cbac..90177d15 100644 +index d43ee210..9e787b08 100644 --- a/server/Common/sources/license.js +++ b/server/Common/sources/license.js -@@ -44,23 +44,23 @@ exports.readLicense = async function () { +@@ -44,24 +44,24 @@ exports.readLicense = async function () { return [{ count: 1, type: c_LR.Success, @@ -149,8 +149,9 @@ index 8813cbac..90177d15 100644 - endDate: null, + endDate: new Date("2099-01-01T23:59:59.000Z"), customerId: "", -- alias: "" -+ alias: "community" +- alias: "", ++ alias: "community", + multitenancy: false }, null]; }; From 101f52f9ab7f1ce6e1dd7550871811dda0399f28 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 23 Mar 2025 16:26:46 -0400 Subject: [PATCH 6/8] Upgrade to 8.3.2-28 --- .forgejo/workflows/release-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 9e64a9d..32a38ba 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.3.0 - buildno: 98 + pkgver: 8.3.2 + buildno: 28 qtver: 5.15.3 steps: - name: Environment setup From 663a763150d77ad7cd6c2abae6ea345c28f45e74 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 2 Apr 2025 15:58:01 -0400 Subject: [PATCH 7/8] Attempt to fix compilation introduced from https://github.com/ONLYOFFICE/core/commit/4f4f61bb1918e0a0a6d79827227ae5129443564f --- .forgejo/workflows/release-build.yaml | 1 + ...officefileformatchecker2-add-limits-include.patch | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 core_common-officefileformatchecker2-add-limits-include.patch diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index 32a38ba..f45c087 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -37,6 +37,7 @@ jobs: cd build git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_v8-use-system-clang.patch git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/disable-licensing-limits.patch + git apply -v --ignore-space-change --ignore-whitespace $GITHUB_WORKSPACE/core_common-officefileformatchecker2-add-limits-include.patch - name: Development setup run: | mkdir -p build/build_tools/system_qt-$qtver/gcc_64 diff --git a/core_common-officefileformatchecker2-add-limits-include.patch b/core_common-officefileformatchecker2-add-limits-include.patch new file mode 100644 index 0000000..f015968 --- /dev/null +++ b/core_common-officefileformatchecker2-add-limits-include.patch @@ -0,0 +1,12 @@ +diff --git a/core/Common/OfficeFileFormatChecker2.cpp b/core/Common/OfficeFileFormatChecker2.cpp +index d2887d78..43c28a0b 100644 +--- a/core/Common/OfficeFileFormatChecker2.cpp ++++ b/core/Common/OfficeFileFormatChecker2.cpp +@@ -44,6 +44,7 @@ + + #include "3dParty/pole/pole.h" + #include ++#include + + #include "OfficeFileFormatDefines.h" + From 007139a8a6af1122489123d0b6e0182c03dc875b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 16 Apr 2025 21:16:50 -0400 Subject: [PATCH 8/8] Upgrade to 8.3.3-21 --- .forgejo/workflows/release-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/release-build.yaml b/.forgejo/workflows/release-build.yaml index f45c087..20da54b 100644 --- a/.forgejo/workflows/release-build.yaml +++ b/.forgejo/workflows/release-build.yaml @@ -9,8 +9,8 @@ jobs: container: image: ubuntu:22.04 env: - pkgver: 8.3.2 - buildno: 28 + pkgver: 8.3.3 + buildno: 21 qtver: 5.15.3 steps: - name: Environment setup