Skip to content

Commit

Permalink
chore: upgrade intellij plugin to remediate compatibility issues (#444)
Browse files Browse the repository at this point in the history
* chore: update IntelliJ compatibility and Icons

chore: icons updated

chore: update workflows

chore: fix async test

chore: fix tests (wip)

chore: fix tests (wip)

chore: fix tests (wip)

chore: update icons

chore: wip

chore: upgrade & make the new config compilable

* chore: make linter happy

* fix: workflows

* fix: blocking kubernetes file scan
  • Loading branch information
bastiandoetsch authored Aug 31, 2023
1 parent b853a0c commit 0de998b
Show file tree
Hide file tree
Showing 139 changed files with 772 additions and 673 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
Expand All @@ -25,12 +25,13 @@ jobs:

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

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

- name: Setup Gradle Cache
uses: actions/cache@v2
Expand Down Expand Up @@ -76,10 +77,11 @@ jobs:

# 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.
- name: Setup Java
uses: actions/setup-java@v1
- uses: actions/setup-java@v3
name: Setup Java
with:
java-version: 11
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Setup Gradle Cache
uses: actions/cache@v2
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v2
uses: actions/checkout@v3

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

- name: Setup Gradle Cache
uses: actions/cache@v2
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Setup Gradle Cache
uses: actions/cache@v2
Expand All @@ -44,7 +45,7 @@ jobs:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
SNYK_ORG_NAME: ${{ secrets.SNYK_ORG_NAME }}
run: |
./gradlew test integTest verifyPlugin clean
./gradlew test verifyPlugin clean
git clean -d --force
git reset --hard
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Snyk Changelog

## [2.5.0]

### Changed

- Fix compatibility issues; only support Jetbrains 2023.x for plugin versions > 2.5.0

## [2.4.63]

### Fixed
Expand Down
68 changes: 28 additions & 40 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

// reads properties from gradle.properties file
fun properties(key: String) = project.findProperty(key).toString()

plugins {
id("org.jetbrains.changelog") version "1.2.1"
id("org.jetbrains.intellij") version "1.1.2"
id("org.jetbrains.kotlin.jvm") version "1.8.0"
id("io.gitlab.arturbosch.detekt") version ("1.21.0")
id("org.jetbrains.changelog") version "2.1.2"
id("org.jetbrains.intellij") version "1.15.0"
id("org.jetbrains.kotlin.jvm") version "1.9.0"
id("io.gitlab.arturbosch.detekt") version ("1.23.1")
id("pl.allegro.tech.build.axion-release") version "1.13.6"
}

Expand All @@ -20,34 +21,43 @@ version = scmVersion.version
group = properties("pluginGroup")
description = properties("pluginName")

val jdk = "1.8"
val jdk = "17"

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
implementation("org.commonmark:commonmark:0.19.0")
implementation("com.google.code.gson:gson:2.9.0")
implementation("com.segment.analytics.java:analytics:3.3.1")
implementation("io.sentry:sentry:6.4.2")
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.10.0"))
implementation("org.commonmark:commonmark:0.21.0")
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.segment.analytics.java:analytics:3.4.0")
implementation("io.sentry:sentry:6.27.0")
implementation("javax.xml.bind:jaxb-api:2.3.1") // necessary because since JDK 9 not included
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.okhttp3:okhttp")
implementation("com.squareup.okhttp3:logging-interceptor")
implementation("ly.iterative.itly:plugin-iteratively:1.2.11")
implementation("ly.iterative.itly:plugin-schema-validator:1.2.11") {
exclude(group = "org.slf4j")
}
implementation("ly.iterative.itly:sdk-jvm:1.2.11")
testImplementation("com.google.jimfs:jimfs:1.2")
testImplementation("com.squareup.okhttp3:mockwebserver:4.10.0")
implementation("ly.iterative.itly:sdk-jvm:1.2.11") {
exclude(group = "org.slf4j")
}
implementation("com.segment.analytics.java:analytics:3.4.0")

testImplementation("com.google.jimfs:jimfs:1.3.0")
testImplementation("com.squareup.okhttp3:mockwebserver")

testImplementation("junit:junit:4.13.2") {
exclude(group = "org.hamcrest")
}
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("io.mockk:mockk:1.12.2") // updating this breaks tests
testImplementation("io.mockk:mockk:1.13.5")
testImplementation("org.awaitility:awaitility:4.2.0")
runtimeOnly("org.jetbrains.kotlin:kotlin-reflect:1.4.32")

detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.1")
}

// configuration for gradle-intellij-plugin plugin.
Expand All @@ -64,15 +74,15 @@ intellij {
// configure for detekt plugin.
// read more: https://detekt.github.io/detekt/kotlindsl.html
detekt {
config = files("$projectDir/.github/detekt/detekt-config.yml")
config.setFrom("$projectDir/.github/detekt/detekt-config.yml")
baseline = file("$projectDir/.github/detekt/detekt-baseline.xml")
buildUponDefaultConfig = true
}

tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = jdk
kotlinOptions.languageVersion = "1.3"
kotlinOptions.languageVersion = "1.9"
}

withType<JavaCompile> {
Expand Down Expand Up @@ -136,7 +146,7 @@ tasks {
}.joinToString("\n").run { markdownToHTML(this) }
)

changeNotes.set(provider { changelog.getLatest().toHTML() })
changeNotes.set(provider { changelog.renderItem(changelog.getLatest(), Changelog.OutputType.HTML) })
}

publishPlugin {
Expand All @@ -160,27 +170,5 @@ tasks {
org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel.INVALID_PLUGIN
)
)
verificationReportsDir.set("$rootDir.path/reports/pluginVerifier")
}
}

sourceSets {
create("integTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
}
val integTestImplementation: Configuration by configurations.getting {
extendsFrom(configurations.implementation.get(), configurations.testImplementation.get())
}
configurations["integTestRuntimeOnly"].extendsFrom(configurations.runtimeOnly.get())

val integTest = task<Test>("integTest") {
description = "Runs the integration tests."
group = "verification"

testClassesDirs = sourceSets["integTest"].output.classesDirs
classpath = sourceSets["integTest"].runtimeClasspath
shouldRunAfter("test")
}
tasks.check { dependsOn(integTest) }
12 changes: 4 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ pluginName=Snyk Security - Code, Open Source, Container, IaC Configurations

# for insight into build numbers and IntelliJ Platform versions
# see https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=202
pluginSinceBuild=231
pluginUntilBuild=232.*

platformVersion=2020.2
platformVersion=2023.1
platformDownloadSources=true

# plugin dependencies (comma-separated)
# example: platformPlugins = com.intellij.java, org.jetbrains.plugins.yaml
# see https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
platformPlugins=org.intellij.plugins.hcl:0.7.10,org.jetbrains.plugins.yaml,org.jetbrains.kotlin,com.intellij.java,org.intellij.groovy

platformPlugins=org.intellij.plugins.hcl:231.8109.91,org.jetbrains.plugins.yaml,org.jetbrains.kotlin,com.intellij.java,org.intellij.groovy
# list of versions for which to check the plugin for api compatibility
pluginVerifierIdeVersions=2020.3.1,2021.1.1,2021.3,2022.1

pluginVerifierIdeVersions=2023.1,2023.2
localIdeDirectory=

# opt-out flag for bundling Kotlin standard library
# see https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
kotlin.stdlib.default.dependency=false
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 0de998b

Please sign in to comment.