Coder Social home page Coder Social logo

launchdarkly-docs's Introduction

LaunchDarkly

LaunchDarkly's Docs

The LaunchDarkly docs service level agreement

All PRs to the LaunchDarkly-Docs repo will be addressed within five business days, often sooner. "Addressed" does not necessarily mean "merged" or "accepted." It means that a member of the LaunchDarkly docs team will acknowledge your PR within that timeframe.

In practical terms, we will likely merge your PR within five business days of submission.

Planning your docs contribution

Some larger PRs require back-and-forth iteration before they're ready to get published. If you're a partner or other party planning a large docs contribution to coincide with a feature release, buffer your time to accommodate for some discussion or review before your docs go live.

If you have a docs concern or contribution that you need addressed urgently, email [email protected].

We'll do our best to merge your PR as soon as we can, but we're a small team serving a large community. Thank you in advance for your patience.

(Internal LaunchDarkly only) First-draft docs submission process

Follow this process:

  1. File a ticket in the Documentation Shortcut project. Summarize the changes you need in the ticket body. You can assign it to your squad or the epic related to your feature, but make sure it’s in the Documentation project!

  2. Schedule a kickoff meeting with @Sarah Day (or invite her to the feature kickoff meeting). You can add other writers if you need to as well.

  3. Two weeks before your feature launches, PR your docs updates into ld-docs-private. The squad-docs alias get added automatically, but you should also add other technical or product reviewers if you need.

  4. Now the docs team gets your docs ready to ship! Expect to go back and forth with them in revisions once or twice before everyone agrees the docs are ready.

Learn more in Confluence.

Resources for contributors

You can make your contribution to the docs more likely to be accepted early by following our style guide and using our custom components.

If you want to write a good PR, here are some resources to get you started:

🚴 Running the docs site locally

Our site runs with Gatsby, NPM, and Yarn. To run the site on your local machine, you may have to install some packages and dependencies.

Here's how to start:

  1. Clone the repo locally.
  2. Navigate to it in your terminal.
  3. Run the following command:
yarn && yarn start

As a shortcut:

yarn dev

The site will build. Monitor the progress in your terminal, and when the build completes, navigate to localhost:8000.

You can also run in a fast development mode which omits all mdx images and most mdx content except for /home/getting-started, /home/flags and /home/contexts :

yarn && yarn dev-fast

This cuts the gatsby build time to just < 7 seconds as opposed to > 1 minute.

To run tests, read Running tests.

πŸ‘₯ Adding new topics and editing existing topics from within the repo

The easiest way to modify an existing topic is by opening a PR against it directly from the docs site by clicking the "Edit in GitHub" button on the topic page.

If you want to add a new topic from a local build, the src/content/topics folder contains all the docs markdown. You can also find an existing topic and modify it from here.

Need more help? The contributor's guide goes into a lot more detail about the structure and architecture of the repo.

πŸ”₯ Troubleshooting the build

If you encounter what looks like a Gatsby cache issue, you can clean the Gatsby cache before your build the site.

Here's how:

yarn clean

If you still encounter issues, perform a clean-all to delete all possible caches:

yarn clean-all

(Internal LaunchDarkly use only) Accessing the repo and docs tools

If you're a new LaunchDarkly technical writer or other contributor accessing the repo for the first time, you must complete the following setup steps to access and make changes to ld-docs-private.

  1. Request access to the Dev repo.
  2. Follow steps 1-9 under New computer setup.
  3. Request admin access to ld-docs-private and LaunchDarkly-Docs. To learn more more about how the repos relate to each other, read Syncing content between ld-docs-private and LaunchDarkly-Docs.

(Internal LaunchDarkly use only) πŸŒ— Accessing the staging site

When you open a docs PR, it creates a unique staging directory. The URL for that PR is linked in the PR page in the repo, and follows the pattern https://docs-stg.launchdarkly.com/nnnn/, where nnnn is your PR number. If the branch you are merging into has a name ending in -eap, then its content is additionally deployed to the staging site at https://docs-stg.launchdarkly.com/branch-name, where branch-name is something like your-feature-eap.

Staging is automatically refreshed on a push to each branch. To learn more, read Build & Deploy.

(Internal LaunchDarkly use only) πŸš€ Building and deploying the docs site

GitHub action automatically builds and deploys to staging on push to main.

If you want to manually deploy your own branch to staging, do this:

yarn deploy

This builds Gatsby and upload the artifacts to the staging s3 bucket.

(Internal LaunchDarkly use only) Scheduling a PR merge to main

In your pull requests, add a line to the end of the pull request description like this:

/schedule 2022-12-31

Or if you need to specify the exact time, you can use an ISO 8601 date string:

/schedule 2022-12-31T15:45:00

Dates are in PT timezone. Any string that works with the new Date() constructor will work.

(Internal LaunchDarkly use only) Flagging changes

We use flags in Catfood under the Docs project. There are three environments: Development, Test and Production corresponding to local dev, staging and prod respectively.

Flagging navigation items

You can use the gatsby-plugin-launchdarkly, to hide nav items behind a feature flag. To do this, add the flagKey property to the nav item you want to control with a flag in navigationData.json. Use the camel case version of the flag key, as shown below:

...
  {
    "label": "Your flag controlled nav item",
    "path": "/home/getting-started/hiding-your-nav-behind-a-flag",
    "flagKey": "myHiddenNav"
  },
...

Running tests

Local

To check local links in MDX files run

yarn test-links

To validate external links locally, install lychee

brew install lychee

Then run

yarn lychee

To run spellcheck locally, use

yarn spellcheck

To run our integration tests locally, make sure the dev server is running via yarn start, and

yarn cypress

To run them in headless mode,

yarn cypress:ci

To skip external link validation,

yarn cypress --env skip_external=true

CI

All of our tests are integrated into out CI/CI pipeline and most are guaranteed to run on every PR.

Local link checking and spellcheck run as part of the Testing GitHub action. External link link validation runs once per day as part of the Scheduled link check GitHub action.

πŸ”¨ Navigation data

All navigation data are stored in src/content/navigationData.json. This is flattened at build time to autogenerate two files rootTopics.json and secondLevelTopics.json. The flattened data are queryable via graphql and allows us to render the side nav more efficiently.

You can also flag navigation items. To learn more, please refer the section Flagging navigation items.

πŸ” Algolia search

Please reach out to @scribblingfox if you need to log in to Algolia. She will be able to send you an invite.

To index mdx content and send to Algolia, add the following to your .env.development file:

ALGOLIA_ADMIN_KEY=insertValue
BUILD_DEV_ALGOLIA_INDEX=true

You can get an admin key in the Algolia settings. If no special environment is set, this will use the Docs_development index. The convention for index names is {GATSBY_ALGOLIA_INDEX}_{ENVIRONMENT}. The environment variable can be set via cli param GATSBY_ACTIVE_ENV. For example, for staging, you would run the following command:

"build-staging": "GATSBY_ACTIVE_ENV=staging gatsby build",

This will create an algolia index called Pages_staging.

Upgrading Packages

This repo uses Yarn PnP (zero-installs) to reduce build times.

When upgrading package versions, you must commit cache files such as .yarn/cache/... and .pnp.cjs into main along with the yarn.lock and package.json files.

To learn more about PnP, read the documentation.

launchdarkly-docs's People

Contributors

apucacao avatar blake-wilson avatar bwoskow-ld avatar carmenquan avatar charliepark avatar cjhensen avatar cwaldren-ld avatar dependabot[bot] avatar eli-darkly avatar ember-stevens avatar gwhelanld avatar hroederld avatar intheclouddan avatar jazanne avatar k3llymariee avatar kcacosta avatar keelerm84 avatar launchliberty avatar ldhenry avatar leobyeon avatar lucywyman avatar mira-cho avatar mmrj avatar pkaeding avatar scribblingfox avatar sunnyguduru avatar traciklopez avatar xiex avatar yozlet avatar yusinto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

launchdarkly-docs's Issues

Improve the schema explanation for the DynamoDB persistent storage option

Hello!

I was wondering if it'd be sensible to elaborate on the DynamoDB schema requirements in the documentation?

I ran into an issue trying to set up a local Relay Proxy with DynamoDB Local, where initialisation fails due to an incorrect table schema:

Data store returned error: failed to get existing items prior to Init: ValidationException: Query condition missed key schema element

I created the tables with a single key attribute of type HASH as the LaunchDarkly docs suggested that key represents a unique key for each item. I suspected from this error that more attributes were required, and had to dig through the SDK code to figure out what they were. It seems to run correctly now with two attributes; namespace of type HASH, and key of type RANGE.

I think it'd be great if the docs could point this out, and even include a sample aws CLI invocation to create a table with the correct attributes:

aws dynamodb create-table \
        --endpoint-url http://localhost:8000 \
        --table-name ld-flags \
        --attribute-definitions \
            AttributeName=namespace,AttributeType=S \
            AttributeName=key,AttributeType=S \
        --key-schema \
            AttributeName=namespace,KeyType=HASH \
            AttributeName=key,KeyType=RANGE \
        --billing-mode=PAY_PER_REQUEST

How to cancel a plan

I can't find any documentation about cancelling a plan.

I want to stop using LaunchDarkly and can't cancel my plan

Conflicting information in iOS SDK reference and LDClient Class Reference

In the iOS SDK reference, the "Terminating the client instance" says:

Lastly, when your application is about to terminate, shut down the LDClient instance. This ensures that the client releases any resources it is using, and that any pending analytics events are delivered to LaunchDarkly. If your application quits without this shutdown step, you may not see your requests and users on the dashboard, because they are derived from analytics events. This is something you only need to do one time.

But in the LDClient Class Reference, the documentation for the close method says:

There is almost no reason to stop the LDClient. Normally, set the LDClient offline to stop communication with the LaunchDarkly servers. Stop the LDClient to stop recording events. There is no need to stop the LDClient prior to suspending, moving to the background, or terminating the app. The SDK will respond to these events as the system requires and as configured in LDConfig.

I'm assuming the class reference is correct, and the SDK reference is wrong, but whichever is incorrect should be fixed.

ModuleNotFoundError: No module named 'ldclient.file_data_source' with server-sdk `7.1.0`

I am using launchdarkly-server-sdk 7.1.0. Following the example here https://docs.launchdarkly.com/sdk/concepts/flags-from-files#configuring-the-client-to-use-a-file I am trying to read from flags from a file. This results in an error:

ModuleNotFoundError: No module named 'ldclient.file_data_source'

This worked fine when using sdk version 6.11.2 before upgrading the 7.1.0

Do the docs need to be updated to reflect a change or am I doing something wrong here?

Custom role action documentation missing some feature flags

This section is missing some feature flags listed in the UI.
GET https://app.launchdarkly.com/internal/actions includes

- description: Create new feature flags
  action: createFlag
- description: Delete a feature flag
  action: deleteFlag
- description: Clone a feature flag
  action: cloneFlag
- description: Rename a feature flag
  action: updateName
- description: Trigger the kill switch for a feature flag
  action: updateOn
- description: Update the description of a feature flag
  action: updateDescription
- description: Change whether the feature flag is available to front-end code via the JavaScript SDK
  action: updateIncludeInSnippet
- description: Change whether the feature flag is available to client-side SDKs
  action: updateClientSideFlagAvailability
- description: Mark a flag temporary or permanent
  action: updateTemporary
- description: Change the tags associated with a feature flag
  action: updateTags
- description: Change a flag's prerequisites
  action: updatePrerequisites
- description: Change a flag's individual user targeting rules
  action: updateTargets
- description: Change a flag's custom targeting rules
  action: updateRules
- description: Change the flag's default rule
  action: updateFallthrough
- description: Change the flag's variations
  action: updateFlagVariations
- description: Change the default variations used by newly created environments for a feature flag
  action: updateFlagDefaultVariations
- description: Change the variation returned when the kill switch is set to off
  action: updateOffVariation
- description: Change the flag's maintainer
  action: updateMaintainer
- description: Start or stop an A/B testing experiment
  action: updateAttachedGoals
- description: Create an experiment
  action: createExperiment
- description: Delete an experiment
  action: deleteExperiment
- description: Delete experiment results
  action: deleteExperimentResults
- description: Start or stop an experiment in an environment
  action: updateExperimentActive
- description: Change a flag's baseline variation for experiments
  action: updateExperimentBaseline
- description: Change a flag's custom properties
  action: updateFlagCustomProperties
- description: Reset the experiment results for a flag in a given environment
  action: deleteFlagAttachedGoalResults
- description: Copy settings from a feature flag
  action: copyFlagConfigFrom
- description: Copy settings to a feature flag
  action: copyFlagConfigTo
- description: Update a feature flag's salt
  action: updateFlagSalt
- description: Change whether to send detailed event information for a flag in a given environment
  action: updateTrackEvents
- description: Change whether to send detailed event information for a flag in a given environment when the fallthrough variation was selected
  action: updateFlagFallthroughTrackEvents
- description: Change whether a flag is archived
  action: updateGlobalArchived
- description: Change a flag's expiring custom targeting rules
  action: updateExpiringRules
- description: Change a flag's expiring individual user targeting rules
  action: updateExpiringTargets
- description: Change a flag's feature workflows
  action: updateFeatureWorkflows
- description: Change the scheduled updates on a feature flag
  action: updateScheduledChanges
- description: Create a new trigger or edit existing triggers
  action: updateTriggers
- description: Request approval on changes
  action: createApprovalRequest
- description: Update approval requests
  action: updateApprovalRequest
- description: Delete approval requests
  action: deleteApprovalRequest
- description: Approve changes on approval requests
  action: reviewApprovalRequest
- description: Can apply the request changes once reviewed
  action: applyApprovalRequest

I'm most interested in actions that "impact all environments", since they'll need special handling.
Might be nice to order them alphabetically, too.

Could you document them all?
Same for actions on all other resources, too?

.Net doc for reading flags from file includes deprecated APIs

The current docs for reading the flags from a file in the server sdk uses the deprecated WithUpdateProcessorFactory and WithEventProcessorFactory methods. The sample should be updated to:

var fileSource = 
    FileComponents.FileDataSource()
        .WithFilePaths("file1.json", "file2.json")
        .WithAutoUpdate(true);
var config =
    Configuration.Builder("sdk api key")
        .UpdateProcessorFactory(fileSource)
        .EventProcessorFactory(Components.NullEventProcessor)
        .Build();
ldClient = new LdClient(config);

.NET SDK Documentation, .EventFlushInterval() config needs to be updated

When reading through the documentation for customizing our LD client, I set the event flush interval according to the documentation:
https://docs.launchdarkly.com/sdk/server-side/dotnet#customizing-your-client

Configuration config = LaunchDarkly.Client.Configuration.Builder("YOUR_SDK_KEY") .EventFlushInterval(TimeSpan.FromSeconds(2)).Build(); LdClient ldClient = new LdClient(config);

However, in code, that method is deprecated.
image

Using LaunchDarkly.ServerSdk Version=5.14.1.0

[question] change multiple feature flags at the same time

Hi LD team.

Is there any feature allowing the user to change multiple feature flags at the same time for one or more users?

For example, imagine these FFs below (with true/false variations):

FEATURE_FLAG_A
FEATURE_FLAG_B

and these users:

is there any way to apply this at the same time instead of one by one?

[email protected]:
FEATURE_FLAG_A = true
FEATURE_FLAG_B = false

[email protected]
FEATURE_FLAG_A = true
FEATURE_FLAG_B = true

Not sure if here is the correct place to ask, but I found this link googling by launchdarkly+change+multiple+flags

TIA for any help!

Is the NextJS Documentation Incorrect?

https://docs.launchdarkly.com/guides/platform-specific/nextjs#client-side-rendering

This help article talks about using the LAUNCHDARKLY_SDK_CLIENT but shouldn't it be LAUNCHDARKLY_CLIENT_SIDE_ID?

When I was going through the setup, I got errors saying my client side ID was invalid, but the documentation says over and over to use LAUNCHDARKLY_SDK_CLIENT

Additionally, if it is supposed to be the LAUNCHDARKLY_SDK_CLIENT then why are we asking it to clientSideID?

export default withLDProvider({
  clientSideID: process.env.LAUNCHDARKLY_SDK_CLIENT,
})(MyApp);

How to set up jest-launchdarkly-mock with create-react-app 5?

Hi, I am trying to use jest-launchdarkly-mock with create-react-app@5. The LD documentation says that I should add the following line to my Jest configuration:

// jest.config.js
module.exports = {
  setupFiles: ['jest-launchdarkly-mock'],
}

However, CRA 5 doesn't ingest the jest.config.js file because it generates its own configuration.

The setupFiles property is also not allowed in the package.json file:

// package.json
{
  "jest": {
    "setupFiles": ["jest-launchdarkly-mock"]
  }
}

This throws the following error:

These options in your package.json Jest configuration are not currently supported by Create React App:

β€’ setupFiles

How would you recommend using jest-launchdarkly-mock with CRA?

Handling flags on initial application launch

LD iOS docs have a highlighted note saying:

Handling flag values on initial application launch
When LDClient is initialized for the first time at app launch, users receive feature flag default values until an initial connection to LaunchDarkly is completed for the first time. Take a look at the section above on various ways to initialize the client.

I'm having a problem where a flag which defaults locally to false but is set to true on LaunchDarkly is initially false when the app finishes launching the first time.

This note does suggest that this is the cause of the problem, but it's not clear to me from the docs how to fix it (besides just setting a default of true, which isn't preferable in this case).

Not sure if there's anything in "the section above on various ways to initialize the client" that helps solve the issue.

I am using this version of start to configure my app, and I am waiting for this to complete before continuing:

LDClient.start(config: config, user: user) {
    // Client has received flags for the user
}

Does this not ensure the flags have been synced properly for the user before completing?

Note this seems to me more like either something missing from the docs or I'm missing something, rather than a problem with LD itself, hence why I am posting here.

EDIT: seems that this may be more to do with the fact that on the first launch the user is not logged in and then after login I call identify and over there I am not waiting for the completion or doing anything with it.

Custom Attributes - Documentation lacks clarity around persistence

There is a lack of clarity around attribute persistence in Launch Darkly servers for 5.x SDK and the broader LD API.

In particular if we use the Identify endpoint as follows:

user := userBuilder.Custom("Attribute-1", "value").Build
client.Identify(user)

There's no clear expectation of the attribute being persisted in the LD API as per the documents. The ask is to update the Documentation to provide one of the following clarifications around support for persisted custom attributes:

  • Unimplemented (no persistence)
  • Unsupported (no guarantee of persistence or time of persistence)
  • Fully Supported

Issues with slack integration

I wanted to do following things with launch darkly (i dont know if its possible or not).

  • Add , remove & update custom attributes

Two things:

  • Whenever I type /launchdarkly help I see the same dialog again but not the list of available commands. image

  • And some of the commands like flag, filters doesn't work
    image

I have a question regarding the security of LaunchDarkly SDK

I am planning to use LauchDarkly for my Project, but before that, we have to go through the security risk check.
My Security team has the following questions

  1. Is LaunchDarkly a Single Tenant or multi-tenant? Does LaunchDarky provide a separate instance for each client, in this case, let say for my company, or share resources between the companies you provide the services?
  2. What are the caching policies for the mobile SDK's?

Pricing function code doesn't include the updated user object handling code

The pricing function example has a section with the complete function code, but the code doesn't include the changes to handling the user object

On page: https://docs.launchdarkly.com/guides/tutorials/rules-and-targeting

Code: @app.route('/')
def pricing():
"""Displays the pricing page."""
## Fetch the user's email address. If they aren't logged in,
## the stored value will be None.
email = session.get("email")
# Since this page doesn't require a logged-in user,
# tell LD that this is an anonymous user for now.
# The key is arbitrary and can be anything you want.
# Here, we wanted to be clear that this was an anonymous
# user, so we used "anon" as the value.
user = {
"key": "anon",
"anonymous": True
}
is_tier_3_enabled = ld_client.variation('pricing-tier-3', user, False)
return render_template(
'pricing.html',
is_tier_3_enabled=is_tier_3_enabled,
email=email,
key=user['key']
)

Missing code:

if (email):
user = user_object_from_email(email)
else:

Since the user isn't logged in,

let's tell LD that this is an anonymous user.

user = {
"key": "anon",
"anonymous": True
}

Reading flags from a file - Client side

Hello,

I have an existing SPA written in React that uses the LaunchDarkly React SDK for feature flags.
I am writing automation tests for the project using Microsoft's Playwright library.

I am looking for a way to enable/disable feature flags in my tests.
I stumbled upon this documentation that recommends reading from a local file, but only provides examples for server side code.

I am looking for any documentation/help on how to read files from a local file in a client side application.
If that is not possible, I am looking for any recommendations on how to toggle Launch Darkly flags in a client side application for automation tests.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.