Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.

Commit d261b5a

Browse files
Merge pull request #40 from stack-spot/bugfix/release-0.1.4
Release 0.1.4
2 parents a65fd07 + 6a485fe commit d261b5a

File tree

8 files changed

+207
-19
lines changed

8 files changed

+207
-19
lines changed

.github/workflows/deploy-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
7777
gh pr create \
7878
--title "Changelog update - \`$VERSION\`" \
79-
--body "current pull request contains patched \`changelog.md\` file for the \`$version\` version." \
79+
--body "Current pull request contains patched \`changelog.md\` file for the \`$VERSION\` version." \
8080
--base "${{ github.event.release.target_commitish }}" \
8181
--head $BRANCH \
8282
--label ignore-for-release

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,24 @@
22

33
## Releases
44

5+
## [v0.1.4] - 2022-09-21
6+
<!-- Release notes generated using configuration in .github/release.yaml at release-0.1.4 -->
57

8+
### Exciting New Features 🎉
9+
* Feature: Improve plugin description in marketplace page by @matheusferreirazup in https://github.com/stack-spot/stackspot-intellij-extension/pull/19
10+
* Feature: changed the documentation url inside the readme by @adroaldonetozup in https://github.com/stack-spot/stackspot-intellij-extension/pull/22
11+
* Feature: Created workflow to generate release notes and publish plugin by @adroaldonetozup in https://github.com/stack-spot/stackspot-intellij-extension/pull/23
12+
* Feature: Add Sonarqube and first unit tests by @matheusferreirazup in https://github.com/stack-spot/stackspot-intellij-extension/pull/33
13+
### Bug Fixes 🛠
14+
* Bug fix: Project wizard always stuck in "no stackfiles panel" by @matheusferreirazup in https://github.com/stack-spot/stackspot-intellij-extension/pull/17
15+
* Bug fix: Stack url dialog by @adroaldonetozup in https://github.com/stack-spot/stackspot-intellij-extension/pull/18
16+
* Bug fix: added validation if stack file exists inside stack by @adroaldonetozup in https://github.com/stack-spot/stackspot-intellij-extension/pull/20
17+
* Bug Fix: Changed workflows for each event type and corrected the workflow for plugin publishing by @adroaldonetozup in https://github.com/stack-spot/stackspot-intellij-extension/pull/26
18+
* Bug Fix: Changed workflows for plugin publishing by @adroaldonetozup in https://github.com/stack-spot/stackspot-intellij-extension/pull/27
19+
* Bug Fix: Moved changelog jobs into deploy prod workflow by @adroaldonetozup in https://github.com/stack-spot/stackspot-intellij-extension/pull/28
20+
* Bug Fix: Changed changelog extension in build gradle and disable buildSearchableOptions by @adroaldonetozup in https://github.com/stack-spot/stackspot-intellij-extension/pull/29
21+
* Bug Fix: Added project version property in update changelog command by @adroaldonetozup in https://github.com/stack-spot/stackspot-intellij-extension/pull/30
22+
### Other Changes
23+
* Refactor: Change reusable workflows to use the main branch instead of release branch by @matheusferreirazup in https://github.com/stack-spot/stackspot-intellij-extension/pull/24
24+
25+
Full Changelog: https://github.com/stack-spot/stackspot-intellij-extension/compare/v0.0.3...v0.1.4

build.gradle.kts

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,62 @@
11
import org.jetbrains.changelog.date
22

3+
fun properties(key: String) = project.findProperty(key).toString()
4+
35
plugins {
46
id("java")
7+
id("jacoco")
58
id("org.jetbrains.kotlin.jvm") version "1.7.10"
69
id("org.jetbrains.intellij") version "1.8.0"
10+
id("org.sonarqube") version "3.4.0.2513"
711

812
// Gradle Changelog Plugin
913
id("org.jetbrains.changelog") version "1.3.1"
1014
}
1115

12-
group = "com.stackspot"
13-
version = System.getProperty("project_version")
16+
val projectVersion: String? = System.getProperty("project_version")
17+
18+
group = properties("pluginGroup")
19+
version = if (projectVersion.isNullOrEmpty()) {
20+
properties("pluginVersion")
21+
} else {
22+
projectVersion
23+
}
1424

1525
repositories {
1626
mavenCentral()
1727
}
1828

29+
dependencies {
30+
testImplementation(platform("org.junit:junit-bom:5.9.0"))
31+
testImplementation("org.junit.jupiter:junit-jupiter")
32+
}
33+
34+
kotlin {
35+
jvmToolchain {
36+
languageVersion.set(JavaLanguageVersion.of(11))
37+
}
38+
}
39+
1940
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
2041
intellij {
21-
version.set("2022.1")
22-
type.set("IC") // Target IDE Platform
42+
pluginName.set(properties("pluginName"))
43+
version.set(properties("platformVersion"))
44+
type.set(properties("platformType")) // Target IDE Platform
2345

2446
plugins.set(
25-
listOf(
26-
"org.jetbrains.plugins.terminal",
27-
"com.intellij.gradle",
28-
"org.jetbrains.idea.maven",
29-
)
47+
properties("platformPlugins")
48+
.split(',')
49+
.map(String::trim)
50+
.filter(String::isNotEmpty)
3051
)
3152
}
3253

54+
sonarqube {
55+
properties {
56+
property("sonar.projectName", "ide-intellij-plugin")
57+
}
58+
}
59+
3360
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
3461
changelog {
3562
val regex =
@@ -50,13 +77,22 @@ tasks {
5077
sourceCompatibility = "11"
5178
targetCompatibility = "11"
5279
}
80+
5381
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
5482
kotlinOptions.jvmTarget = "11"
5583
}
5684

85+
buildSearchableOptions {
86+
enabled = false
87+
}
88+
89+
wrapper {
90+
gradleVersion = properties("gradleVersion")
91+
}
92+
5793
patchPluginXml {
58-
sinceBuild.set("221")
59-
untilBuild.set("222.*")
94+
sinceBuild.set(properties("pluginSinceBuild"))
95+
untilBuild.set(properties("pluginUntilBuild"))
6096
}
6197

6298
buildSearchableOptions {
@@ -67,4 +103,19 @@ tasks {
67103
token.set(System.getenv("PUBLISH_TOKEN"))
68104
channels.set(listOf(System.getenv("MARKETPLACE_CHANNEL")))
69105
}
106+
107+
test {
108+
useJUnitPlatform()
109+
testLogging {
110+
events("passed", "skipped", "failed")
111+
}
112+
finalizedBy(jacocoTestReport)
113+
}
114+
115+
jacocoTestReport {
116+
dependsOn(test)
117+
reports {
118+
xml.required.set(true)
119+
}
120+
}
70121
}

gradle.properties

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Copyright 2022 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
pluginGroup = com.stackspot
18+
pluginName = stackspot-intellij-plugin
19+
pluginVersion = test-0.0.1
20+
21+
pluginSinceBuild = 221
22+
pluginUntilBuild = 222.*
23+
24+
platformType = IC
25+
platformVersion = 2022.1
26+
platformPlugins = org.jetbrains.plugins.terminal, com.intellij.gradle, org.jetbrains.idea.maven
27+
28+
gradleVersion = 7.5.1
29+
30+
# Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
31+
# suppress inspection "UnusedProperty"
32+
kotlin.stdlib.default.dependency = false

src/main/kotlin/com/stackspot/intellij/services/CreateProjectService.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ class CreateProjectService {
5353
stackfile = null
5454
}
5555

56-
fun saveInfo(stack: Stack?, stackfile: Stackfile?) {
56+
fun saveInfo(stack: Stack?, stackfile: Stackfile?): CreateProjectService {
5757
this.stack = stack
5858
this.stackfile = stackfile
59+
return this
5960
}
6061

6162
fun addGitConfig(username: String, email: String) {

src/main/kotlin/com/stackspot/model/Stack.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import java.util.*
2626
data class Stack(
2727
val name: String,
2828
val description: String,
29-
val displayName: String?,
30-
@JsonProperty("display-name") val displayNameKebab: String?,
31-
val useCases: List<StackUseCase>?,
32-
@JsonProperty("use-cases") val useCasesKebab: List<StackUseCase>?
29+
val displayName: String? = null,
30+
@JsonProperty("display-name") val displayNameKebab: String? = null,
31+
val useCases: List<StackUseCase>? = null,
32+
@JsonProperty("use-cases") val useCasesKebab: List<StackUseCase>? = null
3333
) {
3434
lateinit var location: File
3535

src/main/kotlin/com/stackspot/model/Stackfile.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ data class Stackfile(
2020
val type: String,
2121
val description: String,
2222
val template: String,
23-
val inputs: Map<String, Any>?,
24-
val plugins: List<StackfilePlugin>?
23+
val inputs: Map<String, Any>? = null,
24+
val plugins: List<StackfilePlugin>? = null
2525
) {
2626
lateinit var name: String
2727
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* Copyright 2022 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.stackspot.services
18+
19+
import com.stackspot.intellij.services.CreateProjectService
20+
import com.stackspot.model.Stack
21+
import com.stackspot.model.Stackfile
22+
import org.junit.jupiter.api.Assertions
23+
import org.junit.jupiter.params.ParameterizedTest
24+
import org.junit.jupiter.params.provider.Arguments
25+
import org.junit.jupiter.params.provider.MethodSource
26+
import java.util.stream.Stream
27+
28+
class CreateProjectServiceTest {
29+
30+
@ParameterizedTest
31+
@MethodSource("saveInfoArgs")
32+
fun `should saveInfo when args are nullable and when they don't`(stack: Stack?, stackfile: Stackfile?) {
33+
val service = CreateProjectService().saveInfo(stack, stackfile)
34+
Assertions.assertEquals(stack, service.stack)
35+
Assertions.assertEquals(stackfile, service.stackfile)
36+
}
37+
38+
@ParameterizedTest
39+
@MethodSource("stackfileIsSelectedArgs")
40+
fun `should check if stackfile is selected and when it don't`(
41+
stack: Stack?,
42+
stackfile: Stackfile?,
43+
expected: Boolean
44+
) {
45+
val service = CreateProjectService().saveInfo(stack, stackfile)
46+
Assertions.assertEquals(service.isStackfileSelected(), expected)
47+
}
48+
49+
private companion object {
50+
@JvmStatic
51+
fun stackfileIsSelectedArgs(): Stream<Arguments> =
52+
Stream.of(
53+
Arguments.of(
54+
null, null, false
55+
),
56+
Arguments.of(
57+
createStack(),
58+
createStackfile(),
59+
true
60+
)
61+
)
62+
63+
@JvmStatic
64+
fun saveInfoArgs(): Stream<Arguments> =
65+
Stream.of(
66+
Arguments.of(
67+
null, null
68+
),
69+
Arguments.of(
70+
createStack(),
71+
createStackfile()
72+
)
73+
)
74+
75+
private fun createStack(name: String = "stack-for-test", description: String = "stack test description") =
76+
Stack(name, description)
77+
78+
private fun createStackfile(
79+
type: String = "app",
80+
description: String = "stackfile test description",
81+
template: String = "test-tempalte"
82+
) = Stackfile(type, description, template)
83+
}
84+
}

0 commit comments

Comments
 (0)