bugsnag / bugsnag-dsym-upload

Scripts and Fastlane tasks for uploading dSYM files to BugSnag
https://docs.bugsnag.com/build-integrations/fastlane/
MIT License
36 stars 13 forks source link

iOS build missing metadata #34

Open cwhenderson20 opened 4 years ago

cwhenderson20 commented 4 years ago

Expected behavior

Release dashboard in Bugsnag should show release metadata (sourcecode links, git hash, releaser name) on both platforms when using send_build_to_bugsnag.

Observed behavior

Dashboard only shows this information when using the bugsnag gradle plugin for Android, but not when using this tool in fastlane.

Steps to reproduce

Make build, send build info to bugsnag using the send_build_to_bugsnag action.

Fastfile:

platform :ios do
  desc 'Distribute a new beta build'
  lane :beta do
    build_number = sh('../../scripts/version/versions.sh')
    increment_build_number(
      build_number: build_number
    )
    build_ios_app
    upload_to_testflight
    upload_symbols_to_bugsnag
    send_build_to_bugsnag(
      config_file: './<project name>/Info.plist'
    )
  end
end

Note the manual config_file option that I have to set in order to avoid issue #31.

Version

1.4.1

mattdyoung commented 4 years ago

Hi @cwhenderson20

The fastlane plugin will attempt to automatically determine source control information when it runs, but you can also set this yourself with the builder, repository and revision options if it can't be automatically detected: https://docs.bugsnag.com/build-integrations/fastlane/#reporting-builds-ios-and-android

Is the build being run from within a cloned git repository, so that the plugin can automatically determine the remote repository URL and revision?

cwhenderson20 commented 4 years ago

Thanks for the reply, @mattdyoung. Yep, it's certainly running inside a git repo. A detail I should have added in the initial report is the bugsnag android gradle plugin (running in the same repo) correctly attaches all of the build metadata.

Android build:

Screen Shot 2019-11-20 at 12 11 29 AM Screen Shot 2019-11-20 at 12 11 42 AM

iOS build:

Screen Shot 2019-11-20 at 12 11 58 AM Screen Shot 2019-11-20 at 12 12 04 AM
mattdyoung commented 4 years ago

@cwhenderson20 Adding some of the metadata the gradle plugin supplies e.g. git / gradle / Java / OS version etc isn't supported by the fastlane plugin.

The fastlane plugin should be automatically populating the repository and revision information from git though. We've tried this out and it appears this only works if the command is run from the root of the git repository, i.e. where the .git directory is located.

Can you confirm if that's what's causing the issue in your case? If so that should be something we can improve.

cwhenderson20 commented 4 years ago

@mattdyoung, is it possible to run fastlane commands from a directory the fastlane directory? I'd like to test this out, but I'm not sure the action will be successful.

mattdyoung commented 4 years ago

Hi @cwhenderson20

I'm unsure, but looking at this further we think the fastlane plugin should support populating the repository information when run anywhere within the git repository, and we think that's highly likely to be the cause of the missing repository information in your case.

We'll raise this as a bug, but it may take some time for us to have the bandwidth to resolve this so for the time being I'd recommend working around this by explicitly setting the repository and revision options in the plugin config.