Railflow command line utility

Back-end development
Client
Project type
Back-end development
Project year
2022
Project tech
Picocli CLI, Java, Spring Boot, JUnit, Unirest

The Railflow CLI takes a bunch of arguments and processes/parses JUnit schema files that contain unit test results from the CI system and sends those results to JIRA using its respective REST API.

- Command Line Interface.

- Parsing of JUnit, XML files.

- Works with the Jira API.

Features

Diagram

- Process JUnit files from the specified path.

- Send test suites, test cases, duration, failure message, and exceptions to the JIRA REST API.

- Exposes JIRA specifics for making API connection: Auth details [1], JIRA project ID/Key [2], custom field key for storing the defect/issue metadata

The application relies on the Jira REST API to make HTTP requests.

The Jira REST API enables you to interact with Jira programmatically. Use this API to build apps, script interactions with Jira, or develop any other type of integration.

Jira workflow

Send processed data via the Jira API

— For all failures in the JUnit file, First, check if there is an OPEN defect (using Jira entity property match).

If yes:

 - Print to console/log that “skipping defect creation since defect already exists”

 - Add a comment in JIRA ‘<testrail: defect still open>’

If no:

  - Query the same metadata on ‘CLOSED’ defects. If found, then this defect may be a ‘regression’ Create a new defect with the title [regression] …

  - If the CLOSED query returns nothing, then create a new ticket and add metadata using Jira-entity-properties API

  - For passes in the JUnit file

  - Check if any open defects (using Jira-entity-properties API) match on test metadata and if yes, close/resolve defects. The logic here is that if a test is now passing, then the defect can be closed/resolved.

  - If no match is found on the OPEN defect, don’t do anything in Jira.

Parse JUnit files

You will need:

  - The path to a local file of XML format that corresponds to JUnit tests.

  - If you wish to use your own Jira instance, go to the application.properties file located in the 'resources' folder of the main directory and change the properties:

  - jira.api.instance: URL to your Jira instance.

  - jira.api.token: token required to make API calls and update your Jira instance.

  - jira.api.email: email account corresponding to the owner of the specified Jira instance and token.

  - jira.api.target.project: Jira project key/ID to associate your defects/issues with.

NOTE: You also need to create an issue custom field with the value of the jira.api.custom-field-name property, which should be equal to railflow-metadata.

If these requirements are met, you can continue.

While the application is running, use the following command:

java -jar railflow-command-line-tool-0.0.1-SNAPSHOT.jar parse <path to your local file>

Remember to replace the path to your local file.

  - The next step would be to make sure that the application is creating, commenting on, updating, and fetching defects (Jira issues of type 'Bug') when necessary.

No items found.

Other projects

Demo video

Let's work together!

Software development has allowed me to materialize ideas with little resources. If you would like me to build something that will make me plan and simplify a complex system, I want to help you.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.