Skip to content

failOnUploadError is not set properly when trying to set it for specific variants #458

Open
@manask88

Description

@manask88

Describe the bug

We have multiple flavors in the app. We would like the production flavor to fail when bugsnag fails to upload the mappings file, but not fail for every other flavor. There is an example in https://docs.bugsnag.com/build-integrations/gradle/ to use variant filters to enable/disable the bugsnag plugin on a variant basis. This works fine, but when trying to use the failOnUploadError flag, it doesn't work as expected with the variants filters.

Expected behavior

Whenever we build any flavor that is not production, we expect the build to not fail if the bugsnag upload process fails.
Whenever we build the production flavor, we expect the build to fail if the bugsnag upload process fails

Actual behavior

Whenever we build any flavor that is not production, the upload process doesn't fail
Whenever we build the production flavor, the upload process doesn't fail

Environment

  • Android Studio version: 2020.3.1
  • Gradle version: 7.0.2
  • Android Gradle Plugin (AGP) version: 7.0.4
  • Bugsnag Android Gradle Plugin version: 5.19.1

Example code snippet

bugsnag {
        retryCount = 5
        requestTimeoutMs = 300000L 
         endpoint = "https://uploadfake.bugsnag.example.com" // configures the Upload API endpoint
         releasesEndpoint = "https://bugsnag-fake-build.example.com" // configures the Build API endpoint
        variantFilter { variant ->
            def variantNameLowercase = variant.name.toLowerCase()

            if (variantNameLowercase.contains("production")) {
                failOnUploadError = true // fails build on error only for production builds
            } else {
                failOnUploadError = false
            }
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogWe hope to fix this feature/bug in the futurefeature requestRequest for a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions