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: CI/CD and basic infrastructure for the IntelliJ Plugin #1

Merged
merged 65 commits into from
May 9, 2024

Conversation

kmruiz
Copy link
Contributor

@kmruiz kmruiz commented May 7, 2024

You'll see this PR is pretty big, as it adds the necessary infrastructure to build the plugin. There are three main blocks in this PR:

The build.gradle.kts files and the TOML dependency catalogue.

These are sections Project Structure and Gradle Plugins in the TD.

The CI/CD pipeline.

The structure is taken from VSCode but it's adapted to Gradle. It runs on GHA. We also adapted the changelog generation to use the JetBrains plugin for that, as it's their recommended approach.

Also, we added an example fitness function with JMH to do performance benchmarks before releasing.

Observability

All files under packages/jetbrains-plugin/src/main/kotlin are related to observability. The plugin now shows a small popup when activated (activates by default right now) and sends a telemetry event to Segment if possible.

@kmruiz kmruiz self-assigned this May 7, 2024
Copy link

github-actions bot commented May 7, 2024

Coverage Report

Overall Project 92.5% -6.89%
Files changed 92.42%

File Coverage
BuildInformation.kt 100%
RuntimeInformationService.kt 100%
TelemetryService.kt 100%
LogMessage.kt 100%
PluginActivatedProbe.kt 100%
TelemetryEvent.kt 98.72% -1.28%
SayHiListener.kt 0% -91.49% 🚫

@github-actions github-actions bot added the no release notes It's a chore and doesn't require release notes. label May 8, 2024
@kmruiz kmruiz marked this pull request as ready for review May 8, 2024 15:57
build.gradle.kts Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main build file. It would be like the package.json + webpack.config file for Java and Kotlin. Here we are defining the project dependencies and other subprojects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the Gradle configuration file itself. It configures Gradle and how it runs, not the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting configuration. It will be used by spotless to run the linting checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the dependency catalogue. All dependencies will be declared here and used in the specific build.gradle.kts of the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a subproject Gradle build definition. In this case for the intellij plugin, so it adds all the specific repositories (of dependencies, like npmjs but for Java/Kotlin), plugins (helpers and additional functionality for Gradle) and dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a sample JMH benchmark. It will run the code in the function init a lots of times and generate statistics, like how many runs per second it could do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an example startup activity. It runs once when a project is opened in IntelliJ. IntelliJ knows that this should be run because it's defined in the plugin.xml.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the plugin definition. We will add application listeners (classes that listen to other plugin events) and extensions (like the SayHiListener) here.

Copy link
Contributor Author

@kmruiz kmruiz May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file defines the settings for the project at the Gradle level. It allows to define subprojects, dependencies between projects and repositories for plugins.

@kmruiz kmruiz requested a review from mcasimir May 8, 2024 16:06
@kmruiz kmruiz merged commit ade2cf5 into main May 9, 2024
9 checks passed
@kmruiz kmruiz deleted the intellij-2 branch May 9, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no release notes It's a chore and doesn't require release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants