Skip to content

Commit

Permalink
Remove Font Awesome and Replace with Iconify (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdmaclean authored Jan 3, 2024
1 parent 4eada75 commit fbc8e0c
Show file tree
Hide file tree
Showing 71 changed files with 1,392 additions and 1,295 deletions.
15 changes: 7 additions & 8 deletions docs/best-practices/continuous-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Continuous Integration & Continuous Deployment
sidebar_label: CI/CD
sidebar_position: 7
description: Feature flag guidelines that optimize continuous integration and deployment
sidebar_custom_props: {icon: infinity}
sidebar_custom_props: { icon: carbon:continuous-deployment }
---

# Adopting Feature Flags for CI/CD
Expand Down Expand Up @@ -43,17 +43,16 @@ Sometimes adding a feature flag results in a failed integration test. This could
Consider the `Use Server Storage` example we described earlier. Let’s say we have updated our Targeting Rules to enable `Use Server Storage` for internal users with an email domain of `@devcycle.com`. The `Use Server Storage` feature has been implemented in a React app as follows:

```jsx
const useServerStorage = useVariable('use-server-storage', false);
const useServerStorage = useVariable('use-server-storage', false)

if (useServerStorage) {
retrieveDataFromServer() // function for using server storage
}
else {
retrieveDataFromLocal() // function for using local storage
retrieveDataFromServer() // function for using server storage
} else {
retrieveDataFromLocal() // function for using local storage
}
```

Now consider a test that expects to find `retrieveDataFromServer()` to have been called once. If the test does not receive the email domain `@devcycle.com` to send to the SDK, it will result in the fallback value of `false`, meaning that `retrieveDataFromServer()` would not be called, failing the test.
Now consider a test that expects to find `retrieveDataFromServer()` to have been called once. If the test does not receive the email domain `@devcycle.com` to send to the SDK, it will result in the fallback value of `false`, meaning that `retrieveDataFromServer()` would not be called, failing the test.

To fix the test, make sure to identify a user with the proper email, such as `[email protected]`. Similarly, if you have a feature that uses custom properties for targeting, make sure to pass in the corresponding properties when you identify the user. Providing user data within the tests ensures that the SDK receives the correct feature and variable information based on the targeting rules, even when the tests are run automatically through CircleCI.

Expand All @@ -63,4 +62,4 @@ In this guide, we covered the following topics:

- creating a feature flag before coding the feature to optimize feature flag usage
- using Targeting Rules to protect other users during integration and automated delivery
- passing user data to conduct effective integration tests
- passing user data to conduct effective integration tests
16 changes: 9 additions & 7 deletions docs/best-practices/datadog-rum.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Observability
sidebar_label: Observability
sidebar_position: 10
description: Observability Best Practices Using DevCycle with Datadog's RUM Feature Flag Tracking
sidebar_custom_props: {icon: microscope}
sidebar_custom_props: { icon: simple-icons:datadog }
---

# Observability Best Practices Using DevCycle with Datadog's RUM Feature Flag Tracking
Expand Down Expand Up @@ -32,12 +32,12 @@ Next, call DatadogRum.addFeatureFlagEvaluation(key, value) whenever a variable i

### 2. JavaScript Integration

To track all variable evaluations, initialize the DevCycle client with your SDK key and user information. Then, subscribe to the variableEvaluated:* event and use the DatadogRum.addFeatureFlagEvaluation(key, variable.value) function within the callback:
To track all variable evaluations, initialize the DevCycle client with your SDK key and user information. Then, subscribe to the variableEvaluated:\* event and use the DatadogRum.addFeatureFlagEvaluation(key, variable.value) function within the callback:

```javascript
const user = { user_id: "my_user" };
const dvcOptions = { logLevel: "debug" };
const devcycleClient = initialize("<DVC_CLIENT_SDK_KEY>", user, dvcOptions);
const devcycleClient = initialize("<DVC_CLIENT_SDK_KEY>", user, dvcOptions);
...
devcycleClient.subscribe(
"variableEvaluted:*",
Expand All @@ -46,18 +46,20 @@ devcycleClient.subscribe(
}
)
```

To track a specific variable evaluation, subscribe to the variableEvaluated:my-variable-key event:

```javascript
devcycleClient.subscribe(
"variableEvaluted:my-variable-key",
'variableEvaluted:my-variable-key',
(key: string, variable: DVCVariable<DVCVariableValue>) => {
datadogRum.addFeatureFlagEvaluation(key, variable.value);
}
datadogRum.addFeatureFlagEvaluation(key, variable.value)
},
)
```

### 3. React Integration

For React, we recommend encapsulating your RUM code within a React hook. Consider the following example:

```javascript
Expand Down Expand Up @@ -86,7 +88,7 @@ export const useDatadogRum = () => {
}
}, [devcycleClient])
}

export default useDatadogRum;
```

Expand Down
4 changes: 2 additions & 2 deletions docs/best-practices/edgedb-and-edge-flags/_category_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ label: 'Edge Flags'
position: 3
collapsed: true
customProps:
icon: cloud
description: How to insert data into DevCycle’s EdgeDB and then use it for targeting.
icon: eos-icons:edge-computing
description: How to insert data into DevCycle’s EdgeDB and then use it for targeting.
22 changes: 11 additions & 11 deletions docs/best-practices/effectively-organizing-feature-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Keeping Track of Feature Flags
sidebar_label: Organization
sidebar_position: 5
description: Tips for keeping your Feature Flag workspace organized in DevCycle
sidebar_custom_props: {icon: box-archive}
sidebar_custom_props: { icon: material-symbols:archive }
---

This guide provides tips for keeping your Feature Flag workspace organized in DevCycle. The article covers general methods for organizing Feature Flags, such as creating specific names and detailed descriptions. It also provides insight on how to maximize DevCycle’s tools like Variables, Jira linking, and Code References to manage large amounts of feature flags.
Expand All @@ -17,7 +17,7 @@ In DevCycle, Features have two types of identifiers:
- **Name** — the display name on the Feature Management Dashboard
- **Key** — used to reference the Feature in code (DevCycle automatically suggests keys based on the entered name)

You specify these identifiers whenever you create a Feature.
You specify these identifiers whenever you create a Feature.

### Naming Conventions

Expand Down Expand Up @@ -50,9 +50,9 @@ As developers get in the groove of developing with Feature Flags, more and more

Fortunately, DevCycle has a solution: a distinction between features and flags. DevCycle sees flags as *parts* of a feature. While they may work independently, they are not stand-alone in that they toggle different aspects of the same feature and must be grouped accordingly. This distinction allows for Feature Flag Grouping using Variables. In DevCycle, Variables are like flags associated with a general Feature. They have values that can be toggled like a flag. In this way, you can see Features as flag groupings and Variables as the flags themselves. Developers can then create Variables that are grouped into Features.

Let’s return to our Premium Users button example. Before we create a flag, we must consider what overarching Feature our flag will be a part of. For instance, we can create a Feature named `Premium Users Navigation`. All the flags pertaining to Premium Users from the Navigation will fall under this feature. Within `Premium Users Navigation`, you can add a boolean variable with the key `enable-premium-users-button` to toggle the button’s visibility.
Let’s return to our Premium Users button example. Before we create a flag, we must consider what overarching Feature our flag will be a part of. For instance, we can create a Feature named `Premium Users Navigation`. All the flags pertaining to Premium Users from the Navigation will fall under this feature. Within `Premium Users Navigation`, you can add a boolean variable with the key `enable-premium-users-button` to toggle the button’s visibility.

It is important to note that while our variable key was specific to the button, we created a **general name for the feature it was housed in**—we named our feature `Premium Users Navigation` rather than `Premium Users Navigation Button`. Having a slightly more general name leaves room for other variables related to this feature. So if we would like to create a new page for premium users, a flag to gate this page would also fit within the `Premium Users Navigation` feature.
It is important to note that while our variable key was specific to the button, we created a **general name for the feature it was housed in**—we named our feature `Premium Users Navigation` rather than `Premium Users Navigation Button`. Having a slightly more general name leaves room for other variables related to this feature. So if we would like to create a new page for premium users, a flag to gate this page would also fit within the `Premium Users Navigation` feature.

Allowing a feature to have multiple variables eliminates the technical debt of having several uncategorized flags. When you want to create a new flag, ask yourself whether it would be appropriate to create a new feature or add a variable to an existing feature instead. Organizing by feature allows you and other developers to locate variables effortlessly based on their associated features.

Expand All @@ -62,27 +62,27 @@ To explore Feature Grouping in greater detail, check out our best practice guide

Another way to keep your workspace organized is to utilize DevCycle for Jira. Development teams often use several different tools to track workflow. When tools for project management, code repositories, and feature management are all isolated from one another, it can be cumbersome to distinguish a feature’s exact status in the development lifecycle.

To combat the juggling of siloed information, DevCycle for Jira links tickets directly to your features. This allows you to view your feature’s status within Jira.
To combat the juggling of siloed information, DevCycle for Jira links tickets directly to your features. This allows you to view your feature’s status within Jira.

To start connecting Jira Ticket IDs to DevCycle features, you must install the app from the [Jira Marketplace Listing](https://marketplace.atlassian.com/apps/1227643/devcycle-feature-flag-management-for-jira). We recommend reading [DevCycle Feature Flag Management for Jira](/integrations/jira/jira-setup) for a setup guide.

Once you have configured a Jira project with a DevCycle project, you can connect a feature to a Jira Issue from the feature’s settings. Simply enter the IDs of the ticket(s) you’d like to associate with the feature.

![jira settings](/feb-2022-jira-settings.png)

Simply enter the IDs of the ticket(s) you’d like to associate with the feature.
Simply enter the IDs of the ticket(s) you’d like to associate with the feature.

![image](/feb-2022-jira-ids-entered.png)

Once it is saved, you will be able to view your feature’s status from Jira at any time. In Jira, navigate to the ticket you have connected and view the “Releases” section.
Once it is saved, you will be able to view your feature’s status from Jira at any time. In Jira, navigate to the ticket you have connected and view the “Releases” section.

![jira sidebar](/feb-2022-within-jira.png)

Clicking this will display all the feature status information across all environments:

![jira sidebar](/feb-2022-jira-example.png)

A common use for DevCycle’s Jira linking is to connect a feature in DevCycle to a Jira epic. This allows each team, whether dev or product, to easily determine the status of an epic. Product managers and developers alike will no longer have to dig through features in DevCycle; feature statuses can all be monitored directly in Jira.
A common use for DevCycle’s Jira linking is to connect a feature in DevCycle to a Jira epic. This allows each team, whether dev or product, to easily determine the status of an epic. Product managers and developers alike will no longer have to dig through features in DevCycle; feature statuses can all be monitored directly in Jira.

Another helpful way to view Jira linking is to consider feature variables responsible for a story within your epic. Making variable-story relationships can help you create appropriate variables for your features and define their purposes better.

Expand All @@ -94,19 +94,19 @@ Code References are another helpful tool to foster an organized workflow. DevCyc

![march-2022-code-refs](/march-2022-code-refs.png)

Each Code Reference also includes a link to the exact location of the referenced variable in your codebase, making it much easier to track variables. You can use code references to determine whether or not variables are being used in your code, or if they have fulfilled their lifecycle and are ready for removal. As a result, Code References are especially useful for cleaning up your code.
Each Code Reference also includes a link to the exact location of the referenced variable in your codebase, making it much easier to track variables. You can use code references to determine whether or not variables are being used in your code, or if they have fulfilled their lifecycle and are ready for removal. As a result, Code References are especially useful for cleaning up your code.

For more information about tracking variable usage and when to clean up flags, read [Technical Debt - Cleaning up your unused flags](/best-practices/feature-flag-cleanup).

To use Code References, you must create a new Actions workflow in your GitHub repository in the .github/workflows directory. Follow our documentation [Action: Feature Flag Code Usages](/integrations/github/feature-usage-action) for steps to using the GitHub action. Once it is configured, you can find your Code References in the Variable Dashboard by clicking “View Info” on the desired variable.

## Summary

In this guide, we explained how to organize your workflow by
In this guide, we explained how to organize your workflow by

- properly naming and describing the behaviour of your feature flags
- creating multiple variables within a feature for flag grouping
- linking your features to Jira tickets
- using Code References to understand variable locations

Applying the recommendations in this guide will help you manage large amounts of feature flags and maximize the organization of your team.
Applying the recommendations in this guide will help you manage large amounts of feature flags and maximize the organization of your team.
Loading

1 comment on commit fbc8e0c

@vercel
Copy link

@vercel vercel bot commented on fbc8e0c Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.