Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MON-37152 Centreon next 23.04 (Jira release #19727#) #1177

Merged
merged 10 commits into from
Mar 6, 2024
18 changes: 14 additions & 4 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: "tag version"
description: "Tag package"
inputs:
jira_token:
jira_api_token:
description: "Token to authenticate to Jira"
required: true
jira_user_email:
description: "Email linked to token"
required: true
jira_project_id:
description: "Jira project id to create release"
required: true
jira_base_url:
description: "Jira base url"
required: true

runs:
using: "composite"
steps:
Expand Down Expand Up @@ -44,11 +54,11 @@ runs:
TYPE=Release
fi

VERSION_DATA="{\"archived\":false,\"releaseDate\":\"$(date +%Y-%m-%d)\",\"name\":\"centreon-collect-$NEW_VERSION\",\"description\":\"$TYPE:$RELEASE_ID\",\"projectId\":11789,\"released\":false}"
VERSION_DATA="{\"archived\":false,\"releaseDate\":\"$(date +%Y-%m-%d)\",\"name\":\"centreon-collect-$NEW_VERSION\",\"description\":\"$TYPE:$RELEASE_ID\",\"projectId\":${{ inputs.jira_project_id }},\"released\":false}"

curl --fail --request POST \
--url 'https://centreon.atlassian.net/rest/api/3/version' \
--header 'Authorization: Basic ${{ inputs.jira_token }}' \
--url '${{ inputs.jira_base_url }}/rest/api/3/version' \
--user '${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data ''$VERSION_DATA''
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updates:
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
interval: monthly
open-pull-requests-limit: 10
labels:
- 'dependencies'
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
- "[2-9][0-9].[0-9][0-9].x"
paths:
- "centreon-collect/**"
- "!centreon-collect/ci/**"
- "!centreon-collect/tests/**"
workflow_dispatch:

env:
Expand All @@ -29,4 +31,7 @@ jobs:
id: release
uses: ./.github/actions/release
with:
jira_token: ${{ secrets.JIRA_TOKEN }}
jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
jira_project_id: ${{ secrets.JIRA_PROJECT_ID }}
jira_base_url: ${{ secrets.JIRA_BASE_URL }}
23 changes: 14 additions & 9 deletions .github/workflows/veracode-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ jobs:
- name: Set routing mode
id: routing-mode
run: |
CHECK_BRANCH=`echo "${{ github.ref_name }}" | cut -d'/' -f2`
if [[ $CHECK_BRANCH != "merge" && '${{ github.event_name }}' != 'pull_request' ]]; then
DEVELOPMENT_STAGE="Release"
else
DEVELOPMENT_STAGE="Development"
fi
DEVELOPMENT_STAGE="Development"

ALLOWED_BRANCHES=(develop master dev-${{ inputs.major_version }}.x ${{ inputs.major_version }}.x)
for BRANCH in "${ALLOWED_BRANCHES[@]}"; do
if [[ "${{ github.ref_name }}" == "$BRANCH" ]] && [[ '${{ github.event_name }}' != 'pull_request' ]]; then
DEVELOPMENT_STAGE="Release"
fi
done

echo "development_stage=$DEVELOPMENT_STAGE" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT

Expand Down Expand Up @@ -134,21 +137,23 @@ jobs:
path: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.tar.gz"
key: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary"

sandbox-scan:
policy-scan:
name: Sandbox scan
needs: [build]
needs: [routing, build]
if: needs.routing.outputs.development_stage != 'Development'
runs-on: ubuntu-latest

steps:
- name: Promote latest scan
# only develop will be promoted to policy scan
if: github.ref_name == 'develop'
env:
VERACODE_API_ID: "${{ secrets.veracode_api_id }}"
VERACODE_API_SECRET: "${{ secrets.veracode_api_key }}"

# Action forked as API calls hardcoded '.com' route
uses: sc979/veracode-sandboxes-helper@cf67241c27cbe6405ad8705111121ece9a48c4ff # v0.2
# Promote should not fail if sandbox was not found.
# Promote should not fail to trigger following sandbox scan.
continue-on-error: true
with:
activity: "promote-latest-scan"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ broker/libroker.a
broker/librokerbase.a
broker/test/python/*.crt
broker/test/python/*.key
broker/compile_commands.json
broker/grpc/grpc_stream.proto
broker/grpc/src/grpc_bridge.cc

# clib
clib/inc/com/centreon/clib/version.hh
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ endif()
# Version.
set(COLLECT_MAJOR 23)
set(COLLECT_MINOR 04)
set(COLLECT_PATCH 8)
set(COLLECT_PATCH 9)
set(COLLECT_VERSION "${COLLECT_MAJOR}.${COLLECT_MINOR}.${COLLECT_PATCH}")
add_definitions(-DCENTREON_CONNECTOR_VERSION=\"${COLLECT_VERSION}\")

Expand Down
23 changes: 12 additions & 11 deletions bbdo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@
#

set(protobuf_files
header
rebuild_message
remove_graph_message
severity
tag
bbdo
neb
storage
bam)
header
rebuild_message
remove_graph_message
severity
tag
bbdo
neb
storage
bam
bam_state)

foreach(name IN LISTS protobuf_files)
set(proto_file "${name}.proto")
Expand Down Expand Up @@ -69,8 +70,8 @@ add_library(pb_tag_lib STATIC tag.pb.cc tag.pb.h)
add_dependencies(pb_tag_lib target_neb)
set_target_properties(pb_tag_lib PROPERTIES POSITION_INDEPENDENT_CODE ON)

add_library(pb_bam_lib STATIC bam.pb.cc bam.pb.h)
add_dependencies(pb_bam_lib target_bam target_header)
add_library(pb_bam_lib STATIC bam.pb.cc bam.pb.h bam_state.pb.cc bam_state.pb.h)
add_dependencies(pb_bam_lib target_bam target_bam_state target_header)
set_target_properties(pb_bam_lib PROPERTIES POSITION_INDEPENDENT_CODE ON)

macro(get_protobuf_files name)
Expand Down
Loading
Loading