Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to build without talking to datadog api #2

Open
Nicktho opened this issue Nov 20, 2022 · 1 comment
Open

Ability to build without talking to datadog api #2

Nicktho opened this issue Nov 20, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Nicktho
Copy link

Nicktho commented Nov 20, 2022

Is your feature request related to a problem? Please describe.
In the documentation for crash reporting (https://github.com/DataDog/dd-sdk-reactnative/blob/develop/docs/expo_crash_reporting.md#disable-file-uploads
), it appears that by changing config you can disable file uploads to the datadog api.

Although, when setting these config options and running an ios build locally (expo run:ios), an error message saying "datadog-ci" package is required and then upon installing that package and re-running the build, another error message will show regarding the environment variable DATADOG_API_KEY missing.

It is unclear from the documentation that it is always required to install @datadog/datadog-ci and have DATADOG_API_KEY set as an environment variable.

It is also perhaps not ideal for all teams to have that API key locally for engineers wanting to build their ios project locally with expo run:ios

Describe the solution you'd like

  • Clarity in the documentation as to what is required to:

    • Run a build locally (Environment variables & packages required)
    • Run a build in the cloud even with disabling options.
    • Whether setting the configuration options affect the above.
  • Some option to disable file uploads to datadog when running a build locally for development reasons, avoiding the need for datadog api keys on local machines.

@aaronholla
Copy link
Contributor

For anyone else looking to disable all uploads only in local dev.

The documentation now mentions

If you want to disable all file uploads, remove the expo-datadog from the list of plugins.

I wanted to add to this to describe an approach that works for expo apps.

You have the option to conditionally include the plugin based on the environment. This will require utilizing the dynamic expo config file (https://docs.expo.dev/workflow/configuration/#dynamic-configuration)

As an example, you could utilize the CI env variable to only upload when building in CI:

// app.config.js

module.exports = {
  plugins: [
    ...(process.env.CI ? ['expo-datadog'] : []),
    <Other Plugins>
  ],
};

If using Expo EAS to build you can also utilize their built in env variables to upload for only specific build profiles or platforms. (https://docs.expo.dev/build-reference/variables/#built-in-environment-variables)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants