Skip to content

Commit

Permalink
Merge branch 'master' into navigate-to-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla authored Dec 4, 2023
2 parents 80d8ec2 + 5ae411e commit 896c4bb
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 25 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

# Setup Java 17 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand All @@ -69,19 +69,18 @@ jobs:
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=version::$VERSION"
echo "::set-output name=name::$NAME"
echo "::set-output name=changelog::$CHANGELOG"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
# Run tests
- name: Run Tests
run: ./gradlew test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

# Setup Java 17 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

# Setup Java 17 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

## [Unreleased]

## [1.15.2]

### 🐛 Bug Fixes

- Fix run in EDT thread #106

## [1.15.1]

### Maintenance
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pluginGroup=com.dsoftware.ghmanager
pluginName=github-actions-manager

# SemVer format -> https://semver.org
pluginVersion=1.15.0
pluginVersion=1.15.2

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=232
Expand All @@ -20,7 +20,7 @@ platformPlugins=org.jetbrains.plugins.github
javaVersion=17

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion=8.4
gradleVersion=8.5

# Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
# suppress inspection "UnusedProperty"
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ annotations = "24.1.0"
# plugins
kotlin = "1.9.21"
changelog = "2.2.0"
gradleIntelliJPlugin = "1.16.0"
gradleIntelliJPlugin = "1.16.1"
qodana = "0.1.13"
kover = "0.7.4"
kover = "0.7.5"
dokka = "1.8.10"
serialization = "1.6.0"

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
30 changes: 27 additions & 3 deletions src/main/kotlin/com/dsoftware/ghmanager/Constants.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
package com.dsoftware.ghmanager

import com.intellij.ide.BrowserUtil
import com.intellij.ui.SimpleTextAttributes
import com.intellij.util.ui.StatusText

object Constants {
const val LOG_MSG_PICK_JOB = "Pick a job to view logs"
const val LOG_MSG_MISSING = "Job logs missing for: "
const val LOG_MSG_JOB_IN_PROGRESS = "Job is still in progress, can't view logs"
const val LOG_MSG_JOB_IN_PROGRESS = "Job is still in progress, can't view logs."

fun emptyTextMessage(logValue: String): Boolean {
return (logValue.startsWith(LOG_MSG_MISSING)
|| logValue.startsWith(LOG_MSG_PICK_JOB)
|| logValue.startsWith(LOG_MSG_JOB_IN_PROGRESS)
)
|| logValue.startsWith(
LOG_MSG_JOB_IN_PROGRESS
))
}

fun updateEmptyText(logValue: String, emptyText: StatusText): Boolean {
if (logValue.startsWith(LOG_MSG_MISSING)
|| logValue.startsWith(LOG_MSG_PICK_JOB)
) {
emptyText.text = logValue
return true
}
if (logValue.startsWith(LOG_MSG_JOB_IN_PROGRESS)) {
emptyText.text = "Job is still in progress, can't view logs."
emptyText.appendSecondaryText(
"Please upvote this issue on GitHub so they will prioritize it.",
SimpleTextAttributes.LINK_PLAIN_ATTRIBUTES
) {
BrowserUtil.browse("https://github.com/orgs/community/discussions/75518")
}
return true
}
return false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.runInEdt
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.actions.ToggleUseSoftWrapsToolbarAction
import com.intellij.openapi.editor.colors.EditorColorsListener
Expand Down Expand Up @@ -87,9 +88,7 @@ fun createLogConsolePanel(
if (logValue.isNullOrBlank()) {
return
}
if (Constants.emptyTextMessage(logValue)) {
panel.emptyText.text = logValue
} else {
if (!Constants.updateEmptyText(logValue, panel.emptyText)) {
panel.removeAll()
val console = LogConsolePanel(project, logValue, parentDisposable)
panel.add(console.component, BorderLayout.CENTER)
Expand All @@ -110,11 +109,11 @@ fun createLogConsolePanel(
}
}
model.logModel.addAndInvokeListener {
addConsole(it)
runInEdt { addConsole(it) }
}
ApplicationManager.getApplication().messageBus.connect(parentDisposable)
.subscribe(EditorColorsManager.TOPIC, EditorColorsListener {
addConsole(model.logModel.value)
runInEdt { addConsole(model.logModel.value) }
})
return panel
}

0 comments on commit 896c4bb

Please sign in to comment.