dri 0.11.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab/changelog_config.yml +13 -0
  3. data/.gitlab/merge_request_templates/Default.md +27 -0
  4. data/.gitlab/merge_request_templates/Release.md +8 -23
  5. data/.gitlab-ci.yml +6 -4
  6. data/.ruby-version +1 -1
  7. data/.tool-versions +1 -1
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile.lock +21 -2
  10. data/README.md +88 -98
  11. data/dri.gemspec +4 -0
  12. data/exe/dri +2 -1
  13. data/lefthook.yml +24 -0
  14. data/lib/dri/api_client.rb +18 -23
  15. data/lib/dri/cli.rb +0 -15
  16. data/lib/dri/command.rb +17 -51
  17. data/lib/dri/commands/add/fast_quarantine.rb +0 -2
  18. data/lib/dri/commands/add.rb +0 -1
  19. data/lib/dri/commands/analyze/stack_traces.rb +0 -3
  20. data/lib/dri/commands/analyze.rb +0 -1
  21. data/lib/dri/commands/faq.rb +0 -1
  22. data/lib/dri/commands/fetch/failures.rb +25 -25
  23. data/lib/dri/commands/fetch/{featureflags.rb → feature_flags.rb} +0 -5
  24. data/lib/dri/commands/fetch/pipelines.rb +0 -4
  25. data/lib/dri/commands/fetch/runbooks.rb +0 -2
  26. data/lib/dri/commands/fetch/testcases.rb +0 -2
  27. data/lib/dri/commands/fetch/triaged.rb +1 -5
  28. data/lib/dri/commands/fetch.rb +0 -6
  29. data/lib/dri/commands/incidents.rb +1 -5
  30. data/lib/dri/commands/init.rb +0 -2
  31. data/lib/dri/commands/profile.rb +0 -2
  32. data/lib/dri/commands/publish/report.rb +23 -23
  33. data/lib/dri/commands/publish.rb +0 -1
  34. data/lib/dri/commands/rm/emoji.rb +0 -2
  35. data/lib/dri/commands/rm/profile.rb +0 -1
  36. data/lib/dri/commands/rm/reports.rb +0 -1
  37. data/lib/dri/commands/rm.rb +0 -3
  38. data/lib/dri/commands/view/fast_quarantine.rb +0 -2
  39. data/lib/dri/commands/view.rb +0 -1
  40. data/lib/dri/feature_flag_report.rb +0 -2
  41. data/lib/dri/refinements/gitlab.rb +22 -0
  42. data/lib/dri/refinements/string.rb +19 -0
  43. data/lib/dri/report.rb +1 -3
  44. data/lib/dri/support/configuration.rb +62 -0
  45. data/lib/dri/utils/helpers.rb +15 -0
  46. data/lib/dri/version.rb +1 -1
  47. data/lib/dri.rb +8 -1
  48. metadata +72 -10
  49. data/lib/dri/gitlab/issues.rb +0 -19
  50. data/lib/dri/refinements/truncate.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 030e595feea9f3659c75e7079815b88eb654b124a338211f9226cb979ad73a5c
4
- data.tar.gz: 29ff03db73c44f4aee4d905820e423477e43a182cbc85677ff21a0ea54c98a28
3
+ metadata.gz: 5645bd9d3338211c2358afd90fdc3ad69c1ba60f517024978601fa7c8f2893e1
4
+ data.tar.gz: b047d324d60bb9e23e39b66e3fad29c7e27be5867c463d8a15abdc901251e161
5
5
  SHA512:
6
- metadata.gz: cf0b085cff259d0e0bb3f3cffe31699bb50c6b900239d1cad1cd270333097094ae73d0478fe870681d8609f968bbea8a26c85c900c8717c65447e3c5266672cc
7
- data.tar.gz: 0da07b06c6052457549eac9b7f116248dd4d534dee659a3fa8bcccb4d55fd796fd4ae4d328914d6ed1e4cf7026fe1fab9cfda2f9bced61d0848eb4276c49ba08
6
+ metadata.gz: bf9d19efe7b0a7ad7afa547d89a330adc31bde0a3f7dfc1c95fe23929aef56bd173bf7ee942a5afcf3e63593ae8d87a968a0c9b1f62d58750adfa7d8a5a24597
7
+ data.tar.gz: c1a9095caf1824f2865e49deeaaef8293e86925edb3e92c47518f5355fa87efe97ee9364eea98cd1096d548290db5a417d0bdc044b10cb0f0d799cdb22d2073e
@@ -0,0 +1,13 @@
1
+ ---
2
+ # Settings for generating changelogs using the GitLab API. See
3
+ # https://docs.gitlab.com/ee/api/repositories.html#generate-changelog-data for
4
+ # more information.
5
+ categories:
6
+ added: Added
7
+ fixed: Fixed
8
+ changed: Changed
9
+ deprecated: Deprecated
10
+ removed: Removed
11
+ security: Security
12
+ performance: Performance
13
+ other: Other
@@ -0,0 +1,27 @@
1
+ ## What does this MR do and why?
2
+
3
+ _Describe in detail what your merge request does and why._
4
+
5
+ <!--
6
+ Please keep this description updated with any discussion that takes place so
7
+ that reviewers can understand your intent. Keeping the description updated is
8
+ especially important if they didn't participate in the discussion.
9
+ -->
10
+
11
+ ## Screenshots or screen recordings
12
+
13
+ _These are strongly recommended to assist reviewers and reduce the time to merge your change._
14
+
15
+ ## How to set up and validate locally
16
+
17
+ _Numbered steps to set up and validate the change are strongly suggested._
18
+
19
+ ## MR acceptance checklist
20
+
21
+ This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
22
+
23
+ * [ ] I have evaluated the [MR acceptance checklist](https://docs.gitlab.com/ee/development/code_review.html#acceptance-checklist) for this MR.
24
+
25
+ /label ~"type::maintenance" ~Quality
26
+
27
+ <!-- template sourced from https://gitlab.com/gitlab-org/ruby/gems/dri/-/blob/master/.gitlab/merge_request_templates/Default.md -->
@@ -1,28 +1,13 @@
1
+ <!-- Replace `<PREVIOUS_VERSION>` with the previous version number here, `<COMMIT_UPDATING_VERSION>` with the latest
2
+ commit from this merge request, and `<NEW_VERSION>` with the upcoming version number. -->
1
3
  ## Diff
2
- <!-- Replace `v0.9.0` with the previous DRI release, and `55ddcace1c166fa2323d4e556262eba6b274230a` with the latest commit from https://gitlab.com/gitlab-org/quality/dri/-/commits/master that will be included in the release -->
3
- https://gitlab.com/gitlab-org/quality/dri/-/compare/v0.9.0...55ddcace1c166fa2323d4e556262eba6b274230a
4
4
 
5
- ## Release Notes
5
+ https://gitlab.com/gitlab-org/ruby/gems/dri/-/compare/<PREVIOUS_VERSION>...<COMMIT_UPDATING_VERSION>
6
6
 
7
- ```markdown
8
- ### Features
9
- - !aaa <Title of the aaa MR>
7
+ ## Checklist
10
8
 
11
- ### Bug Fixes
12
- - !bbb <Title of the bbb MR>
9
+ - [ ] Diff link is up-to-date.
10
+ - [ ] Check the release notes: https://gitlab.com/api/v4/projects/gitlab-org/ruby/gems/dri/repository/changelog?version=<NEW_VERSION>
11
+ - [ ] Based on the diff and the release notes, `version.rb` is updated, according to [SemVer](https://semver.org).
13
12
 
14
- ### Maintenance
15
- - !ccc <Title of the ccc MR>
16
- ```
17
-
18
- ## Checklists
19
-
20
- ### Before merging:
21
- - [ ] MR title is set to `Bump version to <version>`, where `<version>` is the new version, according to [SemVer](https://semver.org/).
22
- - [ ] Diff link is up-to-date.
23
- - [ ] Release notes are accurate.
24
- - [ ] `lib/dri/version.rb` is updated with the new version number.
25
- - [ ] `bundle update` was run to update `Gemfile.lock` with the new version number.
26
-
27
- ### After merging:
28
- - [ ] Update the release notes for the [newly created tag](https://gitlab.com/gitlab-org/quality/dri/-/tags) with the release notes from this MR.
13
+ /label ~"type::maintenance" ~"dx::pipeline"
data/.gitlab-ci.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  .job_base:
2
- image: registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3
2
+ image: registry.gitlab.com/gitlab-org/gitlab-build-images/${BUILD_OS}-${OS_VERSION}-ruby-${RUBY_VERSION}
3
3
  variables:
4
4
  BUNDLE_PATH: vendor/bundle
5
5
  BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES: "true"
@@ -19,14 +19,16 @@
19
19
  - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
20
20
 
21
21
  include:
22
+ - component: gitlab.com/gitlab-org/components/gem-release/gem-release@~latest
22
23
  - project: gitlab-org/quality/pipeline-common
23
24
  ref: 1.2.3
24
25
  file:
25
- - /ci/gem-release.yml
26
26
  - /ci/ref-update.gitlab-ci.yml
27
27
 
28
28
  variables:
29
- RUBY_VERSION: "3.1"
29
+ BUILD_OS: "debian"
30
+ OS_VERSION: "bookworm"
31
+ RUBY_VERSION: "3.1.5"
30
32
 
31
33
  stages:
32
34
  - build
@@ -53,6 +55,6 @@ rspec:
53
55
  extends: .job_base
54
56
  parallel:
55
57
  matrix:
56
- - RUBY_VERSION: ['3.0', '3.1']
58
+ - RUBY_VERSION: ['3.1.5', '3.2.4']
57
59
  script:
58
60
  - bundle exec rspec --force-color
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.4
1
+ 3.2.4
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.1.4
1
+ ruby 3.2.4
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at remy@rymai.me. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dri (0.11.0)
4
+ dri (1.1.0)
5
+ activesupport (~> 7.1)
5
6
  amatch (~> 0.4.1)
6
7
  gitlab (~> 4.19)
7
8
  httparty (~> 0.21.0)
@@ -20,14 +21,20 @@ PATH
20
21
  tty-prompt (~> 0.23.1)
21
22
  tty-spinner (~> 0.9)
22
23
  tty-table (~> 0.12.0)
24
+ zeitwerk (~> 2.6)
23
25
 
24
26
  GEM
25
27
  remote: https://rubygems.org/
26
28
  specs:
27
- activesupport (7.0.6)
29
+ activesupport (7.1.2)
30
+ base64
31
+ bigdecimal
28
32
  concurrent-ruby (~> 1.0, >= 1.0.2)
33
+ connection_pool (>= 2.2.5)
34
+ drb
29
35
  i18n (>= 1.6, < 2)
30
36
  minitest (>= 5.1)
37
+ mutex_m
31
38
  tzinfo (~> 2.0)
32
39
  addressable (2.8.4)
33
40
  public_suffix (>= 2.0.2, < 6.0)
@@ -35,11 +42,16 @@ GEM
35
42
  mize
36
43
  tins (~> 1.0)
37
44
  ast (2.4.2)
45
+ base64 (0.2.0)
46
+ bigdecimal (3.1.5)
38
47
  coderay (1.1.3)
39
48
  concurrent-ruby (1.2.2)
49
+ connection_pool (2.4.1)
40
50
  crack (0.4.5)
41
51
  rexml
42
52
  diff-lcs (1.5.0)
53
+ drb (2.2.0)
54
+ ruby2_keywords
43
55
  gitlab (4.19.0)
44
56
  httparty (~> 0.20)
45
57
  terminal-table (>= 1.5.1)
@@ -61,6 +73,7 @@ GEM
61
73
  rexml
62
74
  launchy (2.5.2)
63
75
  addressable (~> 2.8)
76
+ lefthook (1.11.8)
64
77
  markdown-tables (1.1.1)
65
78
  method_source (1.0.0)
66
79
  mini_mime (1.1.2)
@@ -68,6 +81,7 @@ GEM
68
81
  mize (0.4.1)
69
82
  protocol (~> 2.0)
70
83
  multi_xml (0.6.0)
84
+ mutex_m (0.2.0)
71
85
  parallel (1.23.0)
72
86
  parser (3.2.2.3)
73
87
  ast (~> 2.4.1)
@@ -130,6 +144,7 @@ GEM
130
144
  rubocop-capybara (~> 2.17)
131
145
  rubocop-factory_bot (~> 2.22)
132
146
  ruby-progressbar (1.13.0)
147
+ ruby2_keywords (0.0.5)
133
148
  ruby_parser (3.20.1)
134
149
  sexp_processor (~> 4.16)
135
150
  sexp_processor (4.17.0)
@@ -182,11 +197,13 @@ GEM
182
197
  concurrent-ruby (~> 1.0)
183
198
  unicode-display_width (2.4.2)
184
199
  unicode_utils (1.4.0)
200
+ vcr (6.2.0)
185
201
  webmock (3.18.1)
186
202
  addressable (>= 2.8.0)
187
203
  crack (>= 0.3.2)
188
204
  hashdiff (>= 0.4.0, < 2.0.0)
189
205
  wisper (2.0.1)
206
+ zeitwerk (2.6.13)
190
207
 
191
208
  PLATFORMS
192
209
  ruby
@@ -194,10 +211,12 @@ PLATFORMS
194
211
  DEPENDENCIES
195
212
  dri!
196
213
  gitlab-styles (~> 10)
214
+ lefthook (~> 1.3)
197
215
  pry (~> 0.14.1)
198
216
  rake (~> 13.0)
199
217
  rspec (~> 3.10.0)
200
218
  timecop (~> 0.9.1)
219
+ vcr (~> 6.2.0)
201
220
  webmock (~> 3.5)
202
221
 
203
222
  BUNDLED WITH
data/README.md CHANGED
@@ -1,93 +1,88 @@
1
- # DRI
1
+ # DRI Gem
2
2
 
3
- 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.
4
-
5
- Welcome to your new gem! DRI is a CLI ready to help:
3
+ 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:
6
4
 
7
5
  - Fetching failing test cases by pipeline
8
- - Reporting at the end of the timezone shift
9
- - View today's newest and untriaged failures
10
- - Mark actions on failures
6
+ - Reporting failures at the end of the timezone shift
7
+ - Viewing today's newest and untriaged failures
8
+ - Marking actions on failures
11
9
 
12
- ... and more
13
10
 
14
11
  ## Installation
15
12
 
16
- To install the `dri` gem:
13
+ Install dri using the following command:
17
14
 
18
15
  ```shell
19
16
  $ gem install dri
20
17
  ```
21
18
 
22
- And then execute `dri` to see all available options:
19
+ Execute `dri` to see all available options:
23
20
 
24
21
  ```shell
25
22
  $ dri
26
23
  ```
27
24
 
28
- ## Usage
25
+ ## Installing from source
29
26
 
30
- ### Configuration
27
+ After cloning this repository, build dri from source using the following command:
31
28
 
32
- To use `dri` fully it is necessary to have:
29
+ ```shell
30
+ $ gem build dri.gemspec
31
+ ```
33
32
 
34
- - a Personal Access Token
35
- - a triage emoji
33
+ A gemfile will be generated with the current version number, e.g. `dri-0.11.0.gem`. Install using the command:
36
34
 
37
- 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.
35
+ ```shell
36
+ $ gem install dri-0.11.0.gem
37
+ ```
38
38
 
39
- To set up your personal profile:
39
+ ## Getting Started
40
+
41
+ ### Configuration
42
+
43
+ Before diving into dri, ensure you have:
44
+
45
+ * A Personal Access Token for authentication.
46
+ * A triage emoji to mark triaged failures
47
+
48
+ Configure your profile with:
40
49
 
41
50
  ```shell
42
51
  $ dri init
43
52
  ```
44
53
 
45
- To verify the profile is correctly set:
54
+ To view or edit your profile:
46
55
 
47
56
  ```shell
48
57
  $ dri profile
49
58
  ```
50
59
 
51
- ### Commands
52
-
53
- - [1. init](#1-init)
54
- - [2. profile](#2-profile)
55
- - [3. fetch](#3-fetch)
56
- - failures
57
- - testcases
58
- - triaged
59
- - featureflags
60
- - runbooks
61
- - [4. publish](#4-publish)
62
- - report
63
- - [5. rm](#5-rm)
64
- - emoji
65
- - profile
66
- - reports
67
- - [6. incidents](#6-incidents)
68
- - [7. analyze](#7-analyze)
69
- - stacktraces
70
- - [8. version](#8-version)
71
- - [9. faq](#8-faq)
72
-
73
- #### 1. init
60
+ ### Usage
74
61
 
75
62
  ```shell
76
- $ dri init
63
+ $ dri help
77
64
  ```
78
65
 
79
- Initializes the `dri` CLI with necessary configurations to run smoothly.
66
+ `dri` supports a variety of commands to streamline your workflow:
80
67
 
81
- #### 2. profile
68
+ - init: Set up dri with necessary configurations.
69
+ - profile: Display or edit your user profile.
70
+ - fetch: Retrieve information on failures, test cases, triaged issues, feature flags, and more.
71
+ - publish: Generate and publish reports.
72
+ - rm: Remove emojis, profiles, or reports.
73
+ - incidents: View active or mitigated incidents.
74
+ - analyze: Analyze stack traces for common failures.
75
+ - version: Check the installed version of dri.
76
+ - faq: Access FAQs related to on-call operations.
82
77
 
83
- ```shell
84
- $ dri profile
85
- ```
86
78
 
87
- Shows the current profile associated after initial configuration.
88
- Pass the option `--edit` to edit the current profile.
79
+ #### Command Details
89
80
 
90
- #### 3. fetch
81
+ - fetch: Use options like --start_date, --end_date, and --cutoff to customize your queries.
82
+ - publish report: Customize reports with --format, --dry-run, --actions, and --feature-flags options.
83
+ - rm: Manage your environment by cleaning up emojis, profiles, or locally stored reports.
84
+
85
+ Example Commands:
91
86
 
92
87
  ```shell
93
88
  $ dri fetch failures
@@ -96,13 +91,8 @@ $ dri fetch failures
96
91
  Fetches today's opened failures and lists them according to their triage status.
97
92
  Helpful to understand if there are missing recent failures to be reviewed.
98
93
 
99
- There is the possibility to customise the timeframe for such failures by passing a
100
- `--start_date=DD-MM-YYYY` and `--end_date=DD-MM-YYYY`. It is also possible to pass
101
- a `--cutoff=HH:MM` to just show failures after a certain period of the day. The cutoff
102
- time will be converted to UTC.
103
-
104
- Smoke and Reliable failures will be highlighted in bold and in between *'s. These require
105
- to have set `QA_INFLUXDB_URL` and `QA_INFLUXDB_TOKEN` environment variables to be found in 1Password.
94
+ **Note:** Smoke and Reliable failures will be highlighted in bold and in between *'s. These require
95
+ to have set `QA_INFLUXDB_URL` and `QA_INFLUXDB_TOKEN` environment variables, to be found in 1Password.
106
96
 
107
97
  ```shell
108
98
  $ dri fetch testcases
@@ -116,20 +106,13 @@ To filter the pipelines, pass the `--filter-pipelines` options to multi-select t
116
106
  $ dri fetch triaged
117
107
  ```
118
108
 
119
- Fetches triaged failures which use the triage emoji specified in `dri profile`.
120
-
121
- ```shell
122
- $ dri fetch featureflags
123
- ```
124
-
125
- 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.
109
+ Fetches triaged failures.
126
110
 
127
111
  ```shell
128
112
  $ dri fetch pipelines
129
113
  ```
130
114
 
131
115
  Fetches a table containing last executed pipeline and its test report link for all monitored pipelines.
132
- The timestamps are in UTC
133
116
 
134
117
  ```shell
135
118
  $ dri fetch runbooks [runbook]
@@ -138,14 +121,11 @@ $ dri fetch runbooks [runbook]
138
121
  Fetches a runbook from the [runbooks](https://gitlab.com/gitlab-org/quality/runbooks) project.
139
122
  If `[runbook]` is omitted, the command will prompt the user to select from a list of available runbooks.
140
123
 
141
- #### 4. publish
142
-
143
124
  ```shell
144
125
  $ dri publish report
145
126
  ```
146
127
 
147
- Publishes a handover report on the latest triage issue, in the [pipeline-triage](https://gitlab.com/gitlab-org/quality/pipeline-triage) project.
148
- The report includes automatically both triaged failures and incidents.
128
+ Publishes a handover report on the latest weekly triage issue.
149
129
 
150
130
  **Options**
151
131
 
@@ -157,22 +137,13 @@ $ dri publish report --actions # activate the actions prompt for each failure
157
137
  $ dri publish report --feature-flags # includes a summary of the feature flag changes on each environment
158
138
  $ dri publish report --update # update the report note if has already been posted
159
139
  ```
160
-
140
+ ---
161
141
  **Note:** These options above can be combined like:
162
142
 
163
143
  ```shell
164
144
  $ dri publish report --format=list --dry-run --actions --update
165
145
  ```
166
-
167
- **Actions**
168
-
169
- When using `--actions` a set of actions are prompt on each failure. Use `Space` to
170
- mark several actions: `pinged SET`, `quarantined`, `reproduced`, `transient`.
171
- Hitting `Enter` without a selected action will skip marking the actions for a given
172
- failure.
173
-
174
- #### 5. rm
175
-
146
+ ---
176
147
  ```shell
177
148
  $ dri rm emoji
178
149
  ```
@@ -193,41 +164,60 @@ $ dri rm profile
193
164
 
194
165
  Removes the profile currently in use.
195
166
 
196
- #### 6. incidents
197
-
198
167
  ```shell
199
168
  $ dri incidents
200
169
  ```
201
170
 
202
171
  Have a quick look at currently active/mitigated incidents on GitLab services.
203
172
 
204
- #### 7. analyze
205
-
206
173
  ```shell
207
- $ dri analyze stacktraces
174
+ $ dri faq
208
175
  ```
209
- Searches through any open test failure issues and publishes a report that identifies
210
- issues that have similar stack traces.
211
- This may be useful to identify situations where a common test failure is presenting
212
- itself across multiple individual test cases, over a period of time.
213
176
 
214
- #### 8. version
177
+ Returns a list of questions and answers related to on-call operations. This leverages
178
+ existing pages of documentation, redirecting directly to the relevant section to help
179
+ with a problem.
180
+
181
+ ## Development
182
+
183
+ ### Initial setup
184
+ - Check out the repo [dri](https://gitlab.com/gitlab-org/ruby/gems/dri)
185
+ - Then run
215
186
 
216
187
  ```shell
217
- $ dri version
188
+ bundle install
218
189
  ```
219
190
 
220
- `dri` gem version.
221
-
222
- #### 9. faq
191
+ ### Activate lefthook locally
223
192
 
224
193
  ```shell
225
- $ dri faq
194
+ lefthook install
226
195
  ```
227
196
 
228
- Returns a list of questions and answers related to on-call operations. This leverages
229
- existing pages of documentation, redirecting directly to the relevant section to help
230
- with a problem.
197
+ ## Release
198
+
199
+ [Automated gem release process](https://gitlab.com/gitlab-org/components/gem-release/-/tree/main?ref_type=heads#gem-release-component) is used to release new version of `dri` through pipelines, and this will:
200
+
201
+ - Publish the gem: https://rubygems.org/gems/dri
202
+ - Add a release in the `dri` project: https://gitlab.com/gitlab-org/ruby/gems/dri/-/releases
203
+ - Populate the release log with the API contents. For example: https://gitlab.com/api/v4/projects/52612795/repository/changelog?version=1.0.0
204
+
205
+ ### Before release
206
+
207
+ Make sure to include a changelog entry in your commit message and read the [changelog entries section](https://docs.gitlab.com/ee/development/changelog.html).
208
+
209
+ If you forget to set the changelog entry in your commit messages, you can also edit the release notes after it's being released.
210
+
211
+ ### Steps to release
212
+
213
+ - Update the version number in `lib/dri/version.rb` with the new gem version.
214
+ - Run `bundle install` locally to update gem version in `Gemfile.lock` .
215
+ - Use the `Release` merge request template and create a merge request to submit these changes. Then get the merge request merged by a maintainer.
216
+
217
+ This will then be packaged into a gem and pushed to [rubygems.org](https://rubygems.org) by the CI/CD.
218
+
219
+ For example: [Upgrades gem from 2.7.0 to 2.8.0](https://gitlab.com/gitlab-org/ruby/gems/gitlab_quality-test_tooling/-/merge_requests/286).
220
+
231
221
  ## Copyright
232
222
 
233
223
  Copyright (c) 2022 GitLab, Inc. See [MIT License](LICENSE.txt) for further details.
data/dri.gemspec CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
24
 
25
+ spec.add_dependency 'activesupport', '~> 7.1'
25
26
  spec.add_dependency 'amatch', '~> 0.4.1'
26
27
  spec.add_dependency "gitlab", "~> 4.19"
27
28
  spec.add_dependency 'httparty', '~> 0.21.0'
@@ -40,11 +41,14 @@ Gem::Specification.new do |spec|
40
41
  spec.add_dependency 'tty-prompt', '~> 0.23.1'
41
42
  spec.add_dependency 'tty-spinner', '~> 0.9'
42
43
  spec.add_dependency 'tty-table', '~> 0.12.0'
44
+ spec.add_dependency 'zeitwerk', '~> 2.6'
43
45
 
44
46
  spec.add_development_dependency 'gitlab-styles', '~> 10'
47
+ spec.add_development_dependency "lefthook", "~> 1.3"
45
48
  spec.add_development_dependency "pry", "~> 0.14.1"
46
49
  spec.add_development_dependency 'rake', "~> 13.0"
47
50
  spec.add_development_dependency 'rspec', '~> 3.10.0'
48
51
  spec.add_development_dependency "timecop", "~> 0.9.1"
52
+ spec.add_development_dependency 'vcr', '~> 6.2.0'
49
53
  spec.add_development_dependency 'webmock', '~> 3.5'
50
54
  end
data/exe/dri CHANGED
@@ -3,7 +3,8 @@
3
3
 
4
4
  lib_path = File.expand_path('../lib', __dir__)
5
5
  $LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)
6
- require 'dri/cli'
6
+
7
+ require 'dri'
7
8
 
8
9
  Signal.trap('INT') do
9
10
  warn("\n#{caller.join("\n")}: interrupted")
data/lefthook.yml ADDED
@@ -0,0 +1,24 @@
1
+ # Lefthook configuration. For more information, see:
2
+ # https://lefthook.dev/configuration/index.html
3
+
4
+ pre-push:
5
+ parallel: true
6
+ commands:
7
+ # Run ruby linting
8
+ rubocop:
9
+ run: bundle exec rubocop
10
+ glob: '*.rb'
11
+
12
+ # Changelog git trailer for the first commit of the branch
13
+ changelog-on-first-commit:
14
+ run: |
15
+ git fetch origin main
16
+ first_commit_message=$(git log --format=%B -n 1 $(git log origin/main..HEAD --pretty=format:"%h" | tail -1))
17
+ if ! echo ${first_commit_message} | grep "Changelog:"; then
18
+ echo Could not find a Changelog: git trailer on the first commit for this branch.
19
+ echo
20
+ echo Please add a trailer by amending the git commit message.
21
+ echo
22
+ echo See https://docs.gitlab.com/ee/development/changelog.html#overview for more info.
23
+ exit 1
24
+ fi