sequra-style 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3a9e77fe531700597d097449dc31a2f016903a6e37e4db8b18be3158a4c4abfe
4
+ data.tar.gz: 7221a139f54b44f292c6c73cb0fbceca30fe1ee4d673af922c49b8e66c605236
5
+ SHA512:
6
+ metadata.gz: '0675827621a8fe844ef6bc3a418eddce89505e6b7cfc1aae9780400aba222e87f437f64b3ac6ceb0f738a38dc5c4b5c473c8de73032b47a0e7aa6582cd0ce687'
7
+ data.tar.gz: c71a87b1f3f75a412cb600c6f5edaf7609164fc5ff0720216c30a850ab4c15bf8de47d78d799e24e831c614ef4b6d327482152f75ae92ffd5ba6d612a0934258
@@ -0,0 +1 @@
1
+ * @sequra/developer-experience
@@ -0,0 +1,46 @@
1
+ ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
2
+ ✂✂✂ REMOVE FROM THIS PART BEFORE SUBMITTING YOUR PULL REQUEST ✂✂✂
3
+ ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
4
+
5
+ Here are some friendly reminders before submitting your pull request:
6
+
7
+ - There should be a goal describing the motivation for this change.
8
+ - Consider if this change is restricting current style or expanding it.
9
+ - Changes should be discussed with the team before being accepted.
10
+ - Restricting changes should have [severity level `info`](https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Severity) to allow time for adoption before making them mandatory.
11
+
12
+ YOU CAN REMOVE THE PARTS OF THE TEMPLATE THAT DO NOT APPLY TO YOUR PULL REQUEST
13
+
14
+ ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
15
+ ✂✂✂ REMOVE UP TO THIS PART BEFORE SUBMITTING YOUR PULL REQUEST ✂✂✂
16
+ ✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂✂
17
+
18
+ ### What is the goal?
19
+
20
+ _Provide a description of the overall goal._
21
+
22
+ ### Is this a restricting or expanding change?
23
+
24
+ **_[RESTRICTING|EXPANDING] change**
25
+
26
+ _Restricting changes are those that limit the current style or add new rules, while expanding changes are those that remove rules or relax the current ones._
27
+
28
+ _Changes should be discussed with the team before being accepted._
29
+
30
+ _Restricting changes should have [severity level `info`](https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Severity) to allow time for adoption before making them mandatory._
31
+
32
+ ### References
33
+ * **Related pull-requests:** _list of related pull-requests (comma-separated): #1, #2_
34
+ * **Any other references:** _list of links to other references (comma-separated): link1, link2_
35
+
36
+ ### How is it being implemented?
37
+
38
+ _Provide a description of the implementation_
39
+
40
+ ### Opportunistic refactorings
41
+
42
+ _Have you improved the code/app in anyway? Explain what you did._
43
+
44
+ ### Caveats
45
+
46
+ _If you find any, please describe all the special conditions._
@@ -0,0 +1,20 @@
1
+ name: "Lint PR"
2
+
3
+ on:
4
+ pull_request_target:
5
+ types:
6
+ - opened
7
+ - edited
8
+ - synchronize
9
+
10
+ permissions:
11
+ pull-requests: read
12
+
13
+ jobs:
14
+ main:
15
+ name: Validate PR title
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: amannn/action-semantic-pull-request@v5
19
+ env:
20
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,33 @@
1
+ name: Create gem release pull request
2
+ on:
3
+ push:
4
+ branches:
5
+ - 'master'
6
+ jobs:
7
+ release:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: GoogleCloudPlatform/release-please-action@v3
11
+ id: release
12
+ with:
13
+ release-type: ruby
14
+ package-name: sequra-style
15
+ bump-minor-pre-major: true
16
+ version-file: 'lib/sequra/sequra-style/version.rb'
17
+ - uses: actions/checkout@v2
18
+ if: ${{ steps.release.outputs.release_created }}
19
+ - uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: 3.2
22
+ if: ${{ steps.release.outputs.release_created }}
23
+ - name: Publish gem to Rubygems
24
+ run: |
25
+ mkdir -p $HOME/.gem
26
+ touch $HOME/.gem/credentials
27
+ chmod 0600 $HOME/.gem/credentials
28
+ printf -- "---\n:rubygems: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
29
+ gem build *.gemspec
30
+ gem push --KEY rubygems --host https://rubygems.org *.gem
31
+ env:
32
+ GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_PUBLISH_TOKEN }}"
33
+ if: ${{ steps.release.outputs.release_created }}
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ - default.yml
data/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ ## [1.0.2](https://github.com/sequra/sequra-style/compare/v1.0.1...v1.0.2) (2024-03-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add note about severity level for restricting changes ([#23](https://github.com/sequra/sequra-style/issues/23)) ([9978874](https://github.com/sequra/sequra-style/commit/99788746845c79e9e7239edd49df1286a9e38a5f))
9
+
10
+ ## [1.0.1](https://github.com/sequra/sequra-style/compare/v1.0.0...v1.0.1) (2024-03-14)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Allow pushing gem to rubygems.pkg.github.com ([#20](https://github.com/sequra/sequra-style/issues/20)) ([df7191f](https://github.com/sequra/sequra-style/commit/df7191f7f212d416a4531d358b27769d45458cda))
16
+
17
+ ## 1.0.0 (2024-03-12)
18
+
19
+
20
+ ### Features
21
+
22
+ * Initial release ([0b5898c](https://github.com/sequra/sequra-style/commit/0b5898ce8dd54b2570a4eac51d5352c74f484570))
23
+ * initial release ([#18](https://github.com/sequra/sequra-style/issues/18)) ([ef46dac](https://github.com/sequra/sequra-style/commit/ef46dac4b7f6e1d6bbe89c155bb673219a0e30ba))
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in sequra-style.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sequra-style (1.0.2)
5
+ rubocop (~> 1)
6
+ rubocop-performance (~> 1)
7
+ rubocop-rails (~> 2)
8
+ rubocop-rspec (~> 2)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ activesupport (7.0.4)
14
+ concurrent-ruby (~> 1.0, >= 1.0.2)
15
+ i18n (>= 1.6, < 2)
16
+ minitest (>= 5.1)
17
+ tzinfo (~> 2.0)
18
+ ast (2.4.2)
19
+ concurrent-ruby (1.1.10)
20
+ i18n (1.12.0)
21
+ concurrent-ruby (~> 1.0)
22
+ json (2.6.2)
23
+ minitest (5.16.3)
24
+ parallel (1.22.1)
25
+ parser (3.1.2.1)
26
+ ast (~> 2.4.1)
27
+ rack (3.0.0)
28
+ rainbow (3.1.1)
29
+ rake (13.0.6)
30
+ regexp_parser (2.6.1)
31
+ rexml (3.2.5)
32
+ rubocop (1.39.0)
33
+ json (~> 2.3)
34
+ parallel (~> 1.10)
35
+ parser (>= 3.1.2.1)
36
+ rainbow (>= 2.2.2, < 4.0)
37
+ regexp_parser (>= 1.8, < 3.0)
38
+ rexml (>= 3.2.5, < 4.0)
39
+ rubocop-ast (>= 1.23.0, < 2.0)
40
+ ruby-progressbar (~> 1.7)
41
+ unicode-display_width (>= 1.4.0, < 3.0)
42
+ rubocop-ast (1.23.0)
43
+ parser (>= 3.1.1.0)
44
+ rubocop-performance (1.15.1)
45
+ rubocop (>= 1.7.0, < 2.0)
46
+ rubocop-ast (>= 0.4.0)
47
+ rubocop-rails (2.17.2)
48
+ activesupport (>= 4.2.0)
49
+ rack (>= 1.1)
50
+ rubocop (>= 1.33.0, < 2.0)
51
+ rubocop-rspec (2.15.0)
52
+ rubocop (~> 1.33)
53
+ ruby-progressbar (1.11.0)
54
+ tzinfo (2.0.5)
55
+ concurrent-ruby (~> 1.0)
56
+ unicode-display_width (2.3.0)
57
+
58
+ PLATFORMS
59
+ ruby
60
+
61
+ DEPENDENCIES
62
+ bundler (~> 2.1.4)
63
+ rake (~> 13.0.1)
64
+ sequra-style!
65
+
66
+ BUNDLED WITH
67
+ 2.1.4
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Joel Junström
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # sequra-style
2
+
3
+ SeQura code style guide and shared configuration.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile (we need to point to GitHub since it's not published):
8
+
9
+ ```ruby
10
+ gem "sequra-style", git: "https://github.com/sequra/sequra-style", require: false
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```shell
16
+ $ bundle install
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Use the following directives in a `.rubocop.yml` file:
22
+
23
+ ```yaml
24
+ inherit_gem:
25
+ sequra-style:
26
+ - default.yml
27
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "sequra/style"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/default.yml ADDED
@@ -0,0 +1,287 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rails
4
+ - rubocop-rspec
5
+
6
+ AllCops:
7
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
8
+ # to ignore them, so only the ones explicitly set in this file are enabled.
9
+ DisabledByDefault: true
10
+ Exclude:
11
+ - "**/vendor/**/*"
12
+ - "**/node_modules/**/*"
13
+ - "local_files/**/*"
14
+ NewCops: disable
15
+
16
+ Performance:
17
+ Enabled: true
18
+ Exclude:
19
+ - "**/spec/**/*"
20
+
21
+ Rails:
22
+ Enabled: true
23
+
24
+ # Prefer assert_not over assert !
25
+ Rails/AssertNot:
26
+ Include:
27
+ - "**/spec/**/*"
28
+
29
+ # Don't enforce tag over content tag until this issue is properly handled:
30
+ # https://github.com/rubocop-hq/rubocop-rails/issues/260
31
+ Rails/ContentTag:
32
+ Enabled: false
33
+
34
+ Rails/FilePath:
35
+ EnforcedStyle: "arguments"
36
+
37
+ # Prefer assert_not_x over refute_x
38
+ Rails/RefuteMethods:
39
+ Include:
40
+ - "**/spec/**/*"
41
+
42
+ Rails/TimeZone:
43
+ Enabled: true
44
+
45
+ # Prefer &&/|| over and/or.
46
+ Style/AndOr:
47
+ Enabled: true
48
+
49
+ Style/DateTime:
50
+ Enabled: true
51
+
52
+ Style/MultilineIfModifier:
53
+ Enabled: true
54
+
55
+ Style/NestedModifier:
56
+ Enabled: true
57
+
58
+ Style/SoleNestedConditional:
59
+ Enabled: true
60
+
61
+ # Align `when` with `case`.
62
+ Layout/CaseIndentation:
63
+ Enabled: true
64
+
65
+ Layout/ClassStructure:
66
+ Enabled: true
67
+ ExpectedOrder:
68
+ - module_inclusion
69
+ - constants
70
+ - association
71
+ - public_attribute_macros
72
+ - public_delegate
73
+ - macros
74
+ - public_class_methods
75
+ - initializer
76
+ - public_methods
77
+ - protected_attribute_macros
78
+ - protected_methods
79
+ - private_attribute_macros
80
+ - private_delegate
81
+ - private_methods
82
+ Categories:
83
+ association:
84
+ - has_many
85
+ - has_one
86
+ attribute_macros:
87
+ - attr_accessor
88
+ - attr_reader
89
+ - attr_writer
90
+ macros:
91
+ - validates
92
+ - validate
93
+ module_inclusion:
94
+ - include
95
+ - prepend
96
+ - extend
97
+
98
+ # Align comments with method definitions.
99
+ Layout/CommentIndentation:
100
+ Enabled: true
101
+
102
+ Layout/ElseAlignment:
103
+ Enabled: true
104
+
105
+ # Align `end` with the matching keyword or starting expression except for
106
+ # assignments, where it should be aligned with the LHS.
107
+ Layout/EndAlignment:
108
+ Enabled: true
109
+ EnforcedStyleAlignWith: variable
110
+ AutoCorrect: true
111
+
112
+ Layout/EmptyLineAfterMagicComment:
113
+ Enabled: true
114
+
115
+ Layout/EmptyLinesAroundBlockBody:
116
+ Enabled: true
117
+
118
+ # In a regular class definition, no empty lines around the body.
119
+ Layout/EmptyLinesAroundClassBody:
120
+ Enabled: true
121
+
122
+ # In a regular method definition, no empty lines around the body.
123
+ Layout/EmptyLinesAroundMethodBody:
124
+ Enabled: true
125
+
126
+ # In a regular module definition, no empty lines around the body.
127
+ Layout/EmptyLinesAroundModuleBody:
128
+ Enabled: true
129
+
130
+ Layout/FirstArgumentIndentation:
131
+ Enabled: true
132
+
133
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
134
+ Style/HashSyntax:
135
+ Enabled: true
136
+
137
+ # Method definitions after `private` or `protected` isolated calls need one
138
+ # extra level of indentation.
139
+ Layout/IndentationConsistency:
140
+ Enabled: true
141
+ EnforcedStyle: indented_internal_methods
142
+
143
+ # Two spaces, no tabs (for indentation).
144
+ Layout/IndentationWidth:
145
+ Enabled: true
146
+
147
+ Layout/LeadingCommentSpace:
148
+ Enabled: true
149
+
150
+ Layout/SpaceAfterColon:
151
+ Enabled: true
152
+
153
+ Layout/SpaceAfterComma:
154
+ Enabled: true
155
+
156
+ Layout/SpaceAroundEqualsInParameterDefault:
157
+ Enabled: true
158
+
159
+ Layout/SpaceAroundKeyword:
160
+ Enabled: true
161
+
162
+ Layout/SpaceAroundOperators:
163
+ Enabled: true
164
+
165
+ Layout/SpaceBeforeComma:
166
+ Enabled: true
167
+
168
+ Layout/SpaceBeforeComment:
169
+ Enabled: true
170
+
171
+ Layout/SpaceBeforeFirstArg:
172
+ Enabled: true
173
+ Exclude:
174
+ - "**/spec/**/*"
175
+
176
+ Style/DefWithParentheses:
177
+ Enabled: true
178
+
179
+ # Defining a method with parameters needs parentheses.
180
+ Style/MethodDefParentheses:
181
+ Enabled: true
182
+
183
+ Style/FrozenStringLiteralComment:
184
+ Enabled: false
185
+ EnforcedStyle: always
186
+
187
+ Layout/LineLength:
188
+ Enabled: true
189
+ Max: 128
190
+
191
+ # Use `foo {}` not `foo{}`.
192
+ Layout/SpaceBeforeBlockBraces:
193
+ Enabled: true
194
+
195
+ # Use `foo { bar }` not `foo {bar}`.
196
+ Layout/SpaceInsideBlockBraces:
197
+ Enabled: true
198
+
199
+ # Use `{ a: 1 }` not `{a:1}`.
200
+ Layout/SpaceInsideHashLiteralBraces:
201
+ Enabled: true
202
+
203
+ Layout/SpaceInsideParens:
204
+ Enabled: true
205
+
206
+ # Check quotes usage according to lint rule below.
207
+ Style/StringLiterals:
208
+ Enabled: true
209
+ EnforcedStyle: double_quotes
210
+
211
+ # Detect hard tabs, no hard tabs.
212
+ Layout/IndentationStyle:
213
+ Enabled: true
214
+
215
+ # Blank lines should not have any spaces.
216
+ Layout/TrailingEmptyLines:
217
+ Enabled: true
218
+
219
+ # No trailing whitespace.
220
+ Layout/TrailingWhitespace:
221
+ Enabled: true
222
+
223
+ Lint/Debugger:
224
+ Enabled: true
225
+
226
+ # Use quotes for string literals when they are enough.
227
+ Style/RedundantPercentQ:
228
+ Enabled: true
229
+
230
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
231
+ Lint/RequireParentheses:
232
+ Enabled: true
233
+
234
+ Lint/RedundantStringCoercion:
235
+ Enabled: true
236
+
237
+ Lint/UriEscapeUnescape:
238
+ Enabled: true
239
+
240
+ Style/ParenthesesAroundCondition:
241
+ Enabled: true
242
+
243
+ Style/RedundantReturn:
244
+ Enabled: true
245
+ AllowMultipleReturnValues: true
246
+
247
+ Style/Semicolon:
248
+ Enabled: true
249
+ AllowAsExpressionSeparator: true
250
+
251
+ # Prefer Foo.method over Foo::method
252
+ Style/ColonMethodCall:
253
+ Enabled: true
254
+
255
+ Style/TrivialAccessors:
256
+ Enabled: true
257
+
258
+ # Use guard clauses when possible
259
+ Style/GuardClause:
260
+ Enabled: true
261
+
262
+ Performance/FlatMap:
263
+ Enabled: true
264
+
265
+ Performance/RedundantMerge:
266
+ Enabled: true
267
+
268
+ Performance/StartWith:
269
+ Enabled: true
270
+
271
+ Performance/EndWith:
272
+ Enabled: true
273
+
274
+ Performance/RegexpMatch:
275
+ Enabled: true
276
+
277
+ RSpec/ContextWording:
278
+ Enabled: false
279
+
280
+ RSpec/ExampleLength:
281
+ Max: 16
282
+
283
+ RSpec/MultipleExpectations:
284
+ Enabled: false
285
+
286
+ RSpec/NestedGroups:
287
+ Enabled: false
@@ -0,0 +1,170 @@
1
+ # Use Markdown Architectural Decision Records
2
+ An architecture decision record (ADR) is a document that captures an important architecture decision made along with its context and consequences.
3
+
4
+ ---
5
+ **💡 Proposed 💡**
6
+ * **Deciders:** @franmosteiro, @jaimevelaz
7
+ * **Proposal date:** 25/10/2022
8
+ * **Due date:** 01/11/2022
9
+ * **Technical information:** None
10
+
11
+ ---
12
+ ### Contents
13
+ * [Context and Problem Statement](./##context-and-problem-statement)
14
+ * [Decision Drivers](./##decision-drivers)
15
+ * [Considered Options](./##considered-options)
16
+ * [Decision Outcome](./##decision-outcome)
17
+ * [ADR file name conventions](./###adr-file-name-conventions)
18
+ * [Suggestions for writing good ADRs](./###suggestions-for-writing-good-adrs)
19
+ * [Credits](./##credits)
20
+
21
+ ## Context and Problem Statement
22
+ ### Context
23
+ As the team grows, we find that there is a growing need for documenting better and more the technical decisions we make in our services.
24
+
25
+ This is not important just to the current people in the teams, or to the ones to come and even for our future ourselves when we need to recheck why we did something or how we decided something, but also for other teams and coworkers to reflect their own decisions and this way, finding some kind of alignment in the technical part without patronizing the autonomy in the teams.
26
+
27
+ In short, trying to maintain a good balance between them: autonomy, pragmatism, and a similar stack.
28
+
29
+ ### Hypothesis
30
+ We think that by providing some base templating for **ADR generation** and using them for our services design decisions, we can make this goal of documenting more and better relatively easier, simpler, faster and ultimately more straightforward for teams, so they will only have to make use of them when creating a new feature or iterating older ones.
31
+
32
+ ### Experiment
33
+ We propose using **ADRs** as a tool that **might help us document our technical and design decisions more and better**. And also we think that the best place to place them is near the code, using them as another good way to understand the bigger picture before jumping into the tests and production code to get the detail of the things documented in the ADRs firstly.
34
+
35
+ Of course, this will be an initial approach and we expect the template to evolve and grow with the collaboration, experience and necessities of any of the teams! 😊
36
+
37
+ ## Decision Drivers
38
+ * Incremental growth in the size and number of teams and services.
39
+ * Lack of context on other teams owned services, tracing, telemetry etc.
40
+ * Lack of context in decision-making and overall direction of services.
41
+ * Looking to improve cross-team collaboration.
42
+ * Need to enable teams to understand the bigger picture.
43
+
44
+ ## Considered Options
45
+ * Use Google Drive and its online editing capabilities, through a Google Doc or Google Sheet.
46
+ * Use Atlassian Jira, through the tool's planning tracker.
47
+ * Use Atlassian Confluence (wiki) and create wiki-style ADRs.
48
+ * Making use of source code version control, such as git, we could create a file for each ADR nearest to the code.
49
+ * [MADR](https://adr.github.io/madr/) 2.1.2 – The Markdown Architectural Decision Records.
50
+ * [Michael Nygard's template](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions) – The first incarnation of the term "ADR".
51
+ * [Sustainable Architectural Decisions](https://www.infoq.com/articles/sustainable-architectural-design-decisions) – The Y-Statements.
52
+ * Other templates listed at <https://github.com/joelparkerhenderson/architecture_decision_record>
53
+ * Formless – No conventions for file format and structure.
54
+
55
+ ## Decision Outcome
56
+ We want to record architectural decisions made in this project.
57
+
58
+ **Which format and structure should these records follow?**
59
+
60
+ **Choosen option:** ADRs and in particular the [MADR model](https://adr.github.io/madr/)(without the tooling), because
61
+
62
+ * Implicit assumptions should be made explicit.
63
+ Design documentation is important to enable people to understand the decisions later on.
64
+ See also [A rational design process: How and why to fake it](https://doi.org/10.1109/TSE.1986.6312940).
65
+ * The MADR format is lean and fits our development style.
66
+ * The MADR structure is comprehensible and facilitates usage & maintenance.
67
+ * The MADR project is vivid.
68
+
69
+ ### ADR ownership and execution
70
+ **Ownership** of the ADR during the drafting and validation process **belongs to the persons/teams that originally initiated it.**
71
+
72
+ Among other things, **they will be responsible for:**
73
+
74
+ * **Communicate**, through the necessary and appropriate channels and as many times as necessary, the entire content of the ADR (even before it is finalised or closed, in draft).
75
+
76
+ * **Obtain the buy-in** of the interlocutors and/or teams involved in the change or improvement proposed by the ADR, including stakeholders, if applicable.
77
+
78
+ * **By consent** (this means that there is no more appropriate or better proposal, so we go with this one), **the tech team should be aligned and aware** of the step with this new ADR and become part of their own technical decisions.
79
+
80
+ * **Be advocates of the idea** behind the ADR even after it has gone live, **reminding and helping new teams and colleagues to keep it relevant in their designs.**
81
+
82
+ ### ADR file name conventions
83
+ If you choose to create your ADRs using typical text files, then you may want to come up with your own ADR file name convention.
84
+
85
+ We prefer to use a file name convention that has a specific format. Based on [this other ADR in Simba](https://github.com/sequra/simba/blob/master/adr/2022-03-10-adr-ids-timestamps.md), we will choose this format:
86
+
87
+ * yyyy-mm-dd-choose-database.md
88
+ * yyyy-mm-dd-format-timestamps.md
89
+ * yyyy-mm-dd-manage-passwords.md
90
+ * yyyy-mm-dd-handle-exceptions.md
91
+
92
+ Our file name convention:
93
+
94
+ * Date of creation: yyyy-mm-dd
95
+ * The name has a present tense imperative verb phrase. This helps readability and matches our commit message format.
96
+ * The name uses lowercase and dashes (same as this repo). This is a balance of readability and system usability.
97
+ * The extension is markdown. This can be useful for easy formatting.
98
+
99
+ ### ADR workflow suggestion
100
+ ```text
101
+ ⚠️ This is just a suggested workflow. The choosed workflow may depend on the necessities your team has around the ADR: sharing an idea, sharing an idea with some Proof of Concept, sharing the implementation of a new design approach etc.
102
+ ```
103
+
104
+ 1. Share a new **P**ull**R**equest including the ADR in the docs/decisions folder, to start the conversation with the related teams/peers.
105
+
106
+ 2. Start the conversation on this first PR until it is “accepted” or “rejected”. Meanwhile, add in this PR (or in another one related somehow to the ADR PR) the proposed changes.
107
+
108
+ 3. Before closing the PR containing the ADR, remember to update it with the correct status and the final decisions taken regarding the comments of the rest of the team.
109
+
110
+ ```text
111
+ ℹ️ These are just suggestion. Please, feel encouraged to set the workflow better fits within your concrete necessities and let’s learn with the process
112
+ ```
113
+
114
+ ### ADR ‘status’ changes
115
+ An ADR can go through these different states:
116
+
117
+ * **🚧 WIP 🚧:** still working on the ADR, not yet released.
118
+ * **💡 Proposed 💡:** already proposed to the team.
119
+ * **🚫 Rejected 🚫:** the team has rejected the ADR, but we save it for traceability.
120
+ * **✅ Accepted ✅:** the team has accepted the ADR.
121
+ * **🕸 Deprecated 🕸:** the ADR has been deprecated (ex: tech stack change, library deprecation etc).
122
+ * **🌱 Superseded by ADR-202x-xx-xx 🌱:** if an ADR supersedes an older ADR then the status of the older ADR is changed to "superseded by ADR-yyyy-mm-dd", and links to the new ADR.
123
+
124
+ #### How do we know when an ADR is accepted/rejected
125
+ There are several mechanisms that will allow us to know whether an ADR is accepted or not.
126
+ As a starting point, there are **two scenarios**:
127
+
128
+ * The **ADR has a due date**: which means that it needs to be resolved by that date at the latest.
129
+ * The **ADR does not have a due date**.
130
+
131
+ Regardless of the starting point, there are a number of mechanisms that will allow us to know whether or not an ADR is accepted by the due date (whether closed or not).
132
+
133
+ ```text
134
+ 📝 Once shared with the team, we will review acceptance ideally on the basis of consensus, although we will accept consent if the lack of feedback/interactions in the team is significant and the change is reversible (1).
135
+ ```
136
+
137
+ #### Artifacts to review:
138
+ * If there is explicit approval ✅ in the PRs, at least, from the owner team (in the PR including the ADR).
139
+ * If there are **opinions against** the ADR, they must be justified in the comments and have **explicit RC** (request changes) **PR reviews ⛔**
140
+ * If there are still unresolved discussions against the ADR idea or, if there are, they have been resolved.
141
+
142
+ ```text
143
+ 📝 Once all the information has been reviewed or if the due date arrives, we will transition the ADR to the appropriate status: accepted or rejected.
144
+ ```
145
+
146
+ ### Suggestions for writing good ADRs
147
+ Characteristics of a good ADR:
148
+ * Rational: Explain the reasons for doing the particular AD. This can include the context (see below), pros and cons of various potential choices, feature comparisons, cost/benefit discussions, and more.
149
+ * Specific: Each ADR should be about one AD, not multiple ADs.
150
+ * Timestamps: Identify when each item in the ADR is written. This is especially important for aspects that may change over time, such as costs, schedules, scaling, and the like.
151
+ * Immutable: Don't alter existing information in an ADR. Instead, amend the ADR by adding new information, or supersede the ADR by creating a new ADR.
152
+
153
+ Characteristics of a good "Context" section in an ADR:
154
+ * Explain your organization's situation and business priorities.
155
+ * Include rationale and considerations based on social and skills makeup of your teams.
156
+ * Include pros and cons that are relevant, and describe them in terms that align with your needs and goals.
157
+
158
+ Characteristics of good "Consequences" section in an ADR:
159
+ * Explain what follows from making the decision. This can include the effects, outcomes, outputs, follow-ups, and more.
160
+ * Include information about any subsequent ADRs. It's relatively common for one ADR to trigger the need for more ADRs, such as when one ADR makes a big overarching choice, which in turn creates the need for smaller decisions.
161
+ * Include any after-action review processes. It's typical for teams to review each ADR one month later, to compare the ADR information with what's happened in actual practice, to learn and grow.
162
+
163
+ A new ADR may take the place of a previous ADR:
164
+ * When an AD is made that replaces or invalidates a previous ADR, then a new ADR should be created.
165
+
166
+ ## Credits
167
+ KUDOS to Joel Parker for sharing all this knowledge with us through [this repo](https://github.com/joelparkerhenderson/architecture-decision-record).
168
+
169
+ ## Links
170
+ [(1) Reversible changes](https://www.businessinsider.com/amazon-jeff-bezos-letter-reversible-decisions-1997-hq2-new-york-2019-2?op=1)
@@ -0,0 +1,4 @@
1
+ # Architectural design records
2
+ The idea is to provide a basic integrated ADR generation for #{your project}
3
+ - You can see an [index of ADRs here](./index.md)
4
+ - You can see the [base template here](./template.md)
@@ -0,0 +1,7 @@
1
+ # Architectural Decision Log
2
+
3
+ This log lists the architectural decisions for [project name].
4
+
5
+ * [ADR-2022-10-25](2022-10-25-use-markdown-architectural-decision-records.md) - Architectural Decision Records as a way for documenting design decisions
6
+
7
+ For new ADRs, please use [template.md](template.md) as basis.
@@ -0,0 +1,102 @@
1
+ ✂✂✂✂✂< REMOVE FROM THIS PART BEFORE SUBMITTING YOUR ADR ✂✂✂✂✂
2
+ # ⚠️ Should this be an ADR?
3
+ Are you in doubt if this document you or your team propose needs to be an Architectural Decision Record?
4
+
5
+ Let's check it through several questions 😊
6
+
7
+ Starting with a `stop question`:
8
+
9
+ * ❓ Is this ADR related to a change in this specific application or service?
10
+ ✋ **If** the answer **is "no"**, which means that this ADR affects this application and others, **end this document here** and start writing a general Decision Record [here](https://sequra.atlassian.net/wiki/spaces/EN/pages/3771039771/Tech+Decision+Records#List-of-Tech-Decision-Records)
11
+ 👇 **If** the previous **answer is a "yes"**
12
+
13
+ Let's **continue** with these other questions:
14
+
15
+ * ❓ Will this ADR provoke a breaking changes or sensible modifications inside this application or services' engine, interfaces, APIs or [seams](https://archive.org/details/working-effectively-with-legacy-code/page/n51/mode/2up) `(look into chapter 4 of this book for the reference)` between domains?
16
+ * ❓ Will this ADR introduce new architectural or software design patterns in the project (f.ex: big refactors which provide that an old feature can work in a new way, introducing a new technology/gem/package/etc ...)
17
+ * ❓ Will this ADR impact other teams’ roadmaps or velocities meaningfully?
18
+ * ❓ Does this ADR imply different approaches/options for which you want/need the opinion of the rest of the team?
19
+ * ❓ Does this ADR modify/impact another existing or very similar ADR (superseeding or refining it)?
20
+
21
+ Then, evaluate your answers:
22
+
23
+ * 👉 If you checked any of those boxes, this topic does need an ADR.
24
+ * 👉 If you didn’t check any of those boxes, doing an ADR is optional.
25
+
26
+ **❗ Depending on your decision, either delete this section or delete this document!**
27
+
28
+ ✂✂✂✂✂< REMOVE FROM THIS PART BEFORE SUBMITTING YOUR ADR ✂✂✂✂✂
29
+
30
+ # [short title of solved problem and solution]
31
+
32
+ ---
33
+ * **Status:** [🚧🌱 wip | 💡 proposed | 🚫 rejected | ✅ accepted | 🕸 deprecated | … | ⬆️🌱 superseded by [ADR-0005](0005-example.md)] <!-- optional -->
34
+ * **Deciders:** [list everyone involved in the decision] <!-- optional -->
35
+ * **Proposal date:** [YYYY-MM-DD when the decision was proposed] <!-- optional -->
36
+ * **Due date:** [YYYY-MM-DD when the decision is finally made] <!-- optional -->
37
+ * **Technical Story:** [description | ticket/issue URL] <!-- optional -->
38
+ ---
39
+ ## Context and Problem Statement
40
+
41
+ [Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.]
42
+
43
+ ## Decision Drivers <!-- optional -->
44
+
45
+ * [driver 1, e.g., a force, facing concern, …]
46
+ * [driver 2, e.g., a force, facing concern, …]
47
+ * … <!-- numbers of drivers can vary -->
48
+
49
+ ## Considered Options
50
+
51
+ * [option 1]
52
+ * [option 2]
53
+ * [option 3]
54
+ * … <!-- numbers of options can vary -->
55
+
56
+ ## Decision Outcome
57
+
58
+ Chosen option: "[option 1]", because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)].
59
+
60
+ ### Positive Consequences <!-- optional -->
61
+
62
+ * [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …]
63
+ * …
64
+
65
+ ### Negative Consequences <!-- optional -->
66
+
67
+ * [e.g., compromising quality attribute, follow-up decisions required, …]
68
+ * …
69
+
70
+ ## Pros and Cons of the Options <!-- optional -->
71
+
72
+ ### [option 1]
73
+
74
+ [example | description | pointer to more information | …] <!-- optional -->
75
+
76
+ * Good, because [argument a]
77
+ * Good, because [argument b]
78
+ * Bad, because [argument c]
79
+ * … <!-- numbers of pros and cons can vary -->
80
+
81
+ ### [option 2]
82
+
83
+ [example | description | pointer to more information | …] <!-- optional -->
84
+
85
+ * Good, because [argument a]
86
+ * Good, because [argument b]
87
+ * Bad, because [argument c]
88
+ * … <!-- numbers of pros and cons can vary -->
89
+
90
+ ### [option 3]
91
+
92
+ [example | description | pointer to more information | …] <!-- optional -->
93
+
94
+ * Good, because [argument a]
95
+ * Good, because [argument b]
96
+ * Bad, because [argument c]
97
+ * … <!-- numbers of pros and cons can vary -->
98
+
99
+ ## Links <!-- optional -->
100
+
101
+ * [Link type] [Link to ADR] <!-- example: Refined by [ADR-0005](0005-example.md) -->
102
+ * … <!-- numbers of links can vary -->
@@ -0,0 +1,5 @@
1
+ module Sequra
2
+ module Style
3
+ VERSION = "0.2.0"
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ require "sequra/style/version"
2
+
3
+ module Sequra
4
+ module Style
5
+ # Just a namespace...
6
+ end
7
+ end
@@ -0,0 +1,31 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "sequra/style/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "sequra-style"
7
+ spec.version = Sequra::Style::VERSION
8
+ spec.authors = ["Sequra engineering"]
9
+ spec.email = ["rubygems@sequra.es"]
10
+
11
+ spec.summary = "Sequra code style guides and shared config"
12
+ spec.homepage = "https://github.com/sequra/sequra-style"
13
+ spec.license = "MIT"
14
+
15
+ # Specify which files should be added to the gem when it is released.
16
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
18
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_dependency "rubocop", "~> 1"
25
+ spec.add_dependency "rubocop-performance", "~> 1"
26
+ spec.add_dependency "rubocop-rails", "~> 2"
27
+ spec.add_dependency "rubocop-rspec", "~> 2"
28
+
29
+ spec.add_development_dependency "bundler", "~> 2.1.4"
30
+ spec.add_development_dependency "rake", "~> 13.0.1"
31
+ end
metadata ADDED
@@ -0,0 +1,149 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sequra-style
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Sequra engineering
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-03-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-performance
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.1.4
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.1.4
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 13.0.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 13.0.1
97
+ description:
98
+ email:
99
+ - rubygems@sequra.es
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".github/CODEOWNERS"
105
+ - ".github/PULL_REQUEST_TEMPLATE.md"
106
+ - ".github/workflows/pr_title_validation.yml"
107
+ - ".github/workflows/release.yml"
108
+ - ".gitignore"
109
+ - ".rubocop.yml"
110
+ - CHANGELOG.md
111
+ - Gemfile
112
+ - Gemfile.lock
113
+ - LICENSE
114
+ - README.md
115
+ - Rakefile
116
+ - bin/console
117
+ - bin/setup
118
+ - default.yml
119
+ - docs/decisions/2022-10-25-use-markdown-architectural-decision-records.md
120
+ - docs/decisions/README.md
121
+ - docs/decisions/index.md
122
+ - docs/decisions/template.md
123
+ - lib/sequra/style.rb
124
+ - lib/sequra/style/version.rb
125
+ - sequra-style.gemspec
126
+ homepage: https://github.com/sequra/sequra-style
127
+ licenses:
128
+ - MIT
129
+ metadata: {}
130
+ post_install_message:
131
+ rdoc_options: []
132
+ require_paths:
133
+ - lib
134
+ required_ruby_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ required_rubygems_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ requirements: []
145
+ rubygems_version: 3.4.19
146
+ signing_key:
147
+ specification_version: 4
148
+ summary: Sequra code style guides and shared config
149
+ test_files: []