You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+79-13Lines changed: 79 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,30 @@
1
1
# Contributing to i-Code CNES plugin for SonarQube
2
2
First off, thanks for taking the time to contribute!
3
-
The following is a set of guidelines for contributing to i-Code CNES plugin for SonarQube, which are hosted in the [Lequal Organization](https://github.com/lequal) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
3
+
The following is a set of guidelines for contributing to i-Code CNES plugin for SonarQube, which are hosted in the [CATLab organization](https://github.com/cnescatlab) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
-[How Do I Submit A (Good) Enhancement Suggestion?](#how-do-i-submit-a-good-enhancement-suggestion)
14
+
-[Pull Requests](#pull-requests)
15
+
-[Git Commit Messages](#git-commit-messages)
16
+
-[Management of contributions](#management-of-contributions)
12
17
13
18
## Code of Conduct
14
-
This project and everyone participating in it is governed by the [Lequal Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
19
+
This project and everyone participating in it is governed by the [CATLab Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to us or [GitHub](https://github.com/contact/report-content).
15
20
16
21
## How Can I Contribute?
17
22
18
23
### Reporting Bugs
19
-
Before creating bug reports, please check if the problem has already been reported.
24
+
Before creating bug reports, please check if the problem has already been reported.
20
25
21
26
#### How Do I Submit A (Good) Bug Report?
22
-
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/).
27
+
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/).
23
28
Provide information by filling [the template](.github/ISSUE_TEMPLATE/bug_report.md).
24
29
25
30
Explain the problem and include additional details to help maintainers reproduce the problem:
@@ -32,7 +37,7 @@ Explain the problem and include additional details to help maintainers reproduce
32
37
33
38
Provide more context by answering these questions:
34
39
***Did the problem start happening recently** (e.g. after updating to a new version of the plugin or SonarQube) or was this always a problem?
35
-
* If the problem started happening recently, **can you reproduce the problem in an older version?** What's the most recent version in which the problem doesn't happen? You can download older versions from [the releases page](https://github.com/lequal/sonar-icode-cnes-plugin/releases).
40
+
* If the problem started happening recently, **can you reproduce the problem in an older version?** What's the most recent version in which the problem doesn't happen? You can download older versions from [the releases page](https://github.com/cnescatlab/sonar-icode-cnes-plugin/releases).
36
41
***Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
37
42
38
43
Include details about your configuration and environment:
@@ -72,8 +77,69 @@ Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com
72
77
73
78
All contributions are welcome. They are made via a *pull request* on the branch `dev` which is the branch of the next version.
74
79
75
-
* pull request with **major** changes must be approved by at least one maintainer of each team and the LEQUAL.
80
+
* pull request with **major** changes must be approved by at least one maintainer of each team and the CATLab.
76
81
77
82
* pull requests with **minor** changes must be approved by at least one organization's member.
78
-
83
+
79
84
All maintainers have the ability to merge *pull requests* on the `dev` branch. If several maintainers belong to the same team, their validation only counts for one organization.
85
+
86
+
# Development
87
+
## How to build
88
+
89
+
This plugin is mainly developped in Java* and build with maven**. It's main dependencies are [fr.cnes.icode.icode-library](https://github.com/cnescatlab/i-CodeCNES) and libraries for [SonarQube](https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/plugin-basics/)
90
+
91
+
> \* Depending the version, the JDK version is written in the [pom.xml](pom.xml) ans the SonarQube compatibility is in the matrix: [matrix](README.md#run-i-code-automatically)
92
+
>
93
+
> \*\* the build for the release version are validated in maven 3.9.9
94
+
95
+
96
+
The icode-library is available on github repository. You'll have to configured your maven settings.xml with a new repository like this:
For all other dependencies, maven [central](https://central.sonatype.com/) is enough.
108
+
109
+
After that, you only have to launch the build command:
110
+
111
+
```bash
112
+
mvn package
113
+
```
114
+
115
+
The jar will be in the **target** folder.
116
+
117
+
## How to launch integration test
118
+
119
+
An integration test is written to validate the plugin in a SonarQube dockerized instance and with a Fortran scan.
120
+
121
+
**[Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/) is needed for this integration test
122
+
123
+
There is 2 scripts to make the test:
124
+
- The [it.sh](it/it.sh) to launch a SonarQube docker instance and install the local sonar-icode-cnes-plugin-<MAVEN_VERSION>.jar in this instance.
125
+
- the [audit.sh](it/audit.sh) to make a sonar-scanner launch a Fortran 77 and Fortran 90 code in the [src](it/src/) folder. This script check f77 and f90 issues a shown by SonarQube using the API.
126
+
127
+
128
+
The it script can use parameters:
129
+
```bash
130
+
$> ./it.sh -h
131
+
132
+
Usage: ./it.sh [sSh]
133
+
134
+
-h : Display help
135
+
-s [SONAR-SCANNER] : Take Sonar-scanner tag image from https://hub.docker.com/r/sonarsource/sonar-scanner-cli. Default is the latest tag
136
+
-S [SONARQUBE] : Take SonarQube tag image from https://hub.docker.com/_/sonarqube. Default is the community tag
137
+
```
138
+
139
+
Example of launching :
140
+
```bash
141
+
cd it
142
+
./it.sh -s 11.4.0.2044_7.2.0 -S lts-community
143
+
```
144
+
145
+
> Be careful to choose version depending the [compatibility matrix](README.md#run-i-code-automatically)
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ Please report issues at https://github.com/leqcnescatlabual/i-CodeCNES/issues
81
81
````
82
82
83
83
### How to contribute
84
-
If you experienced a problem with the plugin please open an issue. Inside this issue please explain us how to reproduce this issue and paste the log.
84
+
If you experienced a problem with the plugin please open an issue. Inside this issue please explain us how to reproduce this issue and paste the log.
85
85
86
86
If you want to do a PR, please put inside of it the reason of this pull request. If this pull request fix an issue please insert the number of the issue or explain inside of the PR how to reproduce this issue.
r = requests.get('http://sonarqube:9000/api/issues/search?componentKeys=$SONAR_PROJECT_KEY:src/clanhb.f&statuses=OPEN', auth=('$SONAR_ADMIN_LOGIN', '$SONAR_ADMIN_PWD'))
61
+
if r.status_code != 200:
62
+
print('Invalid server response: ' + str(r.status_code), file=sys.stderr)
63
+
sys.exit(1)
64
+
65
+
data = r.json()
66
+
67
+
if data['total'] != 100:
68
+
print('Wrong total number of issues: ' + str(data['total']), file=sys.stderr)
69
+
sys.exit(1)
70
+
71
+
issues = 0
72
+
if 'f77-rules' in data['issues'][0]['rule'] and data['issues'][0]['line'] == 1:
73
+
issues += 1
74
+
75
+
r = requests.get('http://sonarqube:9000/api/issues/search?componentKeys=$SONAR_PROJECT_KEY:src/clanhb.f90&statuses=OPEN', auth=('$SONAR_ADMIN_LOGIN', '$SONAR_ADMIN_PWD'))
76
+
if r.status_code != 200:
77
+
print('Invalid server response: ' + str(r.status_code), file=sys.stderr)
78
+
sys.exit(1)
79
+
80
+
data = r.json()
81
+
82
+
if data['total'] != 197:
83
+
print('Wrong total number of issues: ' + str(data['total']), file=sys.stderr)
84
+
sys.exit(1)
85
+
if 'f90-rules' in data['issues'][0]['rule'] and data['issues'][0]['line'] == 1:
0 commit comments