ReportPortal API Definitions

This repository contains gRPC protocol definitions and OpenAPI Specification for ReportPortal APIs and provides knowledge about its own services. You can use Protocol Buffers (Protobuf) descriptions or OpenAPI specifications to generate your client's libraries or take pre-generated.

Contents

Overview

ReportPortal APIs are deployed as the API Service (ext. link).

Main ReportPortal APIs use OpenAPI Specification (OAS) to describe their services.

Some ReportPortal APIs use Protobuf version 3 (proto3) as their Interface Definition Language (IDL) to define the API interface and the structure of the payload messages.

Currently, we're migrating from a Code-first to an API-first approach. That means that you can't find all specifications here. You can find other specifications in ReportPortal UI Settings. Little by little, we will provide the specifications here.

Repository Structure

tree . ├── api │ ├── openapi │ │ ├── models │ │ │ └── model.yaml │ │ └── api-references.yaml │ └── proto │ ├── buf.md │ ├── buf.yaml │ └── reportportal │ ├── common │ │ ├── v1 │ │ │ └── types.proto │ │ └── v2 │ └── reporting (domain) │ ├── v1 │ │ └── reporting.proto │ └── v2 ├── build ├── docs ├── src └── templates

How to work with Protobuf

Buf CLI

We use buf CLI to create consistent Protobuf APIs that preserve compatibility and comply with best practices.

To work with this repository, install buf.

Verify

The buf build command is used to verify that an input compiles.

bash buf build --exclude-source-info -o -#format=json | jq '.file[] | .package'

Lint API

Just use

bash buf lint

Detect breaking changes

bash buf breaking --against '.git#branch=main'

Generate code

Java

For generating Java code we use Protobuf Plugin for Gradle.

Perform for generate code:

shell ./gradlew generateProto

Other languages

For other programming languages we use buf.

Remote generating

Buf doesn't have a built-in compiler. We use remote plugins for generating code for the following languages:

Perform for generate code:

shell buf generate

Optional languages:

Perform for generate code:

shell buf generate --template templates/buf.gen.opt.yaml

Local generating

Before, you need to install protocol buffer compiler with standard plugins.

Config buf.gen.local.yaml for your needs or use default protoc command.

Perform for generate code:

shell buf generate --template templates/buf.gen.local.yaml

Third-party libraries

Google types

We use additional types provided by Google Type Library.

You can use them in your proto files like:

proto import "google/type/<type_name>.proto";

Additional types

Contribution