Unverified Commit e8673cba authored by Colin Gagnaire's avatar Colin Gagnaire Committed by GitHub
Browse files

Merge branch 'master' into 6039-trap-services-with-multiple-hosts

parents 466d10b8 86b35478
{
"exclude": [],
"presets": [
[
"@babel/preset-react"
],
[
"@babel/preset-env",
{
"targets": {
"esmodules": false
}
}
],
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-arrow-functions",
"@babel/plugin-transform-destructuring",
"@babel/plugin-transform-function-name",
"@babel/plugin-transform-parameters",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-classes",
"@babel/plugin-transform-shorthand-properties",
"@babel/plugin-transform-regenerator"
]
}
engines:
duplication:
enabled: true
config:
languages:
- javascript
- php
phpcodesniffer:
enabled: true
config:
file_extensions: "php"
ignore_warnings: true
standard: "PSR2"
checks:
PSR2 Classes ClassDeclaration MissingNamespace:
enabled: false
ratings:
paths:
- "**.php"
exclude_paths:
- GPL_LIB/**/*
- features/**/*
- doc/**/*
- tmpl/**/*
- log/**/*
- config/**/*
- logrotate/**/*
- snmptrapd/**/*
- varinstall/**/*
- www/lib/HTML/**/*
- www/install/**/*
APP_ENV=prod
APP_SECRET=%APP_SECRET%
<?php
// This file was generated by running "composer dump-env prod"
return array (
'APP_ENV' => 'prod',
'APP_SECRET' => '%APP_SECRET%',
);
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
ecmaFeatures:
modules: true
jsx: true
env:
amd: true
browser: true
es6: true
jquery: true
node: true
# http://eslint.org/docs/rules/
rules:
# Possible Errors
comma-dangle: [2, never]
no-cond-assign: 2
no-console: 0
no-constant-condition: 2
no-control-regex: 2
no-debugger: 2
no-dupe-args: 2
no-dupe-keys: 2
no-duplicate-case: 2
no-empty: 2
no-empty-character-class: 2
no-ex-assign: 2
no-extra-boolean-cast: 2
no-extra-parens: 0
no-extra-semi: 2
no-func-assign: 2
no-inner-declarations: [2, functions]
no-invalid-regexp: 2
no-irregular-whitespace: 2
no-negated-in-lhs: 2
no-obj-calls: 2
no-regex-spaces: 2
no-sparse-arrays: 2
no-unexpected-multiline: 2
no-unreachable: 2
use-isnan: 2
valid-jsdoc: 0
valid-typeof: 2
# Best Practices
accessor-pairs: 2
block-scoped-var: 0
complexity: [2, 6]
consistent-return: 0
curly: 0
default-case: 0
dot-location: 0
dot-notation: 0
eqeqeq: 2
guard-for-in: 2
no-alert: 2
no-caller: 2
no-case-declarations: 2
no-div-regex: 2
no-else-return: 0
no-empty-label: 2
no-empty-pattern: 2
no-eq-null: 2
no-eval: 2
no-extend-native: 2
no-extra-bind: 2
no-fallthrough: 2
no-floating-decimal: 0
no-implicit-coercion: 0
no-implied-eval: 2
no-invalid-this: 0
no-iterator: 2
no-labels: 0
no-lone-blocks: 2
no-loop-func: 2
no-magic-number: 0
no-multi-spaces: 0
no-multi-str: 0
no-native-reassign: 2
no-new-func: 2
no-new-wrappers: 2
no-new: 2
no-octal-escape: 2
no-octal: 2
no-proto: 2
no-redeclare: 2
no-return-assign: 2
no-script-url: 2
no-self-compare: 2
no-sequences: 0
no-throw-literal: 0
no-unused-expressions: 2
no-useless-call: 2
no-useless-concat: 2
no-void: 2
no-warning-comments: 0
no-with: 2
radix: 2
vars-on-top: 0
wrap-iife: 2
yoda: 0
# Strict
strict: 0
# Variables
init-declarations: 0
no-catch-shadow: 2
no-delete-var: 2
no-label-var: 2
no-shadow-restricted-names: 2
no-shadow: 0
no-undef-init: 2
no-undef: 0
no-undefined: 0
no-unused-vars: 0
no-use-before-define: 0
# Node.js and CommonJS
callback-return: 2
global-require: 2
handle-callback-err: 2
no-mixed-requires: 0
no-new-require: 0
no-path-concat: 2
no-process-exit: 2
no-restricted-modules: 0
no-sync: 0
# Stylistic Issues
array-bracket-spacing: 0
block-spacing: 0
brace-style: 0
camelcase: 0
comma-spacing: 0
comma-style: 0
computed-property-spacing: 0
consistent-this: 0
eol-last: 0
func-names: 0
func-style: 0
id-length: 0
id-match: 0
indent: 0
jsx-quotes: 0
key-spacing: 0
linebreak-style: 0
lines-around-comment: 0
max-depth: 0
max-len: 0
max-nested-callbacks: 0
max-params: 0
max-statements: [2, 30]
new-cap: 0
new-parens: 0
newline-after-var: 0
no-array-constructor: 0
no-bitwise: 0
no-continue: 0
no-inline-comments: 0
no-lonely-if: 0
no-mixed-spaces-and-tabs: 0
no-multiple-empty-lines: 0
no-negated-condition: 0
no-nested-ternary: 0
no-new-object: 0
no-plusplus: 0
no-restricted-syntax: 0
no-spaced-func: 0
no-ternary: 0
no-trailing-spaces: 0
no-underscore-dangle: 0
no-unneeded-ternary: 0
object-curly-spacing: 0
one-var: 0
operator-assignment: 0
operator-linebreak: 0
padded-blocks: 0
quote-props: 0
quotes: 0
require-jsdoc: 0
semi-spacing: 0
semi: 0
sort-vars: 0
space-after-keywords: 0
space-before-blocks: 0
space-before-function-paren: 0
space-before-keywords: 0
space-in-parens: 0
space-infix-ops: 0
space-return-throw-case: 0
space-unary-ops: 0
spaced-comment: 0
wrap-regex: 0
# ECMAScript 6
arrow-body-style: 0
arrow-parens: 0
arrow-spacing: 0
constructor-super: 0
generator-star-spacing: 0
no-arrow-condition: 0
no-class-assign: 0
no-const-assign: 0
no-dupe-class-members: 0
no-this-before-super: 0
no-var: 0
object-shorthand: 0
prefer-arrow-callback: 0
prefer-const: 0
prefer-reflect: 0
prefer-spread: 0
prefer-template: 0
require-yield: 0
module.exports = {
extends: '@centreon/eslint-config-centreon/typescript'
}
\ No newline at end of file
/.github export-ignore
/doc export-ignore
/features export-ignore
/project export-ignore
/tests export-ignore
/.csslintrc export-ignore
/.eslintignore export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.prettierrc.js export-ignore
/.project export-ignore
/behat.yml export-ignore
/build.xml export-ignore
/centreon-github-wall.jpg export-ignore
/CHANGELOG export-ignore
/CODE_OF_CONDUCT.md export-ignore
/codingstyle.xml export-ignore
/CONTRIBUTING.md export-ignore
/Jenkinsfile export-ignore
/jest.config.js export-ignore
/phpunit.xml export-ignore
/sonar-project.properties export-ignore
\ No newline at end of file
......@@ -10,14 +10,14 @@ Be aware that your feature request might not be taken into account for future de
Please describe your feature request in English.
-->
<h3> Feature explanation </h3>
### Feature explanation
A short explanation of the wanted feature
<h3> What is the value of the wanted feature ?</h3>
### What is the value of the wanted feature ?
A short explanation of what could be the value of the wanted feature.
<h3> Additional information </h3>
### Additional information
Dedicated section to add any information to make your case(*screenshots*, ...)
......@@ -20,9 +20,11 @@ in the next 30 days, the ticket will be automaticaly closed.
Please describe your issue in English.
-->
<h1>BUG REPORT INFORMATION </h1>
# BUG REPORT INFORMATION
<h3> Prerequisites </h3>
### Prerequisites
> The opened issue, must be code related. GitHub is not meant for support. Feel free to check the CONTRIBUTING section for more details.
***Versions***
......@@ -43,13 +45,22 @@ $ dpkg -l | grep centreon
*CentOS, Debian ...*
***Browser used***
- [ ] Google Chrome
- [ ] Firefox
- [ ] Internet Explorer IE11
- [ ] Safari
Version: --
***Additional environment details (AWS, VirtualBox, physical, etc.):***
<h3> Description </h3>
### Description
-- Describe the encountered issue --
<h3> Steps to Reproduce </h3>
### Steps to Reproduce
Please describe precisely the steps to reproduce the encountered issue.
......@@ -57,8 +68,31 @@ Please describe precisely the steps to reproduce the encountered issue.
2. I reached the Custom View
3. And so on...
<h3> Describe the received result </h3>
### Describe the received result
### Describe the expected result
### Logs
**PHP error logs**
```
tail -f /var/opt/rh/rh-php71/log/php-fpm/centreon-error.log
```
**centreon-engine logs (*if needed*)**
```
tail -f /var/log/centreon-engine/centengine.log
```
**centreon-broker logs (*if needed*)**
<h3> Describe the expected result </h3>
```
tail -f /var/log/centreon-broker/central-broker-master.log
```
**centcore logs (*if needed*)**
```
tail -f /var/log/centreon/centcore.log
```
<h3> Additional relevant information (e.g. frequency, ...) </h3>
### Additional relevant information (e.g. frequency, ...)
<h1> Pull Request Template </h1>
# Pull Request Template
<h2> Description </h2>
## Description
Please include a short resume of the changes and what is the purpose of PR. Any relevant information should be added to help:
* **QA Team** (Quality Assurance) with tests.
* **reviewers** to understand what are the stakes of the pull request.
Fixes # (issue)
**Fixes** # (issue)
<h2> Type of change </h2>
## Type of change
- [ ] Patch fixing an issue (non-breaking change)
- [ ] New functionality (non-breaking change)
- [ ] Breaking change (patch or feature) that might cause side effects breaking part of the Software
- [ ] Updating documentation (missing information, typo...)
<h2> Target serie </h2>
## Target serie
- [ ] 2.8.x
- [ ] 18.10.x
- [ ] 19.04.x (master)
- [ ] 19.04.x
- [ ] 19.10.x
- [ ] 20.04.x (master)
<h2> How this pull request can be tested ? </h2>
......@@ -27,18 +29,18 @@ Please describe the **procedure** to verify that the goal of the PR is matched.
Any **relevant details** of the configuration to perform the test should be added.
<h2> Checklist </h2>
## Checklist
<h5> Community contributors & Centreon team </h5>
#### Community contributors & Centreon team
- [ ] I followed the **coding style guidelines** provided by Centreon
- [ ] I have commented my code, especially new **classes**, **functions** or any **legacy code** modified. (***docblock***)
- [ ] I have commented my code, especially **hard-to-understand areas** of the PR.
- [ ] I have made corresponding changes to the **documentation**.
- [ ] I have **rebased** my development branch on the base branch (master, maintenance).
- [ ] I have **rebased** my development branch on the base branch (master, maintenance).
<h5> Centreon team only </h5>
#### Centreon team only
- [ ] I have made sure that the **unit tests** related to the story are successful.
- [ ] I have made sure that **unit tests covers 80%** of the code written for the story.
- [ ] I have made sure that **acceptance tests** related to the story are successful (**local and CI**)
- [ ] I have made sure that **unit tests cover 80%** of the code written for the story.
- [ ] I have made sure that **acceptance tests** related to the story are successful (**local and CI**)
......@@ -20,8 +20,6 @@ www/include/core/menu/templates/*.tpl
!www/img/media/.keep
www/img/media/*
www/template
!filesGeneration/export/.keep
filesGeneration/export/*
#temporary files needed for the installation
www/install/tmp/*
......@@ -36,3 +34,13 @@ config/centreon.config.php
coverage-report/
centreon-build/
secret
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/public/bundles/
/var/
###< symfony/framework-bundle ###
/bin/.phpunit/
/doc/en/_build/
module.exports = {
trailingComma: 'es5',
arrowParens: 'always',
singleQuote: true,
}
This diff is collapsed.
<h1> Contributing to Centreon project </h1>
# Contributing to Centreon project
:clap: First thing first... Thank you for taking the time to contribute to Centreon project ! :clap: Much appreciated ! :metal:
This article contains guidelines for contributing to [Centreon](https://github.com/centreon/) project.
<h3>Table of contents </h3>
### Table of contents
[I have a question](#i-have-a-question-)
[How can I contribute?](#-how-can-i-contribute-)
* [Where should I report ?](#-where-shoud-i-report-)
* [I have an issue to report](#-i-have-an-issue-to-report-)
* [I have a suggestion of enhancement](#-i-have-a-suggestion-of-enhancement-)
* [I have a pull request to submit](#-i-have-a-pull-request-to-submit-)
- [Where should I report ?](#-where-shoud-i-report-)
- [I have an issue to report](#-i-have-an-issue-to-report-)
- [I have a suggestion of enhancement](#-i-have-a-suggestion-of-enhancement-)
- [I have a pull request to submit](#-i-have-a-pull-request-to-submit-)
[Centreon style guides](#-centreon-style-guides-)
* [Formating commit messages](#-formating-commit-messages-)
* [Coding style](#-coding-style-)
- [Formating commit messages](#-formating-commit-messages-)
- [Coding style](#-coding-style-)
<h2> Code of Conduct </h2>
## Code of Conduct
Any people that wants to contribute and participate in developping the project must respect [Centreon Code of Conduct](CODE_OF_CONDUCT.md). Please report any unacceptable behavior to [community@centreon.com](mailto:community@centreon.com).
<h2> I have a question </h2>
## I have a question
> **Advise**: Opening an issue on the project to ask a question is not recommended. Please refer to the following available ressources, you'll get an answer from a Centreon team or community member.
> **Advise**: Centreon GitHub is meant for opening issues (code related), feature requests and so on. It is not **meant** for **support**. Please refer to the following available ressources, you'll get an answer from a Centreon team or community member.
* [Official Centreon Slack](https://centreon.github.io/register-slack)
<h2> How can I contribute </h2>
- [Official Centreon Slack](https://centreon.github.io/register-slack)
## How can I contribute
Centreon community can contribute in **many ways** to the project.
<h3> Where shoud I report ? </h3>
### Where shoud I report ?
Issues and feature requests should be done on the **appropriate repositories**. Here are the repositories maintened by Centreon:
......@@ -59,17 +60,17 @@ Issues and feature requests should be done on the **appropriate repositories**.
| [centreon-widget-engine-status](https://github.com/centreon/centreon-widget-engine-status)
<h3> I have an issue to report </h3>
### I have an issue to report
Before reporting an issue please make sure that it has not been already reported by checking [Centreon Bug Tracker](https://github.com/centreon/centreon/issues)
If your issue has **not** been reported yet, then the issue should be opened using the following template [ISSUE_TEMPLATE.md](.github/ISSUE_TEMPLATE.md)
<h3> I have a suggestion of enhancement </h3>
### I have a suggestion of enhancement
Any ideas, enhancements, feature requests are more than welcome. Feature requests should be opened by using the following template [FEATURE_REQUEST.md](.github/FEATURE_REQUEST.md)
<h3> I have a pull request to submit </h3>
### I have a pull request to submit
You have been working on Centreon base code and want to submit it to us. Well... Again you are more than welcome and thank you in advance ! :clap:
......@@ -77,9 +78,9 @@ The pull request should respect the some requirements that can found in the foll
> **Notice**: Any pull request that does not respect those requirements will be legitimately rejected !
<h3> Centreon style guides </h3>
### Centreon style guides
<h4> Formating commit messages </h4>
#### Formating commit messages
The commit format should follow this commit template message
```
......@@ -100,18 +101,18 @@ Applied to the sample ticket
Refs: #5567 (GitHub) or MON-2234 (Jira)
```
The ***type*** can refer to
* **feat**: adding a feature
* **fix**: adding a patch
* **enh**: adding an enhancement
* **docs**: adding documentation changes
* **style**: fixing coding style issues
* **refactor**: code refactoring
* **test**: adding new tests or fixing old ones
* **chore** : updating project construction files (Jenkins files, CMakefile, gulp, webpack ...)
- **feat**: adding a feature
- **fix**: adding a patch
- **enh**: adding an enhancement
- **docs**: adding documentation changes
- **style**: fixing coding style issues
- **refactor**: code refactoring
- **test**: adding new tests or fixing old ones
- **chore** : updating project construction files (Jenkins files, CMakefile, gulp, webpack ...)
The ***scope*** is defined by project. Scopes for Centreon Open Source project can be found [here](scopes/centreon.md).
<h4> Coding style </h4>
#### Coding style
Centreon software is made of several languages. For each language a specific coding style **must be respected**.
......@@ -123,6 +124,11 @@ For other languages, coding style rules are defined in Centreon GitHub repositor
* [HTML](https://github.com/centreon/centreon/tree/master/doc/coding-style/html)
* [JavaScript](https://github.com/centreon/centreon/tree/master/doc/coding-style/js)
#### Documentation
If you want to visualize and suggest modification to the documentation through a pull request
you can check the **HOW TO** build the documentation section [here](doc/README.md)
......
/*
** Variables.
*/
def serie = '19.04'
properties([buildDiscarder(logRotator(numToKeepStr: '50'))])
def serie = '20.04'
def maintenanceBranch = "${serie}.x"
if (env.BRANCH_NAME.startsWith('release-')) {
env.BUILD = 'RELEASE'
......@@ -33,7 +34,7 @@ stage('Source') {
reportName: 'Centreon Build Artifacts',
reportTitles: ''
])
featureFiles = sh(script: 'ls -1 centreon-web/features | grep .feature', returnStdout: true).split()
featureFiles = sh(script: 'find centreon-web/features -type f -name "*.feature" -printf "%P\n" | sort', returnStdout: true).split()
}
}
......@@ -51,6 +52,25 @@ try {
cloverReportDir: '.',
cloverReportFileName: 'coverage.xml'
])
if (env.CHANGE_ID) { // pull request to comment with coding style issues