DRI Gem

The DRI (Directly Responsible Individual) gem is your CLI companion for managing GitLab's QA pipelines. Tailored for those in charge of pipeline quality assurance, it simplifies the triage and reporting of failing tests. Key features include:

  • Fetching failing test cases by pipeline
  • Reporting failures at the end of the timezone shift
  • Viewing today's newest and untriaged failures
  • Marking actions on failures

Installation

Install dri using the following command:

$ gem install dri

Execute dri to see all available options:

$ dri

Installing from source

After cloning this repository, build dri from source using the following command:

$ gem build dri.gemspec

A gemfile will be generated with the current version number, e.g. dri-0.11.0.gem. Install using the command:

$ gem install dri-0.11.0.gem

Getting Started

Configuration

Before diving into dri, ensure you have:

  • A Personal Access Token for authentication.
  • A triage emoji to mark triaged failures

Configure your profile with:

$ dri init

To view or edit your profile:

$ dri profile

Usage

$ dri help

dri supports a variety of commands to streamline your workflow:

  • init: Set up dri with necessary configurations.
  • profile: Display or edit your user profile.
  • fetch: Retrieve information on failures, test cases, triaged issues, feature flags, and more.
  • publish: Generate and publish reports.
  • rm: Remove emojis, profiles, or reports.
  • incidents: View active or mitigated incidents.
  • analyze: Analyze stack traces for common failures.
  • version: Check the installed version of dri.
  • faq: Access FAQs related to on-call operations.

Command Details

  • fetch: Use options like --start_date, --end_date, and --cutoff to customize your queries.
  • publish report: Customize reports with --format, --dry-run, --actions, and --feature-flags options.
  • rm: Manage your environment by cleaning up emojis, profiles, or locally stored reports.

Example Commands:

$ dri fetch failures

Fetches today's opened failures and lists them according to their triage status. Helpful to understand if there are missing recent failures to be reviewed.

Note: Smoke and Reliable failures will be highlighted in bold and in between *'s. These require to have set QA_INFLUXDB_URL and QA_INFLUXDB_TOKEN environment variables, to be found in 1Password.

$ dri fetch testcases

Fetches test cases that failing currently and groups them by pipeline. To filter the pipelines, pass the --filter-pipelines options to multi-select the pipelines you wish to consult. (Use Space to select an option)

$ dri fetch triaged

Fetches triaged failures.

$ dri fetch pipelines

Fetches a table containing last executed pipeline and its test report link for all monitored pipelines.

$ dri fetch runbooks [runbook]

Fetches a runbook from the runbooks project. If [runbook] is omitted, the command will prompt the user to select from a list of available runbooks.

$ dri publish report

Publishes a handover report on the latest weekly triage issue.

Options

$ dri publish report --format=list # formats the report in a list
$ dri publish report --format=table # formats the report in a table (default)
$ dri publish report --dry-run # the report is only generated locally
$ dri publish report --actions # activate the actions prompt for each failure
$ dri publish report --feature-flags # includes a summary of the feature flag changes on each environment
$ dri publish report --update # update the report note if has already been posted

Note: These options above can be combined like:

$ dri publish report --format=list --dry-run --actions --update

$ dri rm emoji

Removes the triage emoji from all triaged issues.

$ dri rm reports

When using $ dri publish report --dry-run to download the reports locally instead of uploading to the latest Pipeline Triage Issue, an /handover_reports/ folder created to store these reports. This command removes this folder and subsequent reports stored in it.

$ dri rm profile

Removes the profile currently in use.

$ dri incidents

Have a quick look at currently active/mitigated incidents on GitLab services.

$ dri faq

Returns a list of questions and answers related to on-call operations. This leverages existing pages of documentation, redirecting directly to the relevant section to help with a problem.

Development

Initial setup

  • Check out the repo dri
  • Then run
bundle install

Activate lefthook locally

lefthook install

Release

Automated gem release process is used to release new version of dri through pipelines, and this will:

Before release

Make sure to include a changelog entry in your commit message and read the changelog entries section.

If you forget to set the changelog entry in your commit messages, you can also edit the release notes after it's being released.

Steps to release

  • Update the version number in lib/dri/version.rb with the new gem version.
  • Run bundle install locally to update gem version in Gemfile.lock .
  • Use the Release merge request template and create a merge request to submit these changes. Then get the merge request merged by a maintainer.

This will then be packaged into a gem and pushed to rubygems.org by the CI/CD.

For example: Upgrades gem from 2.7.0 to 2.8.0.

Copyright (c) 2022 GitLab, Inc. See MIT License for further details.