Skip to content

Commit

Permalink
Merge pull request #1657 from YunoHost/bookworm
Browse files Browse the repository at this point in the history
Bookworm + Portal rework
  • Loading branch information
alexAubin authored Oct 31, 2024
2 parents eba1f3f + 94ad04b commit 85e904a
Show file tree
Hide file tree
Showing 141 changed files with 6,514 additions and 6,046 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
[coverage:run]
relative_files = True
source = src/
branch = True

[report]
omit=src/tests/*,src/vendor/*,/usr/lib/moulinette/yunohost/*,/usr/lib/python3/dist-packages/yunohost/tests/*,/usr/lib/python3/dist-packages/yunohost/vendor/*
7 changes: 3 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
stages:
- lint
- build
- install
- test
- lint
- doc
- translation
- bot

default:
tags:
Expand Down Expand Up @@ -47,7 +46,7 @@ workflow:
variables:
GIT_CLONE_PATH: '$CI_BUILDS_DIR/$CI_COMMIT_SHA/$CI_JOB_ID'
YNH_SOURCE: "https://github.com/yunohost"
YNH_DEBIAN: "bullseye"
YNH_DEBIAN: "bookworm"
YNH_SKIP_DIAGNOSIS_DURING_UPGRADE: "true"

include:
Expand Down
53 changes: 53 additions & 0 deletions .gitlab/ci/bot.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
generate-helpers-doc:
stage: bot
image: "build-and-lint"
needs: []
before_script:
- git config --global user.email "[email protected]"
- git config --global user.name "$GITHUB_USER"
script:
- cd doc
- python3 generate_helper_doc.py 2
- python3 generate_helper_doc.py 2.1
- python3 generate_resource_doc.py > resources.md
- python3 generate_configpanel_and_formoptions_doc.py > forms.md
- hub clone https://$GITHUB_TOKEN:[email protected]/YunoHost/doc.git doc_repo
- cp helpers.v2.md doc_repo/pages/06.contribute/10.packaging_apps/20.scripts/10.helpers/packaging_app_scripts_helpers.md
- cp helpers.v2.1.md doc_repo/pages/06.contribute/10.packaging_apps/20.scripts/12.helpers21/packaging_app_scripts_helpers_v21.md
- cp resources.md doc_repo/pages/06.contribute/10.packaging_apps/10.manifest/10.appresources/packaging_app_manifest_resources.md
- cp forms.md doc_repo/pages/06.contribute/15.dev/03.forms/forms.md
- cd doc_repo
# replace ${CI_COMMIT_REF_NAME} with ${CI_COMMIT_TAG} ?
- hub checkout -b "${CI_COMMIT_REF_NAME}"
- hub commit -am "[CI] Update app helpers/resources for ${CI_COMMIT_REF_NAME}"
- hub pull-request -m "[CI] Update app helpers/resources for ${CI_COMMIT_REF_NAME}" -p # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd
artifacts:
paths:
- doc/helpers.md
- doc/resources.md
only:
- tags

autofix-translated-strings:
stage: bot
image: "build-and-lint"
needs: []
before_script:
- git config --global user.email "[email protected]"
- git config --global user.name "$GITHUB_USER"
- hub clone --branch ${CI_COMMIT_REF_NAME} "https://$GITHUB_TOKEN:[email protected]/YunoHost/yunohost.git" github_repo
- cd github_repo
script:
# create a local branch that will overwrite distant one
- git checkout -b "ci-autofix-translated-strings-${CI_COMMIT_REF_NAME}" --no-track
- python3 maintenance/missing_i18n_keys.py --fix
- python3 maintenance/autofix_locale_format.py
- '[ $(git diff --ignore-blank-lines --ignore-all-space --ignore-space-at-eol --ignore-cr-at-eol | wc -l) != 0 ] || exit 0' # stop if there is nothing to commit
- git commit -am "[CI] Reformat / remove stale translated strings" || true
- git push -f origin "ci-autofix-translated-strings-${CI_COMMIT_REF_NAME}":"ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}"
- hub pull-request -m "[CI] Reformat / remove stale translated strings" -b Yunohost:$CI_COMMIT_REF_NAME -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd
only:
variables:
- $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
changes:
- locales/*
11 changes: 8 additions & 3 deletions .gitlab/ci/build.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
.build-stage:
stage: build
needs:
- job: actionsmap
- job: invalidcode311
image: "build-and-lint"
variables:
YNH_BUILD_DIR: "$GIT_CLONE_PATH/build"
before_script:
- echo $PWD
- echo $CI_PROJECT_DIR
- mkdir -p $YNH_BUILD_DIR
artifacts:
paths:
Expand Down Expand Up @@ -31,7 +36,7 @@ build-yunohost:
- mkdir -p $YNH_BUILD_DIR/$PACKAGE
- cat archive.tar.gz | tar -xz -C $YNH_BUILD_DIR/$PACKAGE
- rm archive.tar.gz
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE || { apt-get update && DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE; }
- *build_script

build-ssowat:
Expand All @@ -40,7 +45,7 @@ build-ssowat:
PACKAGE: "ssowat"
script:
- git clone $YNH_SOURCE/$PACKAGE -b $CI_COMMIT_REF_NAME $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE -b $YNH_DEBIAN $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE $YNH_BUILD_DIR/$PACKAGE --depth 1
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE || { apt-get update && DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE; }
- *build_script

build-moulinette:
Expand All @@ -49,5 +54,5 @@ build-moulinette:
PACKAGE: "moulinette"
script:
- git clone $YNH_SOURCE/$PACKAGE -b $CI_COMMIT_REF_NAME $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE -b $YNH_DEBIAN $YNH_BUILD_DIR/$PACKAGE --depth 1 || git clone $YNH_SOURCE/$PACKAGE $YNH_BUILD_DIR/$PACKAGE --depth 1
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE
- DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE || { apt-get update && DEBIAN_FRONTEND=noninteractive apt --assume-yes -o Dpkg::Options::="--force-confold" build-dep $YNH_BUILD_DIR/$PACKAGE; }
- *build_script
31 changes: 0 additions & 31 deletions .gitlab/ci/doc.gitlab-ci.yml

This file was deleted.

25 changes: 20 additions & 5 deletions .gitlab/ci/lint.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,39 @@
########################################
# later we must fix lint and format-check jobs and remove "allow_failure"

lint39:
actionsmap:
stage: lint
image: "build-and-lint"
needs: []
script:
- python3 -c 'import yaml; yaml.safe_load(open("share/actionsmap.yml"))'
- python3 -c 'import yaml; yaml.safe_load(open("share/actionsmap-portal.yml"))'

lint311:
stage: lint
image: "build-and-lint"
needs: []
allow_failure: true
script:
- tox -e py39-lint
- tox -e py311-lint

invalidcode39:
invalidcode311:
stage: lint
image: "build-and-lint"
needs: []
script:
- tox -e py39-invalidcode
- tox -e py311-invalidcode

mypy:
stage: lint
image: "build-and-lint"
needs: []
script:
- tox -e py39-mypy
- tox -e py311-mypy

i18n-keys:
stage: lint
image: "build-and-lint"
needs: []
script:
- python3 maintenance/missing_i18n_keys.py --check
Loading

0 comments on commit 85e904a

Please sign in to comment.