Skip to content

Commit

Permalink
fix(guides): reduce indentation in copyable examples
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Dec 13, 2023
1 parent 2d5c328 commit 34e2bd9
Showing 1 changed file with 63 additions and 63 deletions.
126 changes: 63 additions & 63 deletions guides/get-going-with-gitops.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ This flag will be a _boolean_ type flag and be in a disabled (`enabled = false`)
version: "1.2"
namespace: default
flags:
- key: use-quicksort-algorithm
name: Use Quicksort Algorithm
type: BOOLEAN_FLAG_TYPE
enabled: false
- key: use-quicksort-algorithm
name: Use Quicksort Algorithm
type: BOOLEAN_FLAG_TYPE
enabled: false
```
### Running Flipt Locally
Expand Down Expand Up @@ -324,23 +324,23 @@ We open the `features.yml` file and update the definition with a new segment and
version: "1.2"
namespace: default
flags:
- key: use-quicksort-algorithm
name: Use Quicksort Algorithm
type: BOOLEAN_FLAG_TYPE
enabled: false
rollouts:
- segment:
key: internal-users
value: true
- key: use-quicksort-algorithm
name: Use Quicksort Algorithm
type: BOOLEAN_FLAG_TYPE
enabled: false
rollouts:
- segment:
key: internal-users
value: true
segments:
- key: internal-users
name: Internal Users
match_type: ANY_MATCH_TYPE
constraints:
- property: organization
operator: eq
value: internal
type: STRING_COMPARISON_TYPE
- key: internal-users
name: Internal Users
match_type: ANY_MATCH_TYPE
constraints:
- property: organization
operator: eq
value: internal
type: STRING_COMPARISON_TYPE
```
</CodeGroup>
Expand All @@ -352,14 +352,14 @@ Breaking this change down we've got:
```yaml features.yml
# ...
segments:
- key: internal-users
name: Internal Users
match_type: ANY_MATCH_TYPE
constraints:
- property: organization
operator: eq
value: internal
type: STRING_COMPARISON_TYPE
- key: internal-users
name: Internal Users
match_type: ANY_MATCH_TYPE
constraints:
- property: organization
operator: eq
value: internal
type: STRING_COMPARISON_TYPE
```

This [segment](/concepts#segments) definition matches any evaluation request where there exists a key `organization` on the context, with a value `internal`.
Expand All @@ -372,12 +372,12 @@ Now, when the user happens to be associated with the `internal` organization, it

```yaml features.yml
flags:
- key: use-quicksort-algorithm
# ...
rollouts:
- segment:
key: internal-users
value: true
- key: use-quicksort-algorithm
# ...
rollouts:
- segment:
key: internal-users
value: true
```

Finally, we add a [rollout rule](/concepts#rollouts) to our boolean flag.
Expand Down Expand Up @@ -474,26 +474,26 @@ Then we're going to edit `features.yml` and add a threshold percentage rule.
version: "1.2"
namespace: default
flags:
- key: use-quicksort-algorithm
name: Use Quicksort Algorithm
type: BOOLEAN_FLAG_TYPE
enabled: false
rollouts:
- segment:
key: internal-users
value: true
- threshold:
percentage: 20
value: true
- key: use-quicksort-algorithm
name: Use Quicksort Algorithm
type: BOOLEAN_FLAG_TYPE
enabled: false
rollouts:
- segment:
key: internal-users
value: true
- threshold:
percentage: 20
value: true
segments:
- key: internal-users
name: Internal Users
match_type: ANY_MATCH_TYPE
constraints:
- property: organization
operator: eq
value: internal
type: STRING_COMPARISON_TYPE
- key: internal-users
name: Internal Users
match_type: ANY_MATCH_TYPE
constraints:
- property: organization
operator: eq
value: internal
type: STRING_COMPARISON_TYPE
```

</CodeGroup>
Expand All @@ -514,12 +514,12 @@ If no rules match, then the flags top-level `enabled` property is used as the fi
flags:
- key: use-quicksort-algorithm
# ...
- segment:
key: internal-users
value: true
- threshold:
percentage: 20
value: true
- segment:
key: internal-users
value: true
- threshold:
percentage: 20
value: true
```

This threshold percentage is set to `20`, meaning roughly `20%` of entity IDs will match and cause the flag to return `enabled = true`.
Expand Down Expand Up @@ -553,10 +553,10 @@ Once we get to the stage of enabling the flag for 100% of users, we can either s
version: "1.2"
namespace: default
flags:
- key: use-quicksort-algorithm
name: Use Quicksort Algorithm
type: BOOLEAN_FLAG_TYPE
enabled: true
- key: use-quicksort-algorithm
name: Use Quicksort Algorithm
type: BOOLEAN_FLAG_TYPE
enabled: true
```

Beyond this, we can further close the loop by removing the feature flag call from our application code and simply use the new `quicksort` function.
Expand Down

0 comments on commit 34e2bd9

Please sign in to comment.