Skip to content
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

chore: LS bump protocol version to 11 [IDE-236] #506

Merged
merged 8 commits into from
Apr 9, 2024
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
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2

test:
name: Test
Expand All @@ -25,16 +25,16 @@ jobs:

steps:
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
name: Setup Java
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Setup Gradle Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Snyk
uses: snyk/actions/[email protected]
Expand All @@ -73,18 +73,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

# PluginVerifier has been compiled by a more recent version of the Java - Java 11.
# That's why, we are using not version 8 here, but 11.
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
name: Setup Java
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Setup Gradle Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
name: Setup Java
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Setup Gradle Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
name: Setup Java
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Setup Gradle Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
## [2.7.14]
### Added
- force download of compatible CLI on mismatched LS protocol versions
- bumped LS protocol version to ensure built-in LS in CLI has necessary commands for global ignores

## [2.7.13]
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import ai.deepcode.javaclient.responses.CreateBundleResponse;
import ai.deepcode.javaclient.responses.GetAnalysisResponse;
import ai.deepcode.javaclient.responses.GetFiltersResponse;
import com.intellij.openapi.diagnostic.Logger;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -42,6 +43,7 @@
public class DeepCodeRestApiImpl implements DeepCodeRestApi {

public static final String API_URL = "https://deeproxy.snyk.io/";
public static final @NotNull Logger LOGGER = Logger.getInstance(DeepCodeRestApiImpl.class);

private static Retrofit retrofit = buildRetrofit(API_URL, false, false);

Expand Down Expand Up @@ -79,9 +81,7 @@ private static Retrofit buildRetrofit(
SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
builder.sslSocketFactory(sslSocketFactory, x509TrustManager);
} catch (NoSuchAlgorithmException | KeyManagementException e) {
// TODO(pavel): extract Retrofit and OkHttpClient into configuration object to simplify API
// client building.
e.printStackTrace();
LOGGER.warn("Failed to disable SSL verification. Check your JDK", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import java.util.UUID
)
class SnykApplicationSettingsStateService : PersistentStateComponent<SnykApplicationSettingsStateService> {

var currentLSProtocolVersion: Int? = 0
val requiredLsProtocolVersion = 10
val requiredLsProtocolVersion = 11

var currentLSProtocolVersion: Int? = 0
var isGlobalIgnoresFeatureEnabled = false
var cliBaseDownloadURL: String = "https://static.snyk.io"
var cliPath: String = getPluginPath() + separator + Platform.current().snykWrapperFileName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class CliDownloaderTest {
CliDownloader.LATEST_RELEASES_URL
)
}

@Test
fun `should not delete file if checksum verification fails`() {
val testFile = Files.createTempFile("test", "test").toFile()
Expand Down
Loading