# DRI So, are you the **D**irectly **R**esponsible **I**ndividual for GitLab's QA pipelines this week? Looking for a gem to help triage and report failing tests? Look no further. Welcome to your new gem! DRI is a CLI ready to help: - Fetching failing test cases by pipeline - Reporting at the end of the timezone shift - View today's newest and untriaged failures - Mark actions on failures ... and more ## Installation To install the `dri` gem: ```shell $ gem install dri ``` And then execute `dri` to see all available options: ```shell $ dri ``` ## Usage ### Configuration To use `dri` fully it is necessary to have: - a Personal Access Token - a triage emoji The emoji is the [Award/My Reaction](https://docs.gitlab.com/ee/user/award_emojis.html) emoji associated with the failure issues to group all failures triaged on a given day. This emoji is a personal choice. Note that the same emoji should be used only while triaging failures and not associated with other issues out of the scope of triage. To set up your personal profile: ```shell $ dri init ``` To verify the profile is correctly set: ```shell $ dri profile ``` ### Commands - [1. init](#1-init) - [2. profile](#2-profile) - [3. fetch](#3-fetch) - failures - testcases - triaged - quarantines - dequarantines - featureflags - runbooks - [4. publish](#4-publish) - report - [5. rm](#5-rm) - emoji - profile - reports - [6. incidents](#6-incidents) - [7. analyze](#7-analyze) - stacktraces - [8. version](#8-version) - [9. faq](#8-faq) #### 1. init ```shell $ dri init ``` Initializes the `dri` CLI with necessary configurations to run smoothly. #### 2. profile ```shell $ dri profile ``` Shows the current profile associated after initial configuration. Pass the option `--edit` to edit the current profile. #### 3. fetch ```shell $ 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. There is the possibility to customise the timeframe for such failures by passing a `--start_date=DD-MM-YYYY` and `--end_date=DD-MM-YYYY`. It is also possible to pass a `--cutoff=HH:MM` to just show failures after a certain period of the day. The cutoff time will be converted to UTC. To surface most urgent issues pass the `--urgent` flag to see issues that are both in `canary` and `staging-canary` pipelines just during today's timespan. ```shell $ 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) ```shell $ dri fetch triaged ``` Fetches triaged failures which use the triage emoji specified in `dri profile`. ```shell $ dri fetch quarantines ``` Fetches open quarantine Merge Requests to be reviewed ```shell $ dri fetch dequarantines ``` Fetches open dequarantine Merge Requests to be reviewed Results are organized by environment (production, staging, staging ref and preprod). ```shell $ dri fetch featureflags ``` Fetches a list of today's feature flag changes, including the date and time in UTC of when the change occurred as well as a link to the corresponding issue from the feature-flag-log project. ```shell $ dri fetch pipelines ``` Fetches a table containing last executed pipeline and its test report link for all monitored pipelines. The timestamps are in UTC ```shell $ dri fetch runbooks [runbook] ``` Fetches a runbook from the [runbooks](https://gitlab.com/gitlab-org/quality/runbooks) project. If `[runbook]` is omitted, the command will prompt the user to select from a list of available runbooks. #### 4. publish ```shell $ dri publish report ``` Publishes a handover report on the latest triage issue, in the [pipeline-triage](https://gitlab.com/gitlab-org/quality/pipeline-triage) project. The report includes automatically both triaged failures and incidents. **Options** ```shell $ 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: ```shell $ dri publish report --format=list --dry-run --actions --update ``` **Actions** When using `--actions` a set of actions are prompt on each failure. Use `Space` to mark several actions: `pinged SET`, `quarantined`, `reproduced`, `transient`. Hitting `Enter` without a selected action will skip marking the actions for a given failure. #### 5. rm ```shell $ dri rm emoji ``` Removes the triage emoji from all triaged issues. ```shell $ 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. ```shell $ dri rm profile ``` Removes the profile currently in use. #### 6. incidents ```shell $ dri incidents ``` Have a quick look at currently active/mitigated incidents on GitLab services. #### 7. analyze ```shell $ dri analyze stacktraces ``` Searches through any open test failure issues and publishes a report that identifies issues that have similar stack traces. This may be useful to identify situations where a common test failure is presenting itself across multiple individual test cases, over a period of time. #### 8. version ```shell $ dri version ``` `dri` gem version. #### 9. faq ```shell $ 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. ## Copyright Copyright (c) 2022 GitLab, Inc. See [MIT License](LICENSE.txt) for further details.