-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
570 lines (534 loc) · 20.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Feature Management | Kelina Shrestha</title>
<link rel="icon" href='./assets/keli_favicon.jpg' type="image/jpg">
<!-- Required meta tags -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description"
content="Feature Management | Feature Flags | Delivering Product Features With Safeguards | Kelina Shrestha | #RED Ruby on Rails Engineer">
<!-- Google / Search Engine Tags -->
<meta itemprop="name" content="Feature Management | Kelina Shrestha">
<meta itemprop="description"
content="Feature Management | Feature Flags | Delivering Product Features With Safeguards | Kelina Shrestha | #RED Ruby on Rails Engineer">
<meta itemprop="image" content="https://kelishrestha.github.io/feature_flag_presentation/assets/kelina.jpg">
<meta name="google" content="notranslate">
<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Feature Management | Kelina Shrestha">
<meta name="twitter:description"
content="Feature Management | Feature Flags | Delivering Product Features With Safeguards | Kelina Shrestha | #RED Ruby on Rails Engineer">
<meta name="twitter:image" content="https://kelishrestha.github.io/feature_flag_presentation/assets/kelina.jpg">
<!-- Facebook Meta Tags -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://kelishrestha.github.io/feature_flag_presentation/">
<meta property="og:title" content="Feature Management | Kelina Shrestha">
<meta property="og:description"
content="Feature Management | Feature Flags | Delivering Product Features With Safeguards | Kelina Shrestha | #RED Ruby on Rails Engineer">
<meta property="og:image" content="https://kelishrestha.github.io/feature_flag_presentation/assets/kelina.jpg" />
<meta property="og:image:secure_url" content="https://kelishrestha.github.io/feature_flag_presentation/assets/kelina.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<!-- Facebook Meta Tags -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://kelishrestha.github.io/feature_flag_presentation/">
<meta property="og:title" content="Feature Management | Kelina Shrestha">
<meta property="og:description"
content="Feature Management | Feature Flags | Delivering Product Features With Safeguards | Kelina Shrestha | #RED Ruby on Rails Engineer">
<meta property="og:image" content="https://kelishrestha.github.io/feature_flag_presentation/assets/kelina.jpg" />
<link rel="stylesheet" href="dist/reset.css">
<link rel="stylesheet" href="dist/reveal.css">
<link rel="stylesheet" href="dist/theme/sky.css" id="theme">
<!-- Theme used for syntax highlighted code -->
<link rel="stylesheet" href="plugin/highlight/monokai.css" id="highlight-theme">
<!-- Font awesome -->
<link rel="stylesheet" href="dist/all.min.css">
<style>
.heading-text {
text-transform: capitalize !important;
letter-spacing: 1px !important;
}
.letter-spacing {
letter-spacing: 1px !important;
}
.d-none {
display: none !important;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<!-- Slide Start -->
<section data-markdown>
<script type="text/template">
<h2 class="r-fit-text letter-spacing">Feature Management</h2>
<h3 class="r-fit-text heading-text">Delivering product features with safeguards</h3>
<div style="padding-top: 30px;">
<small>Presented By</small><br>
<small>
<div style="font-size: 30px;">
Kelina Shrestha
</div>
<div style="font-size: 20px;margin-top: 10px;">
Ruby on Rails Engineer
</div>
</small>
</div>
</script>
</section>
<!-- Slide Ends -->
<!-- Slide Start -->
<section>
<h2 class="heading-text">Introduction</h2>
<p>
<audio src="./assets/FM-Introduction-01.mp3" controls></audio>
</p>
</section>
<!-- Slide Ends -->
<!-- Slide Start -->
<section>
<section>
<h2 class="heading-text">
Problem Statement
</h2>
<ul>
<li class="fragment">
Multiple services dependent of each other.
</li>
<li class="fragment">
New feature available only for specific clients.
</li>
<li class="fragment">
Deployment strategy
</li>
</ul>
<p>
<audio src="./assets/FM-Problem-Statement-021.mp3" controls></audio>
</p>
</section>
<section>
How do we manage and deploy features without affecting the existing system?
<p>
<audio src="./assets/FM-Problem-Statement-022.mp3" controls></audio>
</p>
</section>
</section>
<!-- Slide Ends -->
<!-- Slide Start -->
<section>
<section>
<h2 class="heading-text">Feature Flag</h2>
<ul>
<li class="fragment">
Feature flag is a decision point in your code that can change the behavior of your application.
</li>
<li class="fragment">
Also known as feature toggles—have long been used to trigger “hidden” code or behaviors without having to
ship new versions of your software.
</li>
</ul>
<p>
<audio src="./assets/FM-Feature-Flag-031.mp3" controls></audio>
</p>
</section>
<section>
<h4 class="heading-text">Example</h4>
<span data-markdown>
<textarea data-template>
```ruby [1-2|3-5]
if feature_enabled?('feature_name')
# show feature
else
# hide feature
end
```
</textarea>
</span>
<p>
<audio src="./assets/FM-Feature-Flag-032.mp3" controls></audio>
</p>
</section>
</section>
<!-- Slide Ends -->
<!-- Slide Start -->
<section>
<section>
<h2 class="r-fit-text heading-text">do we need Feature Flag?</h2>
<p>
<audio src="./assets/FM-Need-Feature-Flag-041.mp3" controls></audio>
</p>
</section>
<section>
<h2 class="r-fit-text heading-text">do we need Feature Flag?</h2>
<ul>
<li class="fragment">
Enables businesses to dynamically control the availability of application features to end users.
</li>
<li class="fragment">
Developing major features in chunks without execution.
</li>
<li class="fragment">
Cutting development cost and high development responsibility within or outside of application.
</li>
</ul>
<p>
<audio src="./assets/FM-Need-Feature-Flag-042.mp3" controls></audio>
</p>
</section>
<section>
<h2 class="r-fit-text heading-text">do we need Feature Flag?</h2>
<ul>
<li class="fragment">
Deploying and testing application empowering features with application control rather than environment
control.
</li>
<li class="fragment">
Easy plug in and play features which are visible to end users and easily configurable by various teams
- development and operations engineers to product and marketing managers.
</li>
</ul>
<p>
<audio src="./assets/FM-Need-Feature-Flag-043.mp3" controls></audio>
</p>
</section>
</section>
<!-- Slide Ends -->
<!-- Slide Start -->
<section>
<section>
<h2 class="r-fit-text heading-text">Server Side Implementation</h2>
<p>
<audio src="./assets/FM-Server-Side-Implementation-051.mp3" controls></audio>
</p>
</section>
<section>
<h5 class="heading-text">Using Environment Variable</h5>
<span data-markdown>
<textarea data-template>
```ruby [1-2|4-7|9-14]
# Environment variable
service_app_token: 'some_api_token'
# Definition
def feature_enabled?
ENV['service_app_token'].present?
end
# Method call
if feature_enabled?
# show feature
else
# hide feature
end
```
</textarea>
</span>
<p>
<audio src="./assets/FM-Server-Side-Environment-variables-052.mp3" controls></audio>
</p>
</section>
<section>
<h5 class="heading-text">Using YAML/JSON Files</h5>
<span data-markdown>
<textarea data-template>
```ruby [1-2|4-8|10-15]
# Static Files - YAML
feature_flag_name: true # true/false
# Definition
def feature_enabled?
feature_flags = YAML.load(File.read("feature_flags.yml"))
feature_flags['feature_flag_name']
end
# Method call
if feature_enabled?
# show feature
else
# hide feature
end
```
</textarea>
</span>
<p>
<audio src="./assets/FM-Server-side-yaml-053.mp3" controls></audio>
</p>
</section>
<section>
<h5 class="heading-text">Using Database</h5>
<span data-markdown>
<textarea data-template>
```ruby [1-4|6-9|11-16]
# Database Config
# table: feature_flags
name: 'feature_flag_name'
value: true # true/false
# Definition
def feature_enabled?(feature_name)
FeatureFlag.find_by(name: feature_name)&.value
end
# Method call
if feature_enabled?
# show feature
else
# hide feature
end
```
</textarea>
</span>
<p>
<audio src="./assets/FM-Server-side-database-054.mp3" controls></audio>
</p>
</section>
<section>
<h2 class="r-fit-text heading-text">client side Implementation</h2>
<p>
<audio src="./assets/FM-Client-side-implementation-01.mp3" controls></audio>
</p>
</section>
<section>
<h5 class="heading-text">Client Side</h5>
<span data-markdown>
<textarea data-template>
```ruby [1-2|4-6|8-13|14-18|19-23|25-31|33-39]
# Get configs from API
ApiRequester.call(http_verb, url, headers, body)
# Example
headers = { 'Content-Type' => 'application/json', 'X-API-TOKEN' => ENV['X-API-TOKEN'] }
@feature_flags = ApiRequester.call('get', 'https://api.com/api/v1/app_configs', headers, {})
# Feature Flag format
@feature_flags = [{
id: 'primary_key',
name: 'feature_flag_1_name',
value: true
},
{
id: 'primary_key',
name: 'feature_flag_2_name',
value: false
},
{
id: 'primary_key',
name: 'feature_flag_3_name',
value: true
}]
# Definition
def feature_enabled?(feature_name)
# retrieves true/false value of feature flag
flag = @feature_flags.detect{ |flag| flag[:name] == feature_name }
# Application needs decide the default value
flag.present? ? flag[:value] : false
end
# Method call
if feature_enabled?
# show feature
else
# hide feature
end
```
</textarea>
</span>
<p>
<audio src="./assets/FM-Client-side-062.mp3" controls></audio>
</p>
</section>
</section>
<!-- Slide Ends -->
<!-- Slide Start -->
<section>
<section>
<h2 class="r-fit-text heading-text">Our Previous Attempts</h2>
<ul>
<li class="fragment">
Environment variables
</li>
<li class="fragment">
Application level configuration
</li>
</ul>
<p>
<audio src="./assets/FM-Previous-Attempts-071.mp3" controls></audio>
</p>
</section>
<section>
<h4 class="heading-text">Our Previous Attempts - Example</h4>
<span data-markdown>
<textarea data-template>
```ruby [4-8|12-16]
# poll.rb
def start!
if FeatureFlagHelper.feature_enabled?('poll_timer')
if disable_start?
return errors.add(:base, 'You cannot start this poll as a count down is already running in the meeting')
end
end
update(status: LaunchStatus.to_i)
if FeatureFlagHelper.feature_enabled?('poll_timer')
if timer_duration.present?
SessionTimer.new(meeting, params[:type]).update(params)
end
end
true
end
```
</textarea>
</span>
<p>
<audio src="./assets/FM-Previous-Attempts-072.mp3" controls></audio>
</p>
</section>
<section class="heading-text">
extended version
<p>
<audio src="./assets/FM-Extended-Version-081.mp3" controls></audio>
</p>
</section>
<section>
<section class="heading-text">extended version</section>
<span data-markdown>
<textarea data-template>
```ruby [1-5|7-11|13-18]
# Database Config
# table: feature_flags
name: 'feature_flag_name'
value: true # true/false
scopes: ['all_users', 'alpha_users', 'beta_users']
# Definition
def feature_enabled?(feature_name, scopes)
flag = FeatureFlag.find_by(name: feature_name)
flag.scopes.include?(scopes) && flag.value
end
# Method call
if feature_enabled?
# show feature
else
# hide feature
end
```
</textarea>
</span>
<p>
<audio src="./assets/FM-Extended-Version-082.mp3" controls></audio>
</p>
</section>
</section>
<!-- Slide Ends -->
<!-- Slide Start -->
<section>
<section>
<h2 class="heading-text">do's and don'ts</h2>
<p>
<audio src="./assets/FM-Do-and-donts-091.mp3" controls></audio>
</p>
</section>
<section>
<h2 class="letter-spacing">Don't</h2>
<ul>
<li class="fragment">
Temporary flags which can't be removed quickly.
</li>
<li class="fragment">
Stale Flags and dead codes.
</li>
<li class="fragment">
No journal on feature flags.
</li>
</ul>
<p>
<audio src="./assets/FM-Do-and-dont-092.mp3" controls></audio>
</p>
</section>
<section>
<h2 class="letter-spacing">Do</h2>
<ul>
<li class="fragment">
Appoint a maintainer for the flag.
</li>
<li class="fragment">
Set Expiry Dates for flags at the time of creation.
</li>
<li class="fragment">
Create a branch and PR to remove the flag at the same time when the flag is introduced.
</li>
</ul>
<p>
<audio src="./assets/FM-Do-and-dont-093.mp3" controls></audio>
</p>
</section>
<section>
<h2 class="letter-spacing">Do</h2>
<ul>
<li class="fragment">
Follow Naming Convention for feature flag names and commits for references.
</li>
<li class="fragment">
Permissions and Role-based Access controls
</li>
<li class="fragment">
Timely update flags documentation.
</li>
<li class="fragment">
Organize flags
</li>
</ul>
<p>
<audio src="./assets/FM-Do-and-dont-094.mp3" controls></audio>
</p>
</section>
</section>
<!-- Slide Ends -->
<!-- Slide Start -->
<section>
<p>Ping me if you have questions or concerns ! !</p>
<p style="font-size: 16px;">
Send me an email @
<a href="mailto: kelina@kudoway.com">kelina@kudoway.com</a>
<br>
<div style="padding-top: 25px;">
<br>
<a href="https://github.com/kelishrestha"><i class="fab fa-github-square" style="color: #14171A;"></i></a>
<a href="https://twitter.com/kelishrestha"><i class="fab fa-twitter-square" style="color: #1DA1F2;"></i></a>
<a href="https://kelishrestha.medium.com/"><i class="fab fa-medium" style="color: #14171A;"></i></a>
</div>
<div style="font-size: 16px;padding-top: 25px;">
<p>Read Medium Story for Feature Management.</p>
<a href="https://kelishrestha.medium.com/feature-management-part-i-760e4c62bc25">Feature Management — Part I</a>
<br>
<a href="https://kelishrestha.medium.com/feature-management-part-ii-826d432085b6">Feature Management — Part II</a>
</div>
</p>
<p>
<audio src="./assets/FM-Closure-10.mp3" controls></audio>
</p>
</section>
<!-- Slide Ends -->
</div>
</div>
<script src="dist/reveal.js"></script>
<script src="dist/all.min.js"></script>
<script src="plugin/notes/notes.js"></script>
<script src="plugin/markdown/markdown.js"></script>
<script src="plugin/highlight/highlight.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,
// Learn about plugins: https://revealjs.com/plugins/
plugins: [RevealMarkdown, RevealHighlight, RevealNotes],
// Parallax background image
parallaxBackgroundImage: 'https://images.unsplash.com/photo-1611605645802-c21be743c321?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=3450&q=80', // e.g. "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg"
// Parallax background size
parallaxBackgroundSize: '', // CSS syntax, e.g. "2100px 900px" - currently only pixels are supported (don't use % or auto)
// Number of pixels to move the parallax background per slide
// - Calculated automatically unless specified
// - Set to 0 to disable movement along an axis
parallaxBackgroundHorizontal: 200,
parallaxBackgroundVertical: 50,
autoAnimateEasing: 'ease-in-out',
autoAnimateDuration: 1,
autoAnimateUnmatched: false
});
</script>
</body>
</html>