Skip to content

Commit

Permalink
MON-69153 Centreon next 24.05 (Jira release #19844#) (#4030)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuntoja committed Jun 24, 2024
2 parents a345069 + 8dae545 commit 91d84e8
Show file tree
Hide file tree
Showing 1,782 changed files with 169,024 additions and 39,442 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ tsconfig.json @centreon/owners-react
**/project/ @centreon/owners-pipelines
**/packaging/ @centreon/owners-pipelines
dependencies/** @centreon/owners-pipelines

**/config/features.json @centreon/release-management
2 changes: 1 addition & 1 deletion .github/actions/backend-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
shell: bash

- name: Cache vendor directory
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.base_directory }}/vendor
key: ${{ inputs.cache_key }}
8 changes: 4 additions & 4 deletions .github/actions/cypress-e2e-testing/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: 8
run_install: false
Expand All @@ -56,7 +56,7 @@ runs:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"

- name: Install Cypress binary
uses: nick-fields/retry@v2
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
timeout_seconds: 120
max_attempts: 10
Expand All @@ -65,9 +65,9 @@ runs:
command: cd ${{ inputs.module }}/tests/e2e && pnpm cypress install --force

- name: Cypress end-to-end testing
uses: cypress-io/github-action@v6
uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a # v6.6.1
with:
command: pnpm run cypress:run --browser chromium --spec features/**/${{ inputs.feature_file_path }}
command: pnpm run cypress:run --browser electron --spec features/**/${{ inputs.feature_file_path }}
install: false
working-directory: ${{ inputs.module }}/tests/e2e
publish-summary: false
Expand Down
33 changes: 16 additions & 17 deletions .github/actions/deb-delivery/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
description: "The distribution used for packaging"
required: true
version:
description: "Centreon packaged version"
description: "Centreon packaged major version"
required: true
cache_key:
description: "The cached package key"
Expand All @@ -30,7 +30,7 @@ runs:
using: "composite"
steps:
- name: Use cache DEB files
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./*.deb
key: ${{ inputs.cache_key }}
Expand All @@ -45,26 +45,25 @@ runs:
run: |
FILES="*.deb"
if [ -z "${{ inputs.module_name }}" ]; then
echo "module name is required"
exit 1
fi
# DEBUG
echo "[DEBUG] - Version: ${{ inputs.version }}"
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
echo "[DEBUG] - module_name: ${{ inputs.module_name }}"
echo "[DEBUG] - release_cloud: ${{ inputs.release_cloud }}"
echo "[DEBUG] - release_type: ${{ inputs.release_type }}"
echo "[DEBUG] - stability: ${{ inputs.stability }}"
if [ -z "${{ inputs.distrib }}" ]; then
echo "distrib is required"
# Make sure all required inputs are NOT empty
if [[ -z "${{ inputs.module_name }}" || -z "${{ inputs.distrib }}" || -z ${{ inputs.stability }} || -z ${{ inputs.version }} || -z ${{ inputs.release_cloud }} || -z ${{ inputs.release_type }} ]]; then
echo "Some mandatory inputs are empty, please check the logs."
exit 1
fi
if [ "${{ inputs.stability }}" == "pkgtest" ]; then
ROOT_REPO_PATH="installers"
jf rt upload "*.deb" "$ROOT_REPO_PATH/${{ inputs.version }}/${{ inputs.distrib }}/${{ inputs.stability }}/" --flat
exit 0
fi
# Handle either standard debian or ubuntu repository path
if [[ "${{ inputs.distrib }}" == "jammy" ]]; then
REPO_PREFIX="ubuntu"
ROOT_REPO_PATH="ubuntu-standard-${{ inputs.version }}-${{ inputs.stability }}"
else
REPO_PREFIX="apt"
ROOT_REPO_PATH="apt-standard-${{ inputs.version }}-${{ inputs.stability }}"
fi
for FILE in $FILES; do
Expand All @@ -76,6 +75,6 @@ runs:
echo "[DEBUG] - Version: $VERSION"
jf rt upload "$FILE" "${REPO_PREFIX}-standard-${{ inputs.version }}-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH"
jf rt upload "$FILE" "$ROOT_REPO_PATH/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH" --flat
done
shell: bash
6 changes: 3 additions & 3 deletions .github/actions/frontend-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: 8
run_install: false
Expand All @@ -54,13 +54,13 @@ runs:

- name: Cache index.html file
if: ${{ inputs.index_cache_key != '' && inputs.index_file != '' }}
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.index_file }}
key: ${{ inputs.index_cache_key }}

- name: Cache static directory
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.static_directory }}
key: ${{ inputs.static_cache_key }}
2 changes: 1 addition & 1 deletion .github/actions/frontend-lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
using: "composite"

steps:
- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: 8
run_install: false
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/get-latest-npm-branch-version/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ try {
getPackageInformations().then((package) => {
const latestPackageVersion = package['dist-tags'][tag];

if (latestPackageVersion && tag === 'latest') {
const year = new Date().getFullYear() - 2000;
const month = new Date().getMonth() + 1;
const firstMonthVersion = `${year}.${month}.0`;

console.log(firstMonthVersion, latestPackageVersion);

if (compareVersions(latestPackageVersion, firstMonthVersion) === -1) {
core.setOutput("package_version", firstMonthVersion);
core.setOutput("skip-bump-version", 1);
return;
}
}

if (latestPackageVersion && compareVersions(latestPackageVersion, core.getInput('current_package_version')) === -1) {
core.setOutput("package_version", core.getInput('current_package_version'));
return;
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/gherkin-lint/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: gherkin-lint
description: "Gherkin linting on feature files"

inputs:
features_path:
description: The path to the feature files
description: "The path to the feature files"
required: true

runs:
Expand Down
1 change: 1 addition & 0 deletions .github/actions/npm-publish-package-stable/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ runs:
shell: bash

- name: Bump NPM package version
if: ${{ steps.get-latest-npm-branch-version.outputs.skip-bump-version != 1 }}
run: |
npm version patch --legacy-peer-deps
VERSION=$(node -p "require('./package.json').version")
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/package-nfpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ runs:
shell: bash

- name: Cache packages
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}
Expand Down
12 changes: 6 additions & 6 deletions .github/actions/package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ runs:
steps:
- name: Restore index file cache
if: "${{ inputs.frontend_index_file != '' && inputs.frontend_index_cache_key != '' }}"
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.frontend_index_file }}
key: ${{ inputs.frontend_index_cache_key }}
fail-on-cache-miss: true

- name: Restore static directory cache
if: "${{ inputs.frontend_static_directory != '' && inputs.frontend_static_cache_key != '' }}"
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.frontend_static_directory }}
key: ${{ inputs.frontend_static_cache_key }}
fail-on-cache-miss: true

- name: Restore widgets directory cache
if: "${{ inputs.frontend_widgets_directory != '' && inputs.frontend_widgets_cache_key != '' }}"
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.frontend_widgets_directory }}
key: ${{ inputs.frontend_widgets_cache_key }}
Expand All @@ -90,15 +90,15 @@ runs:
- name: Restore vendor directory cache
if: "${{ inputs.backend_vendor_directory != '' && inputs.backend_vendor_cache_key != '' }}"
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.backend_vendor_directory }}
key: ${{ inputs.backend_vendor_cache_key }}
fail-on-cache-miss: true

- name: Restore translation directory cache
if: "${{ inputs.translation_directory != '' && inputs.translation_cache_key != '' }}"
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.translation_directory }}
key: ${{ inputs.translation_cache_key }}
Expand Down Expand Up @@ -176,7 +176,7 @@ runs:
retention-days: 1

- name: Cache packaged files
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}
36 changes: 30 additions & 6 deletions .github/actions/promote-to-stable/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ runs:
# Cloud specific promote
# delivery by default to onprem, override to internal if base branch is master
if [[ ${{ inputs.github_base_ref }} == "master" ]]; then
if [[ ${{ inputs.github_ref_name }} == "master" ]]; then
ROOT_REPO_PATH="rpm-standard-internal"
else
ROOT_REPO_PATH="rpm-standard"
Expand Down Expand Up @@ -107,15 +107,30 @@ runs:
shell: bash

- name: Promote DEB package to stable
if: ${{ startsWith(inputs.distrib, 'bullseye') }}
- name: Promote DEB packages to stable
if: ${{ contains(fromJSON('["bullseye", "bookworm"]') , inputs.distrib) }}
run: |
set -eux
echo "[DEBUG] - Major version: ${{ inputs.major_version }}"
echo "[DEBUG] - Minor version: ${{ inputs.minor_version }}"
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
# Define ROOT_REPO_PATH for debian
# There is no cloud ROOT_REPO_PATH for debian, only onprem
# Should there be a need to deploy debian to cloud repositories, please use the same condition as RPM promotion
ROOT_REPO_PATH="apt-standard-${{ inputs.major_version }}"
echo "[DEBUG] - Get path of testing DEB packages to promote to stable."
SRC_PATHS=$(jf rt s --include-dirs apt-standard-${{ inputs.major_version }}-testing/pool/${{ inputs.module }}/*.deb | jq -r '.[].path')
case "${{ inputs.major_version }}" in
"22.10"|"23.04"|"23.10")
SRC_PATHS=$(jf rt search --include-dirs $ROOT_REPO_PATH-testing/pool/${{ inputs.module }}/*.deb | jq -r '.[].path')
;;
*)
SRC_PATHS=$(jf rt search --include-dirs $ROOT_REPO_PATH-testing/pool/${{ inputs.module }}/*${{ inputs.distrib }}*.deb | jq -r '.[].path')
;;
esac
if [[ ${SRC_PATHS[@]} ]]; then
for SRC_PATH in ${SRC_PATHS[@]}; do
Expand All @@ -127,7 +142,7 @@ runs:
fi
echo "[DEBUG] - Build target path."
TARGET_PATH="apt-standard-${{ inputs.major_version }}-${{ inputs.stability }}/pool/${{ inputs.module }}/"
TARGET_PATH="$ROOT_REPO_PATH-${{ inputs.stability }}/pool/${{ inputs.module }}/"
echo "[DEBUG] - Target path: $TARGET_PATH"
echo "[DEBUG] - Promoting DEB testing artifacts to stable."
Expand All @@ -136,7 +151,16 @@ runs:
jf rt download $ARTIFACT --flat
done
for ARTIFACT_DL in $(dir|grep -E "*.deb"); do
case "${{ inputs.major_version }}" in
"22.10"|"23.04"|"23.10")
ARTIFACT_SEARCH_PATTERN=".+\.deb"
;;
*)
ARTIFACT_SEARCH_PATTERN=".+${{ inputs.distrib }}.+\.deb"
;;
esac
for ARTIFACT_DL in $(dir -1|grep -E $ARTIFACT_SEARCH_PATTERN); do
ARCH=$(echo $ARTIFACT_DL | cut -d '_' -f3 | cut -d '.' -f1)
echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH."
jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH" --flat
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/release-sources/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,31 @@ runs:

- name: Restore index file cache
if: "${{ inputs.frontend_index_file != '' && inputs.frontend_index_cache_key != '' }}"
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.frontend_index_file }}
key: ${{ inputs.frontend_index_cache_key }}
fail-on-cache-miss: true

- name: Restore static directory cache
if: "${{ inputs.frontend_static_directory != '' && inputs.frontend_static_cache_key != '' }}"
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.frontend_static_directory }}
key: ${{ inputs.frontend_static_cache_key }}
fail-on-cache-miss: true

- name: Restore vendor directory cache
if: "${{ inputs.backend_vendor_directory != '' && inputs.backend_vendor_cache_key != '' }}"
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.backend_vendor_directory }}
key: ${{ inputs.backend_vendor_cache_key }}
fail-on-cache-miss: true

- name: Restore translation directory cache
if: "${{ inputs.translation_directory != '' && inputs.translation_cache_key != '' }}"
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ inputs.translation_directory }}
key: ${{ inputs.translation_cache_key }}
Expand Down
Loading

0 comments on commit 91d84e8

Please sign in to comment.