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

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

Open
manask88 opened this issue Apr 22, 2022 · 1 comment
Labels
backlog We hope to fix this feature/bug in the future feature request Request for a new feature

Comments

@manask88
Copy link

manask88 commented Apr 22, 2022

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
            }
        }
    }
@luke-belton
Copy link
Member

Hi @manask88 - unfortunately we wouldn't actually expect this to work, currently the only valid option inside variantFilter is enabled. I've raised this with our product team for their consideration and will keep you updated on this thread.

@luke-belton luke-belton added feature request Request for a new feature backlog We hope to fix this feature/bug in the future labels May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to fix this feature/bug in the future feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants