Skip to content

New branch #10

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

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3b72c45
add quality issues to code branch
Jan 30, 2020
7971770
add branch name to pipeline mvn cmd
Jan 30, 2020
c920aec
master branch condition in JenkinsFile
Jan 30, 2020
88dfc06
report JenkinsFile fix done on master
Jan 31, 2020
b35b56e
fixed locked unitary tests
Feb 4, 2020
ebdcd17
try to dump JenkinsFile env
Feb 4, 2020
30eba7d
try to dump JenkinsFile env 2
Feb 4, 2020
25a0ec1
try to dump JenkinsFile env 3
Feb 4, 2020
ee8d1c4
try to build PR analysis
Feb 4, 2020
23c82b2
try to build PR analysis 2
Feb 4, 2020
104e426
try to build PR analysis 3
Feb 4, 2020
07c680b
try to build PR analysis 4
Feb 4, 2020
465abcd
try to build PR analysis 5
Feb 4, 2020
b923272
try to build PR analysis 6
Feb 4, 2020
dc1d6f1
Revert "try to build PR analysis 6"
Feb 4, 2020
906dd5e
Merge branch 'master' into branch_with_issues
sylvain-combe-sonarsource Feb 4, 2020
f4e1219
Add fetch of master for sonar scanner comparison
sylvain-combe-sonarsource Feb 28, 2020
1df2a08
change docker image
sylvain-combe-sonarsource Feb 28, 2020
35a8e79
Fix JenkinsFile conflict
Feb 28, 2020
ea7bdd4
Align Jenkinsfile on master branch one
sylvain-combe-sonarsource Apr 22, 2020
1c73901
Back to branch and PT analysis parameters
sylvain-combe-sonarsource Apr 22, 2020
e920809
Fix git branch and PR code analyzed
sylvain-combe-sonarsource Apr 22, 2020
b6eb4cf
need git commands again in docker container
sylvain-combe-sonarsource Apr 22, 2020
3093490
do I need a git command at all
sylvain-combe-sonarsource Apr 22, 2020
57aab0f
align project keys
Apr 22, 2020
a252228
resolve conflict on pom.xml
Apr 22, 2020
432b746
add quality gate status check
Apr 22, 2020
7c4de5d
new attempt with no analysis parameter
Apr 22, 2020
03b6fcf
add cache for plugins
Apr 22, 2020
544d798
use volume mount for caches
Apr 22, 2020
abed2e3
mandatory parameters back
Apr 22, 2020
e1e37c1
user home tweaks
Apr 22, 2020
c9a4c10
fix args
Apr 22, 2020
2f5f359
HOME not existing
Apr 22, 2020
b6576cd
root be it
Apr 22, 2020
78752e5
root be it 2
Apr 22, 2020
f6f69d7
remove git url not found anymore in SCM step
Apr 23, 2020
a9e0793
Add some useless code
Feb 8, 2021
6d27fb8
Merge branch 'master' into newBranch
sylvain-combe-sonarsource Mar 18, 2021
4168408
Create azure-pipelines-1.yml
sylvain-combe-sonarsource Mar 25, 2021
087757a
Add PR triggers
sylvain-combe-sonarsource Mar 25, 2021
feb9395
Update README.md
sylvain-combe-sonarsource Nov 4, 2022
4ba69bc
Create main.yml
sylvain-combe-sonarsource Nov 4, 2022
2e230b2
Update main.yml
sylvain-combe-sonarsource Nov 4, 2022
7b14944
Update main.yml
sylvain-combe-sonarsource Nov 4, 2022
d7a2fd0
Update main.yml
sylvain-combe-sonarsource Nov 4, 2022
7b10e5b
Update main.yml
sylvain-combe-sonarsource Nov 4, 2022
f64beb7
Merge branch 'master' into newBranch
sylvain-combe-sonarsource Nov 4, 2022
e4a9509
Update App.java
sylvain-combe-sonarsource Nov 4, 2022
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
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Build
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- 'master'
- 'releases/**'
jobs:
build:
name: Build
Expand All @@ -31,6 +32,6 @@ jobs:
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
SONAR_HOST_URL: ${{ secrets.SONAR_SQ_URL }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -X
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ The `jenkins` directory contains an example of the `Jenkinsfile` (i.e. Pipeline)
you'll be creating yourself during the tutorial and the `scripts` subdirectory
contains a shell script with commands that are executed when Jenkins processes
the "Deliver" stage of your Pipeline.

test update
4 changes: 4 additions & 0 deletions azure-pipelines-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

trigger:
- master
- new*
pr:
- master
- releases/*

pool:
vmImage: ubuntu-latest
Expand Down
16 changes: 16 additions & 0 deletions my-app.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
</component>
</module>
2 changes: 0 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,5 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<sonar.projectKey>sylvain-combe-sonarsource_simple-java-maven-app</sonar.projectKey>
<sonar.organization>sylvain-combe-sonarsource</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
</project>
33 changes: 29 additions & 4 deletions src/main/java/com/mycompany/app/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,43 @@ public class App
{

private final String message = "Hello World!";
public String msg1;
public String msg2;

public App() {}

public App() {
msg1 = "one";
msg2="two";
}

public static void main(String[] args) {
System.out.println(new App().getMessage());
App myApp = new App();
try {
System.out.println(myApp.getMessage());
} catch (InterruptedException e) {
e.printStackTrace();
}
}

private final String getMessage(boolean isSync) throws InterruptedException {
synchronized (this.msg1) {
// threadB can't enter this block to request this.mon2 lock & release threadA
synchronized (this.msg2) {
this.msg2.wait(); // Noncompliant; threadA is stuck here holding lock on this.mon1
}
}
return message;
}

private final String getMessage() {
private final String getMessage() throws InterruptedException {
return message;
}

private class S2259FalsePositive {
private final String doNothing() throws InterruptedException {
return null;
}

private static class S2259FalsePositive {
private enum Valid {
OK, NOT_OK;
}
Expand Down