Release Script Helper — IntelliJ Plugin
IntelliJ Platform plugin for generating SQL release scripts with ticket numbers, descriptions, and configurable naming conventions.
Commands
Gradle commands should be executed through the IntelliJ MCP execute_terminal_command tool for IDE integration (progress tracking, output in IDE terminal).
./gradlew buildPlugin # Build the plugin ZIP
./gradlew check # Run tests + Kover coverage
./gradlew verifyPlugin # Verify plugin against IntelliJ IDE versions
./gradlew qodana # Run Qodana code inspection
./gradlew getChangelog # Get changelog entries
./gradlew properties # Print project properties
./gradlew clean # Clean build artifacts
./gradlew build # Full build
./gradlew test # Run tests
./gradlew patchChangelog # Patch changelog for next version
Run/Debug configurations are in .run/ — discover them via MCP get_run_configurations tool.
Architecture
src/main/
├── kotlin/.../model/ # Data models (Kotlin)
│ ├── ReleaseScript.kt # Core model — builds file names & content
│ └── Options.kt # Configurable options (ticket types, file endings)
├── kotlin/.../ui/
│ └── BasicAddDialog.kt # Swing dialog for script parameters
├── java/.../action/ # IntelliJ AnAction implementations (Java)
│ ├── BasicAddScript.java # Abstract base — shared flow for both actions
│ ├── ProjectExplorerAddScript.java # "New → Release Script" action
│ └── GenerationMenuAddScript.java # "Generate → Generate Release Script" action
├── java/.../settings/ # Plugin settings persistence (Java)
│ ├── ProjectLevelState.java # Persistent state (XML-serialized via XmlSerializerUtil)
│ ├── ProjectLevelConfigurable.java # Settings UI page
│ └── ProjectLevelComponent.java # Settings panel widgets
└── java/.../util/
└── FileUtil.java # VirtualFile ↔ relative path conversion
Control flow (script creation)
- User triggers action →
actionPerformed()runs BasicAddScript.promptValuesForReleaseScript()creates aReleaseScriptmodel, presets ticket info from VCS branch name, then showsBasicAddDialog- If dialog confirms,
ApplicationManager.getApplication().runWriteAction()creates the file via PSI, writes binary content, and opens it
Key gotchas
- Mixed Kotlin/Java: Models are Kotlin, actions/settings are Java. Both compile against JVM 21.
- VCS branch presetting (
BasicAddScript.presetFromVcsBranch): Parses branch name likeOCT-1234-featureto auto-fill ticket type and number. Only the first repo's current branch is used. - Dialog Swing state sync (
updateUiComponentsByHandBecauseSwingIsStupid): When the user opens Settings from the dialog and saves, the combo boxes must be manually repopulated —bindItemdoesn't auto-react to model changes. ReleaseScript.ticketNumbersetter: Side-effect — setting the ticket number also updatesticketTypeby matching against configured ticket type prefixes.ReleaseScript.optionssetter: Side-effect — setting options also initializesticketTypeandfileEndingfrom the first element of each list.- Settings persistence:
ProjectLevelStateuses@State/@Storageannotations — config is saved per-project inReleaseScriptHelperPlugin.xml. isModified()inProjectLevelConfigurable(line 39):isUseUnixTimestamp() == settings.getOptions().getUseCustomScriptNumber()— note the inverted comparison (unix timestamp selected ↔ custom script number NOT selected).
Conventions
- Package:
com.github.brandtjo.releasescripthelper - Kotlin files: models and UI dialogs
- Java files: actions, settings, utilities
- IntelliJ Platform APIs used:
com.intellij.openapi.*,git4idea.* - External deps: Apache Commons Lang3, Commons Collections, SLF4J
- detekt config at
detekt-config.ymlfor Kotlin linting - Qodana config at
qodana.yamlfor CI inspections
CI/CD
.github/workflows/build.yml— build, test, Qodana, plugin verification, draft release.github/workflows/release.yml— publishes when a GitHub release is published.github/workflows/run-ui-tests.yml— UI tests via Robot Server- Plugin signs artifacts via
CERTIFICATE_CHAIN/PRIVATE_KEYenv vars