Skip to content

No value found for 'dsym_paths', 'dsym_paths' should be marked as required #20

@seunghwanly

Description

@seunghwanly

Hi there!👋

The upload_symbols_to_datadog action fails with the cryptic error No value found for
'dsym_paths' when the preceding download_dsyms action does not find any dSYM files.

The dsym_paths parameter should be validated to ensure it is not empty, and a clear
error message should be shown to the user in this case.

Steps to Reproduce

  1. Configure a Fastfile lane that uses download_dsyms followed by
    upload_symbols_to_datadog, similar to the example in the README.md.
   1     lane :upload_dsyms_to_datadog do
   2       download_dsyms(
   3         # Use parameters for a build that has no dSYMs available for download
   4         app_identifier: "com.example.app",
   5         version: "1.0.0",
   6         build_number: "42"
   7       )
   8       upload_symbols_to_datadog(api_key: "your-datadog-api-key")
   9     end
  1. Run the lane in a scenario where download_dsyms successfully runs but does not find
    any dSYMs to download.

Current Behavior

The download_dsyms action completes and passes an empty or nil value into the
DSYM_PATHS lane context. The upload_symbols_to_datadog action then fails with an
unclear error.

As seen in the logs, the action fails, but the error message No value found for
'dsym_paths' is not descriptive enough.

   1 [INFO]: ---------------------------------------
   2 [INFO]: --- Step: upload_symbols_to_datadog ---
   3 [INFO]: ---------------------------------------
   4 [💥]: upload_symbols_to_datadog
   5 ...
   6 No value found for 'dsym_paths'

Expected Behavior

The upload_symbols_to_datadog action should detect that the dsym_paths parameter is
empty and fail immediately with a clear, user-friendly error message, for example: "No
dSYM paths found or provided for upload_symbols_to_datadog. Please specify the
:dsym_paths option."

Proposal

The dsym_paths parameter in upload_symbols_to_datadog.rb should be updated to include a
verify_block to ensure a value is present.

lib/fastlane/plugin/datadog/actions/upload_symbols_to_datadog.rb

FastlaneCore::ConfigItem.new(
  key: :dsym_paths,
  default_value: Actions.lane_context[SharedValues::DSYM_PATHS],
  description: "An array of the folders and/or the zip files which contains the dSYM files",
  type: Array,
  # Add this verification block
  verify_block: proc do |value|
    UI.user_error!("No dSYM paths found or provided for upload_symbols_to_datadog. Please specify the `:dsym_paths` option.") unless value && !value.empty?
  end
),

Additional Context

The current README.md implies that the dsym_paths are fed automatically, but this can
be misleading. When download_dsyms finds no files, the "automatic" feeding results in
an empty value, which causes the failure. The proposed validation would make this
integration more robust.

I've already made some changes here: seunghwanly@7010a18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions