diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 8d774885215..9bdf9656114 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -6,9 +6,12 @@ selinux/** @centreon/owners-pipelines
tests/** @centreon/owners-robot-e2e
+.version* @centreon/owners-pipelines
gorgone/ @centreon/owners-perl
gorgone/docs/ @centreon/owners-doc
gorgone/tests/robot/config/ @centreon/owners-perl
*.pm @centreon/owners-perl
*.pl @centreon/owners-perl
+
+.github/scripts/*robot* @centreon/owners-robot-e2e
diff --git a/.github/actions/create-jira-ticket/action.yml b/.github/actions/create-jira-ticket/action.yml
new file mode 100644
index 00000000000..f05a1e81e1e
--- /dev/null
+++ b/.github/actions/create-jira-ticket/action.yml
@@ -0,0 +1,142 @@
+name: Workflow incident tracking
+description: Create Jira ticket on incident
+
+inputs:
+ jira_base_url:
+ required: true
+ description: jira base url
+ jira_user_email:
+ required: true
+ description: jira user email
+ jira_api_token:
+ required: true
+ description: jira api token
+ module_name:
+ required: true
+ description: module name
+ ticket_labels:
+ required: true
+ description: ticket labels, usually Pipeline + Nightly/Veracode + x
+ default: 'Pipeline'
+
+runs:
+ using: "composite"
+ steps:
+ - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
+
+ - name: Get ticket elements from context
+ id: get_context
+ run: |
+ # Safely set/unset IFS in order to parse the table of labels properly
+ [ -n "${IFS+set}" ] && saved_IFS=$IFS
+ IFS=', ' read -a ticket_labels <<< $(echo "${{ inputs.ticket_labels }}" | tr -d "[],'")
+ unset IFS
+ [ -n "${saved_IFS+set}" ] && { IFS=$saved_IFS; unset saved_IFS; }
+
+ # Change context elements (summary, parent epic, etc.) that is checked depending on the ticket labels in the input
+ if [[ "${ticket_labels[@]}" =~ "Veracode" ]]; then
+ parent_epic_id=83818
+ parent_epic_key="AT-268"
+ ticket_summary="PR-${{ github.event.pull_request.number }} incident on ${{ inputs.module_name }}"
+
+ JSON_TEMPLATE_FILE="./.github/actions/create-jira-ticket/veracode-ticket-template.json"
+ sed -i \
+ -e 's|@PULL_REQUEST_NUMBER@|${{ github.event.pull_request.number }}|g' \
+ -e 's|@PULL_REQUEST_URL@|${{ github.event.pull_request.html_url }}|g' $JSON_TEMPLATE_FILE
+ elif [[ "${ticket_labels[@]}" =~ "Nightly" ]]; then
+ parent_epic_id=206242
+ parent_epic_key="MON-151547"
+ ticket_summary="$(date '+%Y-%m-%d') ${{ inputs.module_name }}-${{ github.ref_name }} nightly build failure"
+
+ JSON_TEMPLATE_FILE="./.github/actions/create-jira-ticket/nightly-ticket-template.json"
+ sed -i \
+ -e 's|@MODULE_NAME@|${{ inputs.module_name }}|g' \
+ -e "s|@DATE@|$(date '+%Y-%m-%d')|g" $JSON_TEMPLATE_FILE
+ else
+ echo "::error::Cannot find a valid labelling option for the ticket."
+ exit 1
+ fi
+
+ sed -i \
+ -e 's|@GITHUB_BRANCH@|${{ github.base_ref || github.ref_name }}|g' \
+ -e 's|@GITHUB_SERVER_URL@|${{ github.server_url }}|g' \
+ -e 's|@GITHUB_REPOSITORY@|${{ github.repository }}|g' \
+ -e 's|@GITHUB_RUN_ID@|${{ github.run_id }}|g' \
+ -e 's|@GITHUB_RUN_ATTEMPT@|${{ github.run_attempt }}|g' $JSON_TEMPLATE_FILE
+
+ echo "parent_epic_id=$parent_epic_id" >> $GITHUB_OUTPUT
+ echo "parent_epic_key=$parent_epic_key" >> $GITHUB_OUTPUT
+ echo "ticket_summary=$ticket_summary" >> $GITHUB_OUTPUT
+ echo "json_template_file=$JSON_TEMPLATE_FILE" >> $GITHUB_OUTPUT
+
+ cat $JSON_TEMPLATE_FILE
+ cat $GITHUB_OUTPUT
+ shell: bash
+ env:
+ GH_TOKEN: ${{ github.token }}
+
+ - name: Check if the ticket already exists
+ id: check_ticket
+ run: |
+ # Checking if an incident ticket already exists
+ response=$(curl \
+ --write-out "%{http_code}" \
+ --request POST \
+ --url "${{ inputs.jira_base_url }}/rest/api/3/search" \
+ --user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
+ --header "Accept:application/json" \
+ --header "Content-Type:application/json" \
+ --data '{
+ "fields": ["summary"],
+ "jql": "project = MON AND parentEpic = ${{ steps.get_context.outputs.parent_epic_key }} AND issueType = Technical AND summary ~ \"${{ steps.get_context.outputs.ticket_summary }}\" AND component = \"${{ inputs.module_name }}\" AND resolution = unresolved ORDER BY key ASC",
+ "maxResults": 1
+ }'
+ )
+ echo "[DEBUG] $response"
+ if [[ $(echo "$response" | tr -d '\n' | tail -c 3) -ne 200 ]]; then
+ echo "::error:: Jira API request was not completed properly."
+ fi
+ check_if_ticket_exists=$(echo "$response" | head -c -4 | jq .issues[0].key)
+ if [[ "$check_if_ticket_exists" != "null" ]]; then
+ echo "abort_ticket_creation=true" >> $GITHUB_ENV
+ echo "::error::ticket found as $check_if_ticket_exists aborting ticket creation"
+ fi
+ shell: bash
+
+ - name: Create Jira Issue
+ if: ${{ env.abort_ticket_creation != 'true' }}
+ run: |
+ # Creating a new incident ticket on Jira
+ DATA=$( cat <<-EOF
+ {
+ "fields": {
+ "summary": "${{ steps.get_context.outputs.ticket_summary }}",
+ "project": {"key": "MON"},
+ "issuetype": {"id": "10209"},
+ "parent": {"id": "${{ steps.get_context.outputs.parent_epic_id }}", "key": "${{ steps.get_context.outputs.parent_epic_key }}"},
+ "labels": ${{ inputs.ticket_labels }},
+ "components":[{"name": "${{ inputs.module_name }}"}],
+ "customfield_10902": {"id": "10524", "value": "DevSecOps"},
+ "customfield_10005": 1.0,
+ "description": $(cat ${{ steps.get_context.outputs.json_template_file }})
+ }
+ }
+ EOF
+ )
+
+ response=$(curl \
+ --request POST \
+ --url "${{ inputs.jira_base_url }}/rest/api/3/issue" \
+ --user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
+ --header 'Accept: application/json' \
+ --header 'Content-Type: application/json' \
+ --data "$DATA")
+ echo $response
+ if [ $? -ne 0 ]; then
+ echo "::error::Failed to create ticket: $response"
+ exit 1
+ fi
+
+ ticket_key=$(echo "$response" | jq -r .key)
+ echo "::notice::Created ticket: $ticket_key"
+ shell: bash
diff --git a/.github/actions/create-jira-ticket/nightly-ticket-template.json b/.github/actions/create-jira-ticket/nightly-ticket-template.json
new file mode 100644
index 00000000000..aed95eed370
--- /dev/null
+++ b/.github/actions/create-jira-ticket/nightly-ticket-template.json
@@ -0,0 +1,32 @@
+{
+ "version": 1,
+ "type": "doc",
+ "content": [
+ {
+ "type": "paragraph",
+ "content": [
+ {
+ "type": "text",
+ "text": "This incident ticket relates to the @MODULE_NAME@ nightly on the @GITHUB_BRANCH@ branch which failed on @DATE@."
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "content": [
+ {
+ "type": "text",
+ "text": "Link to the failed nightly",
+ "marks": [
+ {
+ "type": "link",
+ "attrs": {
+ "href": "@GITHUB_SERVER_URL@/@GITHUB_REPOSITORY@/actions/runs/@GITHUB_RUN_ID@/attempts/@GITHUB_RUN_ATTEMPT@"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/.github/actions/deb-delivery/action.yml b/.github/actions/deb-delivery/action.yml
index 1c6a3850ba0..0d273949050 100644
--- a/.github/actions/deb-delivery/action.yml
+++ b/.github/actions/deb-delivery/action.yml
@@ -30,7 +30,7 @@ runs:
using: "composite"
steps:
- name: Use cache DEB files
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.deb
key: ${{ inputs.cache_key }}
diff --git a/.github/actions/delivery/action.yml b/.github/actions/delivery/action.yml
index 663b1f35549..a4598268652 100644
--- a/.github/actions/delivery/action.yml
+++ b/.github/actions/delivery/action.yml
@@ -42,7 +42,7 @@ runs:
echo "extfile=deb" >> $GITHUB_ENV
- name: Use cache files
- uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.${{ env.extfile }}
key: ${{ inputs.cache_key }}
diff --git a/.github/actions/package-legacy/action.yml b/.github/actions/package-legacy/action.yml
index cf5c5afeeb7..663a12a1413 100644
--- a/.github/actions/package-legacy/action.yml
+++ b/.github/actions/package-legacy/action.yml
@@ -10,6 +10,9 @@ inputs:
package_extension:
description: The package extension (deb or rpm)
required: true
+ distrib:
+ description: The distribution
+ required: true
frontend_index_cache_key:
description: The index.html cache key
frontend_index_file:
@@ -57,7 +60,7 @@ runs:
steps:
- name: Restore index file cache
if: "${{ inputs.frontend_index_file != '' && inputs.frontend_index_cache_key != '' }}"
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ inputs.frontend_index_file }}
key: ${{ inputs.frontend_index_cache_key }}
@@ -65,7 +68,7 @@ runs:
- name: Restore static directory cache
if: "${{ inputs.frontend_static_directory != '' && inputs.frontend_static_cache_key != '' }}"
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ inputs.frontend_static_directory }}
key: ${{ inputs.frontend_static_cache_key }}
@@ -73,7 +76,7 @@ runs:
- name: Restore widgets directory cache
if: "${{ inputs.frontend_widgets_directory != '' && inputs.frontend_widgets_cache_key != '' }}"
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ inputs.frontend_widgets_directory }}
key: ${{ inputs.frontend_widgets_cache_key }}
@@ -87,7 +90,7 @@ runs:
- name: Restore vendor directory cache
if: "${{ inputs.backend_vendor_directory != '' && inputs.backend_vendor_cache_key != '' }}"
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ inputs.backend_vendor_directory }}
key: ${{ inputs.backend_vendor_cache_key }}
@@ -95,7 +98,7 @@ runs:
- name: Restore translation directory cache
if: "${{ inputs.translation_directory != '' && inputs.translation_cache_key != '' }}"
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ${{ inputs.translation_directory }}
key: ${{ inputs.translation_cache_key }}
@@ -166,14 +169,14 @@ runs:
shell: bash
- name: Upload package artifacts
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
+ uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
- name: packages-${{ inputs.package_extension }}
+ name: packages-${{ inputs.package_extension }}-${{ inputs.distrib }}
path: ./*.${{ inputs.package_extension }}
retention-days: 1
- name: Cache packaged files
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}
diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml
index 4816e2545c5..d54a1a8b4e7 100644
--- a/.github/actions/package/action.yml
+++ b/.github/actions/package/action.yml
@@ -103,7 +103,7 @@ runs:
shell: bash
- name: Cache packages
- uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
+ uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}
@@ -111,7 +111,7 @@ runs:
# Update if condition to true to get packages as artifacts
- if: ${{ false }}
name: Upload package artifacts
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
+ uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: ${{ inputs.arch != '' && format('packages-{0}-{1}', inputs.distrib, inputs.arch) || format('packages-{0}', inputs.distrib) }}
path: ./*.${{ inputs.package_extension }}
diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml
index 2c1a32eae09..98ddb3dbbe3 100644
--- a/.github/actions/release/action.yml
+++ b/.github/actions/release/action.yml
@@ -61,7 +61,11 @@ runs:
# Get previous and new version tags for components
for component in ${COMPONENTS_COLLECT[@]}; do
MAJOR_VERSION=$(grep -E "MAJOR" .version | cut -d '=' -f2)
- MINOR_VERSION=$(grep -E "MINOR" .version | cut -d '=' -f2)
+ if [[ "$component" == "centreon-collect" ]]; then
+ MINOR_VERSION=$(grep -E "MINOR" .version | cut -d '=' -f2)
+ else
+ MINOR_VERSION=$(grep -E "MINOR" .version.$component | cut -d '=' -f2)
+ fi
# Previous stable tags array
if [[ $RELEASE_CLOUD -eq 1 ]]; then
PREVIOUS_STABLE_TAGS+=($(git tag -l --sort=-version:refname "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION.*-*" | head -n 1))
diff --git a/.github/actions/rpm-delivery/action.yml b/.github/actions/rpm-delivery/action.yml
index b1fbc79e2d7..0acd7fc49cc 100644
--- a/.github/actions/rpm-delivery/action.yml
+++ b/.github/actions/rpm-delivery/action.yml
@@ -30,7 +30,7 @@ runs:
using: "composite"
steps:
- name: Use cache RPM files
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.rpm
key: ${{ inputs.cache_key }}
diff --git a/.github/docker/Dockerfile.centreon-collect-alma8 b/.github/docker/Dockerfile.centreon-collect-alma8
index ee8b46693df..155c5d60993 100644
--- a/.github/docker/Dockerfile.centreon-collect-alma8
+++ b/.github/docker/Dockerfile.centreon-collect-alma8
@@ -49,7 +49,7 @@ dnf install -y cmake \
perl-interpreter \
rpm-build \
zstd \
- nfpm
+ nfpm-2.41.1
dnf update libarchive
diff --git a/.github/docker/Dockerfile.centreon-collect-alma9 b/.github/docker/Dockerfile.centreon-collect-alma9
index e774c8837ff..9438dd1ef54 100644
--- a/.github/docker/Dockerfile.centreon-collect-alma9
+++ b/.github/docker/Dockerfile.centreon-collect-alma9
@@ -44,7 +44,7 @@ dnf --best install -y cmake \
rpm-build \
procps-ng \
zstd \
- nfpm \
+ nfpm-2.41.1 \
sudo
# TEMPORARY PYTHON UPGRADE TO 3.18 TO HELP WITH DATA_FILTER ISSUE
diff --git a/.github/docker/Dockerfile.centreon-collect-debian-bullseye b/.github/docker/Dockerfile.centreon-collect-debian-bullseye
index 39517321206..6ddb7da76f5 100644
--- a/.github/docker/Dockerfile.centreon-collect-debian-bullseye
+++ b/.github/docker/Dockerfile.centreon-collect-debian-bullseye
@@ -37,7 +37,7 @@ apt-get -y install cmake \
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
apt-get update
-apt-get install -y nfpm
+apt-get install -y nfpm=2.41.1
apt-get clean
diff --git a/.github/docker/Dockerfile.centreon-collect-mysql-alma9 b/.github/docker/Dockerfile.centreon-collect-mysql-alma9
index beb6bb45a2b..f1976ec9366 100644
--- a/.github/docker/Dockerfile.centreon-collect-mysql-alma9
+++ b/.github/docker/Dockerfile.centreon-collect-mysql-alma9
@@ -45,7 +45,7 @@ dnf --best install -y cmake \
rpm-build \
procps-ng \
zstd \
- nfpm \
+ nfpm-2.41.1 \
sudo
pip3 install conan==1.64.0 --prefix=/usr --upgrade
diff --git a/.github/workflows/centreon-collect.yml b/.github/workflows/centreon-collect.yml
index 592f34c29c7..dccf083f3ba 100644
--- a/.github/workflows/centreon-collect.yml
+++ b/.github/workflows/centreon-collect.yml
@@ -1,4 +1,10 @@
-name: Centreon collect
+name: centreon-collect
+run-name: |
+ ${{
+ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.nightly_manual_trigger == 'true'))
+ && format('collect nightly {0}', github.ref_name)
+ || ''
+ }}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -6,8 +12,17 @@ concurrency:
on:
workflow_dispatch:
+ inputs:
+ nightly_manual_trigger:
+ description: 'Set to true for nightly run'
+ required: true
+ default: false
+ type: boolean
+ schedule:
+ - cron: '30 0 * * 1-5'
pull_request:
paths:
+ - ".version.centreon-collect"
- bbdo/**
- broker/**
- ccc/**
@@ -30,6 +45,7 @@ on:
- master
- "[2-9][0-9].[0-9][0-9].x"
paths:
+ - ".version.centreon-collect"
- bbdo/**
- broker/**
- ccc/**
@@ -51,12 +67,14 @@ jobs:
uses: ./.github/workflows/get-environment.yml
with:
version_file: CMakeLists.txt
+ nightly_manual_trigger: ${{ inputs.nightly_manual_trigger || false }}
unit-test:
needs: [get-environment]
- if: ${{ ! contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ needs.get-environment.outputs.stability != 'stable'
runs-on: [self-hosted, collect]
-
strategy:
fail-fast: false
matrix:
@@ -84,7 +102,9 @@ jobs:
package:
needs: [get-environment]
- if: ${{ ! contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ needs.get-environment.outputs.stability != 'stable'
uses: ./.github/workflows/package-collect.yml
with:
major_version: ${{ needs.get-environment.outputs.major_version }}
@@ -93,12 +113,63 @@ jobs:
release: ${{ needs.get-environment.outputs.release }}
commit_hash: ${{ github.sha }}
stability: ${{ needs.get-environment.outputs.stability }}
+ is_nightly: ${{ needs.get-environment.outputs.is_nightly }}
secrets: inherit
+ robot-test:
+ needs: [get-environment, package]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ needs.get-environment.outputs.stability != 'stable' &&
+ needs.get-environment.outputs.is_nightly == 'true' &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled') &&
+ github.repository == 'centreon/centreon-collect'
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - distrib: el9
+ image: centreon-collect-alma9-test
+ database_type: mariadb
+ test_group_name: robot_test-mariadb-el9-amd64
+ - distrib: el9
+ image: centreon-collect-mysql-alma9-test
+ database_type: mysql
+ test_group_name: robot_test-mysql-el9-amd64
+
+ name: robot test ${{ matrix.test_group_name }}
+
+ uses: ./.github/workflows/robot-test.yml
+ with:
+ image: ${{ matrix.image }}
+ full_name: ${{ matrix.image }}:${{ needs.get-environment.outputs.test_img_version }}
+ distrib: ${{ matrix.distrib }}
+ database_type: ${{ matrix.database_type }}
+ test_group_name: ${{ matrix.test_group_name }}
+ secrets:
+ registry_username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
+ registry_password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
+ collect_s3_access_key: ${{ secrets.COLLECT_S3_ACCESS_KEY }}
+ collect_s3_secret_key: ${{ secrets.COLLECT_S3_SECRET_KEY }}
+ xray_client_id: ${{ secrets.XRAY_CLIENT_ID }}
+ xray_client_secret: ${{ secrets.XRAY_CLIENT_SECRET }}
+ jira_base_url: ${{ secrets.JIRA_BASE_URL }}
+ jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
+ jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
+
deliver-sources:
runs-on: [self-hosted, common]
needs: [get-environment, package]
- if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch' }}
+ if: |
+ github.event_name != 'workflow_dispatch' &&
+ needs.get-environment.outputs.stability == 'stable' &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled') &&
+ github.repository == 'centreon/centreon-collect'
steps:
- name: Checkout sources
@@ -117,8 +188,14 @@ jobs:
token_download_centreon_com: ${{ secrets.TOKEN_DOWNLOAD_CENTREON_COM }}
deliver-rpm:
- if: ${{ contains(fromJson('["testing", "stable"]'), needs.get-environment.outputs.stability) }}
- needs: [get-environment, package]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled') &&
+ github.repository == 'centreon/centreon-collect'
+ needs: [get-environment, robot-test]
runs-on: [self-hosted, common]
strategy:
matrix:
@@ -146,9 +223,28 @@ jobs:
release_type: ${{ needs.get-environment.outputs.release_type }}
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
+ - name: Create Jira ticket if nightly build failure
+ if: |
+ needs.get-environment.outputs.is_nightly == 'true' && github.run_attempt == 1 &&
+ failure() &&
+ startsWith(github.ref_name, 'dev')
+ uses: ./.github/actions/create-jira-ticket
+ with:
+ jira_base_url: ${{ secrets.JIRA_BASE_URL }}
+ jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
+ jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
+ module_name: "centreon-collect"
+ ticket_labels: '["Nightly", "Pipeline", "nightly-${{ github.ref_name }}", "${{ github.job }}"]'
+
deliver-deb:
- if: ${{ contains(fromJson('["testing", "stable"]'), needs.get-environment.outputs.stability) }}
- needs: [get-environment, package]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled') &&
+ github.repository == 'centreon/centreon-collect'
+ needs: [get-environment, robot-test]
runs-on: [self-hosted, common]
strategy:
matrix:
@@ -174,9 +270,29 @@ jobs:
release_type: ${{ needs.get-environment.outputs.release_type }}
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
+ - name: Create Jira ticket if nightly build failure
+ if: |
+ needs.get-environment.outputs.is_nightly == 'true' && github.run_attempt == 1 &&
+ failure() &&
+ startsWith(github.ref_name, 'dev')
+ uses: ./.github/actions/create-jira-ticket
+ with:
+ jira_base_url: ${{ secrets.JIRA_BASE_URL }}
+ jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
+ jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
+ module_name: "centreon-collect"
+ ticket_labels: '["Nightly", "Pipeline", "nightly-${{ github.ref_name }}", "${{ github.job }}"]'
+
promote:
- needs: [get-environment]
- if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch' }}
+ needs: [get-environment, deliver-rpm, deliver-deb]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ (contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled') &&
+ github.repository == 'centreon/centreon-collect'
+
runs-on: [self-hosted, common]
strategy:
matrix:
@@ -197,3 +313,12 @@ jobs:
github_ref_name: ${{ github.ref_name }}
release_type: ${{ needs.get-environment.outputs.release_type }}
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
+
+ set-skip-label:
+ needs: [get-environment, deliver-rpm, deliver-deb, promote]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
+ uses: ./.github/workflows/set-pull-request-skip-label.yml
diff --git a/.github/workflows/docker-builder.yml b/.github/workflows/docker-builder.yml
index 9fc2bc52d9f..f8038b37449 100644
--- a/.github/workflows/docker-builder.yml
+++ b/.github/workflows/docker-builder.yml
@@ -18,12 +18,16 @@ on:
jobs:
get-environment:
+ if: github.repository == 'centreon/centreon-collect'
uses: ./.github/workflows/get-environment.yml
with:
version_file: CMakeLists.txt
- create-and-push-docker:
+ dockerize:
needs: [get-environment]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ needs.get-environment.outputs.stability != 'stable'
strategy:
fail-fast: false
@@ -92,3 +96,12 @@ jobs:
pull: true
push: true
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:${{ matrix.tag }}
+
+ set-skip-label:
+ needs: [get-environment, dockerize]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
+ uses: ./.github/workflows/set-pull-request-skip-label.yml
diff --git a/.github/workflows/get-environment.yml b/.github/workflows/get-environment.yml
index d88b4128337..9d064fcc57f 100644
--- a/.github/workflows/get-environment.yml
+++ b/.github/workflows/get-environment.yml
@@ -5,6 +5,9 @@ on:
required: false
type: string
default: CMakeLists.txt
+ nightly_manual_trigger:
+ required: false
+ type: boolean
outputs:
latest_major_version:
description: "latest major version"
@@ -33,6 +36,9 @@ on:
is_targeting_feature_branch:
description: "if it is a PR, check if targeting a feature branch"
value: ${{ jobs.get-environment.outputs.is_targeting_feature_branch }}
+ is_nightly:
+ description: "if the current workflow run is considered a nightly"
+ value: ${{ jobs.get-environment.outputs.is_nightly }}
img_version:
description: "docker image version (vcpkg checksum)"
value: ${{ jobs.get-environment.outputs.img_version }}
@@ -42,6 +48,9 @@ on:
gorgone_docker_version:
description: "md5 of gorgone dockerfile"
value: ${{ jobs.get-environment.outputs.gorgone_docker_version }}
+ skip_workflow:
+ description: "if the current workflow should be skipped"
+ value: ${{ jobs.get-environment.outputs.skip_workflow }}
jobs:
get-environment:
@@ -56,13 +65,41 @@ jobs:
target_stability: ${{ steps.get_stability.outputs.target_stability }}
release_type: ${{ steps.get_release_type.outputs.release_type }}
is_targeting_feature_branch: ${{ steps.get_stability.outputs.is_targeting_feature_branch }}
+ is_nightly: ${{ steps.get_nightly_status.outputs.is_nightly }}
img_version: ${{ steps.get_docker_images_version.outputs.img_version }}
test_img_version: ${{ steps.get_docker_images_version.outputs.test_img_version }}
gorgone_docker_version: ${{ steps.get_docker_images_version.outputs.gorgone_docker_version }}
+ skip_workflow: ${{ steps.skip_workflow.outputs.result }}
steps:
+ - name: Check if PR has skip label
+ id: has_skip_label
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ with:
+ script: |
+ let hasSkipLabel = false;
+ if (${{ contains(fromJSON('["pull_request", "pull_request_target"]') , github.event_name) }} === true) {
+ try {
+ const labels = await github.rest.issues.listLabelsOnIssue({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number
+ });
+ labels.data.forEach(({ name }) => {
+ if (name === '${{ format('skip-workflow-{0}', github.workflow) }}') {
+ hasSkipLabel = true;
+ }
+ });
+ } catch (e) {
+ core.warning(`failed to list labels: ${e}`);
+ }
+ }
+ return hasSkipLabel;
+
- name: Checkout sources (current branch)
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
+ with:
+ fetch-depth: ${{ steps.has_skip_label.outputs.result == 'true' && 100 || 1 }}
# get latest major version to detect cloud / on-prem versions
- name: Checkout sources (develop branch)
@@ -72,6 +109,102 @@ jobs:
path: centreon-develop
sparse-checkout: .version
+ - if: ${{ steps.has_skip_label.outputs.result == 'true' }}
+ name: Get workflow triggered paths
+ id: get_workflow_triggered_paths
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ with:
+ script: |
+ const fs = require('fs');
+
+ let paths = [];
+
+ const workflowFilePath = '${{ github.workflow_ref }}'.replace('${{ github.repository }}/', '').split('@').shift();
+
+ if (fs.existsSync(workflowFilePath)) {
+ const workflowFileContent = fs.readFileSync(workflowFilePath, 'utf8');
+ const workflowFileContentLines = workflowFileContent.split('\n');
+
+ let hasReadOn = false;
+ let hasReadPullRequest = false;
+ let hasReadPaths = false;
+ for (const line of workflowFileContentLines) {
+ if (line.match(/^on:\s*$/)) {
+ hasReadOn = true;
+ continue;
+ }
+ if (line.match(/^\s{2}pull_request(_target)?:\s*$/)) {
+ hasReadPullRequest = true;
+ continue;
+ }
+ if (line.match(/^\s{4}paths:\s*$/)) {
+ hasReadPaths = true;
+ continue;
+ }
+
+ if (hasReadOn && hasReadPullRequest && hasReadPaths) {
+ const matches = line.match(/^\s{6}-\s['"](.+)['"]\s*$/);
+ if (matches) {
+ paths.push(matches[1].trim());
+ } else {
+ break;
+ }
+ }
+ }
+ }
+
+ if (paths.length === 0) {
+ paths = ['**'];
+ }
+
+ console.log(paths);
+
+ return paths;
+
+ - if: ${{ steps.has_skip_label.outputs.result == 'true' }}
+ name: Get push changes
+ id: get_push_changes
+ uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45.0.5
+ with:
+ since_last_remote_commit: true
+ json: true
+ escape_json: false
+ files: ${{ join(fromJSON(steps.get_workflow_triggered_paths.outputs.result), ';') }}
+ files_separator: ';'
+
+ - name: Check if current workflow should be skipped
+ id: skip_workflow
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ with:
+ script: |
+ if (/^bump-.+/.test('${{ github.head_ref || github.ref_name }}')) {
+ core.notice('skipping workflow because it is a bump branch');
+ return true;
+ }
+
+ if (${{ steps.has_skip_label.outputs.result }} === false) {
+ return false;
+ }
+
+ const label = '${{ format('skip-workflow-{0}', github.workflow) }}';
+ if ('${{ steps.get_push_changes.outputs.any_changed }}' === 'true') {
+ try {
+ await github.rest.issues.removeLabel({
+ name: label,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number
+ });
+ core.notice(`label ${label} removed because changes were detected on last push.`);
+ } catch (e) {
+ core.warning(`failed to remove label ${label}: ${e}`);
+ }
+
+ return false;
+ }
+
+ return true;
+
- name: Store latest major version
id: latest_major_version
run: |
@@ -164,6 +297,12 @@ jobs:
MAJOR=$(awk '$1 ~ "COLLECT_MAJOR" {maj=substr($2, 1, length($2)-1)} $1 ~ "COLLECT_MINOR" {min=substr($2, 1, length($2)-1) ; print maj "." min}' CMakeLists.txt)
MINOR=$(awk '$1 ~ "COLLECT_PATCH" {print substr($2, 1, length($2) - 1)}' CMakeLists.txt)
VERSION="$MAJOR.$MINOR"
+ elif [[ "${{ inputs.version_file }}" == .version.* ]]; then
+ . .version
+ . ${{ inputs.version_file }}
+ VERSION_MAJOR=`sed -e '/\[[2-9][0-9].[0-9][0-9].[0-9]+\]/p' .version | cut -d '=' -f 2`
+ VERSION_MINOR=`sed -e '/\[[0-9]+\]/p' ${{ inputs.version_file }} | cut -d '=' -f 2`
+ VERSION="$VERSION_MAJOR.$VERSION_MINOR"
else
echo "Unable to parse version file ${{ inputs.version_file }}"
exit 1
@@ -226,6 +365,25 @@ jobs:
return false;
+ - name: Detect nightly status
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ id: get_nightly_status
+ env:
+ NIGHTLY_MANUAL_TRIGGER: ${{ inputs.nightly_manual_trigger }}
+ with:
+ script: |
+ const getNightlyInput = () => {
+ const nightly_manual_trigger = process.env.NIGHTLY_MANUAL_TRIGGER;
+ console.log(nightly_manual_trigger);
+ if (typeof nightly_manual_trigger === 'undefined' || nightly_manual_trigger === '') {
+ return 'false';
+ } else if (context.eventName === 'schedule' || context.eventName === 'workflow_dispatch' && nightly_manual_trigger === 'true' ) {
+ return 'true';
+ }
+ return 'false';
+ };
+ core.setOutput('is_nightly', getNightlyInput());
+
- name: Get docker images version
id: get_docker_images_version
run: |
@@ -254,9 +412,11 @@ jobs:
['stability', '${{ steps.get_stability.outputs.stability }}'],
['release_type', '${{ steps.get_release_type.outputs.release_type || 'not defined because this is not a release' }}'],
['is_targeting_feature_branch', '${{ steps.get_stability.outputs.is_targeting_feature_branch }}'],
+ ['is_nightly', '${{ steps.get_nightly_status.outputs.is_nightly }}'],
['img_version', '${{ steps.get_docker_images_version.outputs.img_version }}'],
['test_img_version', '${{ steps.get_docker_images_version.outputs.test_img_version }}'],
['gorgone_docker_version', '${{ steps.get_docker_images_version.outputs.gorgone_docker_version }}'],
+ ['skip_workflow', '${{ steps.skip_workflow.outputs.result }}'],
];
outputTable.push(['target_stability', '${{ steps.get_stability.outputs.target_stability || 'not defined because current run is not triggered by pull request event' }}']);
diff --git a/.github/workflows/gorgone-analysis.yml b/.github/workflows/gorgone-analysis.yml
new file mode 100644
index 00000000000..7551a219c10
--- /dev/null
+++ b/.github/workflows/gorgone-analysis.yml
@@ -0,0 +1,71 @@
+name: gorgone-analysis
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
+
+on:
+ workflow_dispatch:
+ inputs:
+ unit_tests:
+ description: 'Execute the unit tests'
+ required: true
+ default: true
+ type: boolean
+ pull_request:
+ types:
+ - opened
+ - synchronize
+ - reopened
+ - ready_for_review
+ paths:
+ - ".version"
+ - "gorgone/**"
+ - "perl-libs/**"
+ - "!gorgone/tests/**"
+ - "!gorgone/veracode.json"
+ - "!gorgone/.veracode-exclusions"
+ push:
+ branches:
+ - develop
+ - dev-[2-9][0-9].[0-9][0-9].x
+ - master
+ - "[2-9][0-9].[0-9][0-9].x"
+ paths:
+ - ".version"
+ - "gorgone/**"
+ - "perl-libs/**"
+ - "!gorgone/tests/**"
+ - "!gorgone/veracode.json"
+ - "!gorgone/.veracode-exclusions"
+
+env:
+ base_directory: gorgone
+
+jobs:
+ get-environment:
+ uses: ./.github/workflows/get-environment.yml
+ with:
+ version_file: .version.centreon-gorgone
+
+ veracode-analysis:
+ needs: [get-environment]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ needs.get-environment.outputs.is_targeting_feature_branch != 'true' &&
+ github.event.pull_request.draft != 'true'
+ uses: ./.github/workflows/veracode-analysis.yml
+ with:
+ module_directory: gorgone
+ module_name: centreon-gorgone
+ major_version: ${{ needs.get-environment.outputs.major_version }}
+ minor_version: ${{ needs.get-environment.outputs.minor_version }}
+ secrets:
+ veracode_api_id: ${{ secrets.VERACODE_API_ID_GORG }}
+ veracode_api_key: ${{ secrets.VERACODE_API_KEY_GORG }}
+ veracode_srcclr_token: ${{ secrets.VERACODE_SRCCLR_TOKEN }}
+
+ set-skip-label:
+ needs: [get-environment, veracode-analysis]
+ if: needs.get-environment.outputs.skip_workflow == 'false'
+ uses: ./.github/workflows/set-pull-request-skip-label.yml
diff --git a/.github/workflows/gorgone.yml b/.github/workflows/gorgone.yml
index 1f3874fcac8..dcda6367e89 100644
--- a/.github/workflows/gorgone.yml
+++ b/.github/workflows/gorgone.yml
@@ -7,12 +7,8 @@ concurrency:
on:
workflow_dispatch:
pull_request:
- types:
- - opened
- - synchronize
- - reopened
- - ready_for_review
paths:
+ - ".version.centreon-gorgone"
- "gorgone/**"
- "!gorgone/tests/**"
- "!gorgone/veracode.json"
@@ -24,6 +20,7 @@ on:
- master
- "[2-9][0-9].[0-9][0-9].x"
paths:
+ - ".version.centreon-gorgone"
- "gorgone/**"
- "!gorgone/tests/**"
- "!gorgone/veracode.json"
@@ -36,28 +33,13 @@ jobs:
get-environment:
uses: ./.github/workflows/get-environment.yml
with:
- version_file: gorgone/.version
-
- veracode-analysis:
- needs: [get-environment]
- if: ${{ needs.get-environment.outputs.is_targeting_feature_branch != 'true' && github.event.pull_request.draft != 'true' }}
- uses: ./.github/workflows/veracode-analysis.yml
- with:
- module_directory: gorgone
- module_name: centreon-gorgone
- major_version: ${{ needs.get-environment.outputs.major_version }}
- minor_version: ${{ needs.get-environment.outputs.minor_version }}
- img_version: ${{ needs.get-environment.outputs.img_version }}
- secrets:
- veracode_api_id: ${{ secrets.VERACODE_API_ID_GORG }}
- veracode_api_key: ${{ secrets.VERACODE_API_KEY_GORG }}
- veracode_srcclr_token: ${{ secrets.VERACODE_SRCCLR_TOKEN }}
- docker_registry_id: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
- docker_registry_passwd: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
+ version_file: .version.centreon-gorgone
package:
needs: [get-environment]
- if: ${{ needs.get-environment.outputs.stability != 'stable' }}
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ needs.get-environment.outputs.stability != 'stable'
strategy:
fail-fast: false
@@ -79,6 +61,7 @@ jobs:
base_directory: gorgone
spec_file: gorgone/packaging/centreon-gorgone.spectemplate
package_extension: ${{ matrix.package_extension }}
+ distrib: ${{ matrix.distrib }}
image_name: ${{ matrix.image }}
module_name: gorgone
major_version: ${{ needs.get-environment.outputs.major_version }}
@@ -95,7 +78,12 @@ jobs:
deliver-sources:
runs-on: [self-hosted, common]
needs: [get-environment, package]
- if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch' }}
+ if: |
+ github.event_name != 'workflow_dispatch' &&
+ needs.get-environment.outputs.stability == 'stable' &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
steps:
- name: Checkout sources
@@ -114,7 +102,12 @@ jobs:
deliver-rpm:
runs-on: [self-hosted, common]
needs: [get-environment, package]
- if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
strategy:
matrix:
@@ -139,7 +132,12 @@ jobs:
deliver-deb:
runs-on: [self-hosted, common]
needs: [get-environment, package]
- if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
strategy:
matrix:
@@ -162,8 +160,15 @@ jobs:
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
promote:
- needs: [get-environment]
- if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch' }}
+ needs: [get-environment, deliver-rpm, deliver-deb]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ (contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled') &&
+ github.repository == 'centreon/centreon-collect'
+
runs-on: [self-hosted, common]
strategy:
matrix:
@@ -184,3 +189,12 @@ jobs:
github_ref_name: ${{ github.ref_name }}
release_type: ${{ needs.get-environment.outputs.release_type }}
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
+
+ set-skip-label:
+ needs: [get-environment, deliver-rpm, deliver-deb, promote]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
+ uses: ./.github/workflows/set-pull-request-skip-label.yml
diff --git a/.github/workflows/libzmq.yml b/.github/workflows/libzmq.yml
index a72942def05..7879ac506f7 100644
--- a/.github/workflows/libzmq.yml
+++ b/.github/workflows/libzmq.yml
@@ -24,6 +24,9 @@ jobs:
package-rpm:
needs: [get-environment]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ needs.get-environment.outputs.stability != 'stable'
strategy:
fail-fast: false
@@ -71,13 +74,16 @@ jobs:
shell: bash
- name: cache rpm
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.rpm
key: ${{ github.run_id }}-${{ github.sha }}-rpm-libzmq-${{ matrix.distrib }}-${{ matrix.arch }}
package-deb:
needs: [get-environment]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ needs.get-environment.outputs.stability != 'stable'
strategy:
fail-fast: false
@@ -123,14 +129,19 @@ jobs:
shell: bash
- name: cache deb
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.deb
key: ${{ github.run_id }}-${{ github.sha }}-deb-libzmq-${{ matrix.distrib }}-${{ matrix.arch }}
deliver-rpm:
- if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package-rpm]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
runs-on: [self-hosted, common]
strategy:
matrix:
@@ -159,8 +170,13 @@ jobs:
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
deliver-deb:
- if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package-deb]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
runs-on: [self-hosted, common]
strategy:
matrix:
@@ -187,8 +203,14 @@ jobs:
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
promote:
- needs: [get-environment]
- if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch' }}
+ needs: [get-environment, deliver-rpm, deliver-deb]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ (contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled') &&
+ github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
@@ -209,3 +231,12 @@ jobs:
github_ref_name: ${{ github.ref_name }}
release_type: ${{ needs.get-environment.outputs.release_type }}
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
+
+ set-skip-label:
+ needs: [get-environment, deliver-rpm, deliver-deb, promote]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
+ uses: ./.github/workflows/set-pull-request-skip-label.yml
diff --git a/.github/workflows/lua-curl.yml b/.github/workflows/lua-curl.yml
index 96f48d668fc..7100f55e2b6 100644
--- a/.github/workflows/lua-curl.yml
+++ b/.github/workflows/lua-curl.yml
@@ -29,7 +29,9 @@ jobs:
package:
needs: [get-environment]
- if: ${{ needs.get-environment.outputs.stability != 'stable' }}
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ needs.get-environment.outputs.stability != 'stable'
strategy:
fail-fast: false
@@ -152,7 +154,12 @@ jobs:
stability: ${{ needs.get-environment.outputs.stability }}
deliver-rpm:
- if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
needs: [get-environment, package]
runs-on: ubuntu-24.04
strategy:
@@ -181,7 +188,12 @@ jobs:
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
deliver-deb:
- if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ contains(fromJson('["unstable", "testing"]'), needs.get-environment.outputs.stability) &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
needs: [get-environment, package]
runs-on: ubuntu-24.04
strategy:
@@ -208,8 +220,14 @@ jobs:
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
promote:
- needs: [get-environment]
- if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch' }}
+ needs: [get-environment, deliver-rpm, deliver-deb]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ (contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) && github.event_name != 'workflow_dispatch') &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled') &&
+ github.repository == 'centreon/centreon-collect'
runs-on: [self-hosted, common]
strategy:
matrix:
@@ -230,3 +248,12 @@ jobs:
github_ref_name: ${{ github.ref_name }}
release_type: ${{ needs.get-environment.outputs.release_type }}
is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
+
+ set-skip-label:
+ needs: [get-environment, deliver-rpm, deliver-deb, promote]
+ if: |
+ needs.get-environment.outputs.skip_workflow == 'false' &&
+ ! cancelled() &&
+ ! contains(needs.*.result, 'failure') &&
+ ! contains(needs.*.result, 'cancelled')
+ uses: ./.github/workflows/set-pull-request-skip-label.yml
diff --git a/.github/workflows/package-collect.yml b/.github/workflows/package-collect.yml
index 541939cd169..8d87a613180 100644
--- a/.github/workflows/package-collect.yml
+++ b/.github/workflows/package-collect.yml
@@ -21,7 +21,9 @@ on:
stability:
required: true
type: string
-
+ is_nightly:
+ required: false
+ type: string
jobs:
package-rpm:
runs-on: [self-hosted, collect]
@@ -70,7 +72,7 @@ jobs:
registry_private_token: ${{ secrets.HARBOR_RPM_GPG_SIGNING_REPO_TOKEN }}
- name: Cache RPM files
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
+ uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.rpm
key: ${{ github.run_id }}-${{ github.sha }}-rpm-centreon-collect-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
@@ -83,7 +85,7 @@ jobs:
rm -rf *-debugsource*.rpm
- name: Upload package artifacts
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
+ uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: packages-rpm-${{ matrix.distrib }}
path: ./*.rpm
@@ -121,7 +123,24 @@ jobs:
env_variable: -e DISTRIB="${{ matrix.distrib }}" -e VERSION="${{ inputs.major_version }}.${{ inputs.minor_version }}" -e RELEASE="${{ inputs.release }}"
- name: Use cache DEB files
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
+ uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.deb
key: ${{ github.run_id }}-${{ github.sha }}-deb-centreon-collect-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
+
+ create-jira-nightly-ticket:
+ needs: [package-deb, package-rpm]
+ runs-on: ubuntu-24.04
+ if: |
+ inputs.is_nightly == 'true' && github.run_attempt == 1 &&
+ (failure() || cancelled()) &&
+ startsWith(github.ref_name, 'dev')
+ steps:
+ - name: Create Jira ticket if nightly build failure
+ uses: ./.github/actions/create-jira-ticket
+ with:
+ jira_base_url: ${{ secrets.JIRA_BASE_URL }}
+ jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
+ jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
+ module_name: "centreon-collect"
+ ticket_labels: '["Nightly", "Pipeline", "nightly-${{ github.ref_name }}", "package"]'
diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml
index cd1bda7047f..8be9383df1d 100644
--- a/.github/workflows/package.yml
+++ b/.github/workflows/package.yml
@@ -13,6 +13,10 @@ on:
type: string
description: The package extension (deb or rpm)
required: true
+ distrib:
+ type: string
+ description: The package distribution
+ required: true
frontend_index_cache_key:
type: string
description: The index.html cache key
@@ -102,6 +106,7 @@ jobs:
base_directory: ${{ inputs.base_directory }}
spec_file: ${{ inputs.spec_file }}
package_extension: ${{ inputs.package_extension }}
+ distrib: ${{ inputs.distrib }}
frontend_index_cache_key: ${{ inputs.frontend_index_cache_key }}
frontend_index_file: ${{ inputs.frontend_index_file }}
frontend_static_cache_key: ${{ inputs.frontend_static_cache_key }}
@@ -121,7 +126,7 @@ jobs:
cache_key: unsigned-${{ inputs.cache_key }}
- if: ${{ inputs.package_extension == 'deb' }}
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}
@@ -145,7 +150,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- - uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ - uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.${{ inputs.package_extension }}
key: unsigned-${{ inputs.cache_key }}
@@ -156,7 +161,7 @@ jobs:
- run: rpmsign --addsign ./*.${{ inputs.package_extension }}
shell: bash
- - uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ - uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}
diff --git a/.github/workflows/rebase-version.yml b/.github/workflows/rebase-version.yml
index 8c3f36d26cc..eb5c3eb8f8d 100644
--- a/.github/workflows/rebase-version.yml
+++ b/.github/workflows/rebase-version.yml
@@ -13,7 +13,7 @@ jobs:
main:
name: Sync Stable Branches
runs-on: ubuntu-24.04
- if: github.event.pull_request.merged == true
+ if: github.event.pull_request.merged == true && github.repository == 'centreon/centreon-collect'
steps:
- name: git checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index aa40dc0d7e4..3d48f8e7077 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -20,7 +20,7 @@ on:
jobs:
release:
- if: ${{ github.event.pull_request.merged == true }}
+ if: ${{ github.event.pull_request.merged == true && github.repository == 'centreon/centreon-collect' }}
runs-on: ubuntu-24.04
steps:
- name: Check base_ref
diff --git a/.github/workflows/robot-nightly.yml b/.github/workflows/robot-nightly.yml
deleted file mode 100644
index a0c365af0c8..00000000000
--- a/.github/workflows/robot-nightly.yml
+++ /dev/null
@@ -1,139 +0,0 @@
-name: robot-nightly
-run-name: nightly robot ${{ github.head_ref || github.ref_name }}
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
-
-on:
- workflow_dispatch:
- pull_request:
- paths:
- - '.github/workflows/robot-nightly.yml'
- schedule:
- - cron: '0 0 * * *'
-
-jobs:
- dispatch-to-maintained-branches:
- if: ${{ github.event_name == 'schedule' && github.ref_name == 'develop' }}
- runs-on: ubuntu-22.04
- steps:
- - name: Checkout sources
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
-
- - run: |
- gh workflow run robot-nightly.yml -r "dev-23.04.x"
- shell: bash
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
- get-environment:
- uses: ./.github/workflows/get-environment.yml
-
- veracode-analysis:
- needs: [get-environment]
- uses: ./.github/workflows/veracode-analysis.yml
- with:
- module_name: centreon-collect
- major_version: ${{ needs.get-environment.outputs.major_version }}
- minor_version: ${{ needs.get-environment.outputs.minor_version }}
- img_version: ${{ needs.get-environment.outputs.img_version }}
- secrets:
- veracode_api_id: ${{ secrets.VERACODE_API_ID_COLL }}
- veracode_api_key: ${{ secrets.VERACODE_API_KEY_COLL }}
- veracode_srcclr_token: ${{ secrets.VERACODE_SRCCLR_TOKEN }}
- docker_registry_id: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
- docker_registry_passwd: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
-
- package:
- needs: [get-environment]
- uses: ./.github/workflows/package-collect.yml
- with:
- major_version: ${{ needs.get-environment.outputs.major_version }}
- minor_version: ${{ needs.get-environment.outputs.minor_version }}
- img_version: ${{ needs.get-environment.outputs.img_version }}
- release: ${{ needs.get-environment.outputs.release }}
- commit_hash: ${{ github.sha }}
- stability: ${{ needs.get-environment.outputs.stability }}
- secrets: inherit
-
- robot-test:
- needs: [get-environment, package]
-
- strategy:
- fail-fast: false
- matrix:
- include:
- - distrib: el9
- image: centreon-collect-alma9-test
- database_type: mariadb
- test_group_name: robot_test-mariadb-el9-amd64
- - distrib: el9
- image: centreon-collect-mysql-alma9-test
- database_type: mysql
- test_group_name: robot_test-mysql-el9-amd64
-
- name: robot test ${{ matrix.test_group_name }}
-
- uses: ./.github/workflows/robot-test.yml
- with:
- image: ${{ matrix.image }}
- full_name: ${{ matrix.image }}:${{ needs.get-environment.outputs.test_img_version }}
- distrib: ${{ matrix.distrib }}
- database_type: ${{ matrix.database_type }}
- test_group_name: ${{matrix.test_group_name}}
- secrets:
- registry_username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
- registry_password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
-
- deliver-rpm:
- if: ${{ contains(fromJson('["unstable"]'), needs.get-environment.outputs.stability) }}
- needs: [robot-test, get-environment]
- runs-on: [self-hosted, common]
- strategy:
- matrix:
- distrib: [el8, el9]
- name: deliver ${{ matrix.distrib }}
-
- steps:
- - name: Checkout sources
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
-
- - name: Publish RPM packages
- uses: ./.github/actions/delivery
- with:
- module_name: collect
- distrib: ${{ matrix.distrib }}
- major_version: ${{ needs.get-environment.outputs.major_version }}
- artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
- cache_key: ${{ github.run_id }}-${{ github.sha }}-rpm-centreon-collect-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
- stability: ${{ needs.get-environment.outputs.stability }}
- release_type: ${{ needs.get-environment.outputs.release_type }}
- is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
-
- deliver-deb:
- if: ${{ contains(fromJson('["unstable"]'), needs.get-environment.outputs.stability) }}
- needs: [robot-test, get-environment]
- runs-on: [self-hosted, common]
- strategy:
- matrix:
- include:
- - distrib: bullseye
- arch: amd64
- name: deliver ${{ matrix.distrib }}
-
- steps:
- - name: Checkout sources
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
-
- - name: Publish DEB packages
- uses: ./.github/actions/delivery
- with:
- module_name: collect
- distrib: ${{ matrix.distrib }}
- major_version: ${{ needs.get-environment.outputs.major_version }}
- artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
- cache_key: ${{ github.run_id }}-${{ github.sha }}-deb-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
- stability: ${{ needs.get-environment.outputs.stability }}
- release_type: ${{ needs.get-environment.outputs.release_type }}
- is_cloud: ${{ needs.get-environment.outputs.is_cloud }}
diff --git a/.github/workflows/robot-test.yml b/.github/workflows/robot-test.yml
index 8a959da6f25..f161ed30eb9 100644
--- a/.github/workflows/robot-test.yml
+++ b/.github/workflows/robot-test.yml
@@ -16,12 +16,28 @@ on:
test_group_name:
required: true
type: string
+ is_nightly:
+ required: false
+ type: string
secrets:
registry_username:
required: true
registry_password:
required: true
-
+ collect_s3_access_key:
+ required: true
+ collect_s3_secret_key:
+ required: true
+ xray_client_id:
+ required: true
+ xray_client_secret:
+ required: true
+ jira_base_url:
+ required: true
+ jira_user_email:
+ required: true
+ jira_api_token:
+ required: true
jobs:
test-image-to-cache:
runs-on: ubuntu-24.04
@@ -54,7 +70,7 @@ jobs:
shell: bash
- name: image to cache
- uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
+ uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: /tmp/${{inputs.image}}
key: ${{inputs.full_name}}
@@ -94,7 +110,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install RPM packages
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ./*.rpm
key: ${{ github.run_id }}-${{ github.sha }}-rpm-centreon-collect-${{ inputs.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
@@ -125,7 +141,7 @@ jobs:
- name: Upload Test Results
if: ${{ failure() }}
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
+ uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: reports-${{inputs.test_group_name}}-${{ steps.feature-path.outputs.feature_name_with_dash }}
path: reports
@@ -147,7 +163,7 @@ jobs:
merge-multiple: true
- name: Upload the regrouped artifact
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
+ uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: reports-${{inputs.test_group_name}}
path: reports/
@@ -185,14 +201,7 @@ jobs:
echo "End of Deleting"
shell: bash
- # setup-python v5.0.0 relies on node20 which is not supported by el7 distributions
- - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
- if: ${{ inputs.distrib == 'el7'}}
- with:
- python-version: '3.10'
-
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
- if: ${{ inputs.distrib != 'el7' }}
with:
python-version: '3.10'
@@ -207,3 +216,24 @@ jobs:
with:
gh_access_token: ${{ secrets.GITHUB_TOKEN }}
report_path: reports
+ show_passed_tests: false
+
+ create-jira-nightly-ticket:
+ needs: [robot-test-list, robot-test-run, robot-test-report]
+ runs-on: ubuntu-24.04
+ if: |
+ inputs.is_nightly == 'true' && github.run_attempt == 1 &&
+ (failure() || cancelled()) &&
+ startsWith(github.ref_name, 'dev')
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
+
+ - name: Create Jira ticket if nightly build failure
+ uses: ./.github/actions/create-jira-ticket
+ with:
+ jira_base_url: ${{ secrets.jira_base_url }}
+ jira_user_email: ${{ secrets.jira_user_email }}
+ jira_api_token: ${{ secrets.jira_api_token }}
+ module_name: "centreon-collect"
+ ticket_labels: '["Nightly", "Pipeline", "nightly-${{ github.ref_name }}", "robot-test"]'
diff --git a/.github/workflows/set-pull-request-skip-label.yml b/.github/workflows/set-pull-request-skip-label.yml
new file mode 100644
index 00000000000..ffab0b955e2
--- /dev/null
+++ b/.github/workflows/set-pull-request-skip-label.yml
@@ -0,0 +1,26 @@
+name: set-pull-request-skip-label
+
+on:
+ workflow_call:
+
+jobs:
+ set-pull-request-skip-label:
+ if: ${{ success() && contains(fromJSON('["pull_request", "pull_request_target"]') , github.event_name) }}
+ runs-on: ubuntu-24.04
+
+ steps:
+ - name: Set PR skip label
+ uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
+ with:
+ script: |
+ const label = '${{ format('skip-workflow-{0}', github.workflow) }}';
+ try {
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number,
+ labels: [label]
+ });
+ } catch (e) {
+ core.warning(`failed to add label ${label}: ${e}`);
+ }
diff --git a/.github/workflows/synchronize-branches.yml b/.github/workflows/synchronize-branches.yml
index 34ce4758117..78e6f9472c0 100644
--- a/.github/workflows/synchronize-branches.yml
+++ b/.github/workflows/synchronize-branches.yml
@@ -13,7 +13,7 @@ jobs:
main:
name: Sync Stable Branches
runs-on: ubuntu-24.04
- if: github.event.pull_request.merged == true
+ if: github.event.pull_request.merged == true && github.repository == 'centreon/centreon-collect'
steps:
- name: git checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
diff --git a/.github/workflows/veracode-analysis.yml b/.github/workflows/veracode-analysis.yml
index d90359e4b14..25d2a3be353 100644
--- a/.github/workflows/veracode-analysis.yml
+++ b/.github/workflows/veracode-analysis.yml
@@ -14,9 +14,6 @@ on:
minor_version:
required: true
type: string
- img_version:
- required: true
- type: string
secrets:
veracode_api_id:
required: true
@@ -24,10 +21,6 @@ on:
required: true
veracode_srcclr_token:
required: true
- docker_registry_id:
- required: true
- docker_registry_passwd:
- required: true
jobs:
routing:
@@ -62,60 +55,13 @@ jobs:
build:
name: Binary preparation
- runs-on: [self-hosted, collect]
+ runs-on: [self-hosted, common]
needs: [routing]
if: needs.routing.outputs.skip_analysis == 'false'
- container:
- image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/centreon-collect-alma9:${{ inputs.img_version }}
- credentials:
- username: ${{ secrets.docker_registry_id }}
- password: ${{ secrets.docker_registry_passwd }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- - if: ${{ inputs.module_name == 'centreon-collect' }}
- name: Compiling Cpp sources
- run: |
- rm -rf build
- mkdir build
- cd build
-
- sudo pip3 install conan==1.57.0 --prefix=/usr --upgrade
- sudo conan install .. -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
-
- sudo cmake \
- -G "Ninja" \
- -DCMAKE_CXX_FLAGS="-gdwarf-2 -g3 -O0 -fno-builtin" \
- -DWITH_TESTING=OFF \
- -DWITH_BENCH=OFF \
- -DWITH_MODULE_SIMU=OFF \
- -DCMAKE_INSTALL_PREFIX=/usr \
- -DWITH_STARTUP_SCRIPT=systemd \
- -DWITH_ENGINE_LOGROTATE_SCRIPT=ON \
- -DWITH_USER_BROKER=centreon-broker \
- -DWITH_GROUP_BROKER=centreon-broker \
- -DWITH_USER_ENGINE=centreon-engine \
- -DWITH_GROUP_ENGINE=centreon-engine \
- -DWITH_VAR_DIR=/var/log/centreon-engine \
- -DWITH_DAEMONS=ON \
- -DWITH_CREATE_FILES=OFF \
- -DWITH_CONFIG_FILES=ON \
- ..
-
- sudo ninja
-
- echo "[DEBUG] - Find compiled files"
- find ./ -name "*.so"
- echo "[DEBUG] - Build size"
- du -sh ./lib/*.so | sort -rh
-
- - if: ${{ inputs.module_name == 'centreon-collect' }}
- name: Preserve centreon-collect binaries from cleaning
- run: |
- echo "[INFO] - Keeping only compiled files"
- find build -type f -not \( -name "*.so" -or -name "cbd" -or -name "centengine" -or -name "cbwd" -or -name "centreon_connector_*" \) -delete
-
- name: Binary preparation of ${{ inputs.module_name }}
run: |
if [ -n "${{ inputs.module_directory }}" ]; then
@@ -141,25 +87,17 @@ jobs:
echo "::warning::No '.veracode-exclusions' file found for this module. Skipping exclusion step"
fi
- if [ "${{ inputs.module_name }}" = "centreon-collect" ]; then
- echo "[INFO] - Keeping only build's non empty folders"
- find build -empty -type d -delete
- ls -la build
- echo "[INFO] - Generating the tarball"
- tar cvzf "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.tar.gz" build
- else
- echo "[INFO] - Generating the zip"
- zip -rq "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.zip" *
- if [ -n "${{ inputs.module_directory }}" ]; then
- cd -
- mv ${{ inputs.module_directory }}/${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.zip .
- fi
+ echo "[INFO] - Generating the zip"
+ zip -rq "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.zip" *
+ if [ -n "${{ inputs.module_directory }}" ]; then
+ cd -
+ mv ${{ inputs.module_directory }}/${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.zip .
fi
- name: Cache
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
- path: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.${{ inputs.module_name == 'centreon-collect' && 'tar.gz' || 'zip' }}"
+ path: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.zip"
key: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary"
policy-scan:
@@ -187,9 +125,9 @@ jobs:
delete-on-promote: false
- name: Get build binary
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
+ uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
- path: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.${{ inputs.module_name == 'centreon-collect' && 'tar.gz' || 'zip' }}"
+ path: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.zip"
key: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary"
- name: Sandbox scan
@@ -198,7 +136,7 @@ jobs:
with:
appname: "${{ inputs.module_name }}"
version: "${{ inputs.major_version }}.${{ inputs.minor_version }}_runId-${{ github.run_id }}_attempt-${{ github.run_attempt }}"
- filepath: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.${{ inputs.module_name == 'centreon-collect' && 'tar.gz' || 'zip' }}"
+ filepath: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.zip"
vid: "vera01ei-${{ secrets.veracode_api_id }}"
vkey: "vera01es-${{ secrets.veracode_api_key }}"
createprofile: true
diff --git a/.version b/.version
index d67858dc94e..6f0fb6341c2 100644
--- a/.version
+++ b/.version
@@ -1,2 +1 @@
MAJOR=23.04
-MINOR=17
diff --git a/.version.centreon-collect b/.version.centreon-collect
new file mode 100644
index 00000000000..abff26ef8ac
--- /dev/null
+++ b/.version.centreon-collect
@@ -0,0 +1 @@
+MINOR=17
diff --git a/.version.centreon-gorgone b/.version.centreon-gorgone
new file mode 100644
index 00000000000..abff26ef8ac
--- /dev/null
+++ b/.version.centreon-gorgone
@@ -0,0 +1 @@
+MINOR=17
diff --git a/gorgone/.version b/gorgone/.version
deleted file mode 100644
index 40349058db2..00000000000
--- a/gorgone/.version
+++ /dev/null
@@ -1 +0,0 @@
-MINOR=16
diff --git a/gorgone/packaging/centreon-gorgone.spectemplate b/gorgone/packaging/centreon-gorgone.spectemplate
index 51778aaf5fe..618c12f58d0 100644
--- a/gorgone/packaging/centreon-gorgone.spectemplate
+++ b/gorgone/packaging/centreon-gorgone.spectemplate
@@ -1,7 +1,7 @@
%define selinuxdevel %{_datadir}/selinux/devel
Name: centreon-gorgone
-Version: 23.04.16
+Version: 23.04.17
Release: %{PACKAGE_RELEASE}%{?dist}
Summary: Perl daemon task handlers
Group: Applications/System
@@ -14,6 +14,7 @@ BuildRoot: %{_tmppath}/gorgone-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: perl-devel
Requires: bzip2
+Requires: initscripts
Requires: perl-Libssh-Session >= 0.8
Requires: perl-CryptX
Requires: perl-Mojolicious