This repository has been archived by the owner on Jan 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Upgrade json simple & fix big overview comment issue #118
Open
kingoleg
wants to merge
9
commits into
AmadeusITGroup:coverage_split_sensor
Choose a base branch
from
kingoleg:upgrade-json-simple
base: coverage_split_sensor
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
506802b
Code style
b3f9f2a
Do not add sonar issues already fixed in other PR to the list of issue
e3aa9ab
Add a coverage comment to summary if evolution is negative
9054024
Merge remote-tracking branch 'upstream/master'
2a74ff2
Use workingDir instead of projectBaseDir to support multi-module proj…
95777b0
Merge branch 'master' into coverage_split_sensor
8596c66
Add logging
bba85d4
Limit overview comment length
b6ad7d6
Upgrade json-simple
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 12 additions & 6 deletions
18
src/main/java/org/sonar/plugins/stash/StashProjectBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
package org.sonar.plugins.stash; | ||
|
||
import org.sonar.api.batch.bootstrap.ProjectBuilder; | ||
|
||
import java.io.File; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.sonar.api.batch.bootstrap.ProjectBuilder; | ||
|
||
public class StashProjectBuilder extends ProjectBuilder { | ||
private File projectBaseDir; | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(StashProjectBuilder.class); | ||
|
||
private File workingDir; | ||
|
||
@Override | ||
public void build(Context context) { | ||
projectBaseDir = context.projectReactor().getRoot().getBaseDir(); | ||
workingDir = new File(System.getProperty("user.dir")); | ||
LOGGER.debug("Current working directory {}", workingDir); | ||
} | ||
|
||
public File getProjectBaseDir() { | ||
return projectBaseDir; | ||
public File getWorkingDir() { | ||
return workingDir; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this parameter.
If we keep it it should be named
requestBody
.OTOH it seems weird to pass the body only for logging.
How about removing the exception from
validateResponse()
, making it return a bool instead and throwing the exception/logging from performRequest directly