IntelliJ IDEs and CircleCI integration by 🌀CIclone!
Tags: circleci, ciclone, jetbrains
Published: 2022-08-09 14:59:23

Samuraism Inc. has announced a new product: a plugin for JetBrains IDEs named **CIclone** [sάɪkloʊn]

https://samuraism.com/products/ciclone (Ja)

## 🌀CIclone?

🌀CIclone provides seamless integration of JetBrains IDEs with several CI services such as Jenkins, GitHub Actions, and CircleCI. It is a paid plugin, but the price is reasonable. In addition, it's available at no additional cost if we have a personal license with them. (and I have it :D)

I checked the CircleCI integration of the plugin because I like CircleCI and I'm working for CircleCI as an engineer (๑•̀ㅂ•́)و✧

The plugin seems super nice!

## Execution result notification

When we push code changes, CircleCI starts the pipeline. Then, 🌀CIclone tells us the result by the IDE notification. We don't need to switch to other applications, but we can keep coding on the IDE after the push and can know the execution result. nice

![Execution result notification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6cco3muowlw2ypm6st5p.png)

## Workflow execution results view

Even after we receive notifications, we can still stay on the IDE and check the execution status (success/failed), the job list, and even the execution logs there. nice

![Workflow execution results view](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mc8fcm2cve5phq4tmden.png)

## Jump to the failed tests

If there are some tests failed, we can jump to the test cases on the source code. nice

![Jump to the failed tests](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pwa6qs4a0uobw0bcugno.png)

In addition, we can run unit tests on the IDE from there. nice

## Jump to CircleCI page

It's also possible to jump to CircleCI page from the IDE. We just select the workflows or jobs on the view and click the following button, then the CircleCI site is open on the browser. nice

![Jump to CircleCI page1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8inz7bsm04xfoehobzeh.png)

For example, we can see the page like this:

![Jump to CircleCI page2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdsdl39wpjzxh39thwzo.png)

## Trigger pipeline

We can trigger pipeline by clicking the execution button and specifying branch. nice

![Trigger pipeline](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r624z9kc9buux6sb9qtd.png)

## Rerun workflow

Selecting the executed workflow, we can rerun the workflow from the rerun button. nice

![Rerun workflow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjwfyjgro63fzgs4u69s.png)

## It seems super nice!

With 🌀CIclone, now I can get CircleCI notifications in the IDE, check logs, re-run, etc., without switching apps while writing code, which seems very convenient!

I don't have any Java projects right now, but I might try it with a Clojure or JavaScript project. If the language is not yet supported by 🌀CIclone, I don't think it is possible to jump to the code or execute UT, but still it is possible to see the CI results and receive notifications. I have a feeling that would be so useful!

Below are notes on setting up this project

## Create a sample project: hello-ciclone

I created a Maven project with Spring Initializr. It's been a while since I've used Java!

* https://github.com/bufferings/hello-ciclone

Then I wrote a simple `config.yml`

```yaml
version: 2.1

jobs:
  build-and-test:
    docker:
      - image: cimg/openjdk:17.0.3
    steps:
      - checkout
      - run:
          name: Build
          command: mvn -B -DskipTests clean package
      - run:
          name: Test
          command: mvn test

workflows:
  sample:
    jobs:
      - build-and-test
```

Clicked "Set Up Project" on the CircleCI project list:

![Set Up Project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/chl4na4q51b0kg7jpu8s.png)

select the config.yml in the main branch:

![select the config.yml](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pfop992to1y2xoobphz9.png)

After that, it automatically executes UT when I push code

* https://app.circleci.com/pipelines/github/bufferings/hello-ciclone

I added a few tests, and some of them succeed and some others fail.

The project preparation is done.

## IDEA configuration

Next is a configuration on IDEA. I got license from Samuraism at first, then activated it. But I think we can try it without license for the 30 days trial period.

Install plugin. Preferences > Plugins > Marketplace and type "ciclone" to find the plugin and install it.

![Install plugin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4x96nc0mqpzmvq0yvpn.png)

After rebooting IDEA, next was to set up CircleCI integration, Preferences > Tools > CircleCI

![CircleCI integration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qiz0vawhumqifz1cdqm4.png)

I wanted to get a new token from CircleCI, so I clicked the "Get Token" link to open CircleCI page for token generation:

![Get Token](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9a5oxzvkf4gyk4toil2.png)

And "Create New Token" to generate a new token with some name and copied the value. Then pasted it to the config page of IDEA, and click "Import from existing project". I could see the list of my CircleCI projects:

![list of my CircleCI projects](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rikyi4lx1yc4uey96ib6.png)

Chose the project I created just now and it became like this. The "Max Pipeline Size" seems the history count of the pipeline to retrieve. The default is five and I think it's good for me for now.

![CircleCI integration2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/we0a9sqixwixt98asa1x.png)

Clicked "Test"

![Test](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzf6k3mwrs4r1fxrguat.png)

It works!ヽ(=´▽`=)ﾉ

## 🌀CIclone View

When we finish the configuration, we can see CircleCI tab at the bottom, so choosing it and click the sync button on the left top of the view to get the latest pipeline results:

![CIclone View](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f3baonu0nl716tgs6zhp.png)

Now we can use it as I wrote in the first half of this article!