Skip to content

Rename codeclimate.json to gl-code-quality-report.json #2

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

Merged
merged 1 commit into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ sonarqube_feature_job:
- mvn --batch-mode verify sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.branch.name=$CI_COMMIT_REF_NAME
```

For get code quality (`codeclimate.json`) in merge request (only GitLab EE https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html)
For get code quality (`gl-code-quality-report.json`) in merge request (only GitLab EE https://docs.gitlab.com/ee/user/project/merge_requests/code_quality_diff.html)

> Warning, master must have a `codequality.json`, use `commit-status` for notification mode (not mandatory)

Expand All @@ -200,7 +200,7 @@ sonarqube_master_job:
artifacts:
expire_in: 1 day
paths:
- codeclimate.json
- gl-code-quality-report.json

sonarqube_feature_job:
stage: test
Expand All @@ -213,7 +213,7 @@ sonarqube_feature_job:
artifacts:
expire_in: 1 day
paths:
- codeclimate.json
- gl-code-quality-report.json

codequality:
stage: quality
Expand All @@ -223,7 +223,7 @@ codequality:
- echo ok
artifacts:
paths:
- codeclimate.json
- gl-code-quality-report.json
```

For get SAST (`gl-sast-report.json`) information in merge request (only GitLab EE https://docs.gitlab.com/ee/user/project/merge_requests/sast.html)
Expand Down Expand Up @@ -313,7 +313,7 @@ https://docs.gitlab.com/ce/ci/variables/#9-0-renaming
| sonar.gitlab.prefix_directory | Add prefix when create link for GitLab | Variable | >= 2.1.0 |
| sonar.gitlab.api_version | GitLab API version (default `v4`) | Administration, Variable | >= 2.1.0 |
| sonar.gitlab.all_issues | All issues new and old (default false, only new) | Administration, Variable | >= 2.1.0 |
| sonar.gitlab.json_mode | Create a json report in root for GitLab EE (codeclimate.json or gl-sast-report.json) | Project, Variable | >= 3.0.0 |
| sonar.gitlab.json_mode | Create a json report in root for GitLab EE (gl-code-quality-report.json or gl-sast-report.json) | Project, Variable | >= 3.0.0 |
| sonar.gitlab.query_max_retry | Max retry for wait finish analyse for publish mode | Administration, Variable | >= 3.0.0 |
| sonar.gitlab.query_wait | Max retry for wait finish analyse for publish mode | Administration, Variable | >= 3.0.0 |
| sonar.gitlab.quality_gate_fail_mode | Quality gate fail mode: error, warn or none (default error) | Administration, Variable | >= 3.0.0 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class CommitFacade {

private static final Logger LOG = Loggers.get(CommitFacade.class);

private static final String CODECLIMATE_JSON_NAME = "codeclimate.json";
private static final String CODECLIMATE_JSON_NAME = "gl-code-quality-report.json";
private static final String SAST_JSON_NAME = "gl-sast-report.json";

private final GitLabPluginConfiguration gitLabPluginConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void testWriteCodeClimateJson() throws IOException {

facade.writeJsonFile("[{\"tool\":\"sonarqube\",\"fingerprint\":\"null\",\"message\":\"Issue\",\"file\":\"file\",\"line\":\"0\",\"priority\":\"INFO\",\"solution\":\"http://myserver\"}]");

File file = new File(projectBaseDir, "codeclimate.json");
File file = new File(projectBaseDir, "gl-code-quality-report.json");
Assertions.assertThat(file).exists().hasContent("[{\"tool\":\"sonarqube\",\"fingerprint\":\"null\",\"message\":\"Issue\",\"file\":\"file\",\"line\":\"0\",\"priority\":\"INFO\",\"solution\":\"http://myserver\"}]");
}

Expand Down Expand Up @@ -114,7 +114,7 @@ public void testWriteNoneJson() throws IOException {

facade.writeJsonFile("[{\"tool\":\"sonarqube\",\"fingerprint\":\"null\",\"message\":\"Issue\",\"file\":\"file\",\"line\":\"0\",\"priority\":\"INFO\",\"solution\":\"http://myserver\"}]");

File file = new File(projectBaseDir, "codeclimate.json");
File file = new File(projectBaseDir, "gl-code-quality-report.json");
Assertions.assertThat(projectBaseDir.listFiles((p) -> p.getPath().endsWith(".json"))).isEmpty();
}

Expand Down