Skip to content

Add custom domain support to callable functions #2100

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

Merged
merged 5 commits into from
Nov 11, 2020

Conversation

kroikie
Copy link
Contributor

@kroikie kroikie commented Oct 24, 2020

Discussion

Googlers: see API review here

Testing

  • Added new unit tests

API Changes

  • API reviewed

This change is in line with other similar changes for JS and iOS sdk:
JS implemented
iOS implemented

@googlebot googlebot added the cla: yes Override cla label Oct 24, 2020
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 24, 2020

Coverage Report

Affected SDKs

  • firebase-functions

    SDK overall coverage changed from 3.69% (9a8cd2c) to 3.59% (e9ab0ec9) by -0.10%.

    Filename Base (9a8cd2c) Head (e9ab0ec9) Diff

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (e9ab0ec9) is created by Prow via merging commits: 9a8cd2c bc0e438.

@kroikie
Copy link
Contributor Author

kroikie commented Oct 24, 2020

This PR combines the region and custom domain in a single regionOrCustomDomain FirebaseFunctions constructor parameter. This parameter is checked for being a valid URL, this check is done using the Apache commons UrlValidator. This option provided a clean way of checking if regionOrCustomDomain was a valid URL or not.

If adding this dependency is an issue there are other options that I would be happy to switch to:

  1. Try to create a URL and catch the resulting exception (like done in the JS implementation)
  2. Use a RegEx to see if the parameter is a URL or not
  3. Check if the parameter starts with http or https since no region will have this prefix

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 24, 2020

Binary Size Report

Affected SDKs

  • firebase-common

    Type Base (9a8cd2c) Head (e9ab0ec9) Diff
    aar ? 36.1 kB ? (?)
    apk (aggressive) ? 74.5 kB ? (?)
    apk (release) ? 627 kB ? (?)
  • firebase-common-ktx

    Type Base (9a8cd2c) Head (e9ab0ec9) Diff
    aar ? 5.98 kB ? (?)
    apk (aggressive) ? 90.2 kB ? (?)
    apk (release) ? 1.10 MB ? (?)
  • firebase-components

    Type Base (9a8cd2c) Head (e9ab0ec9) Diff
    aar ? 34.7 kB ? (?)
    apk (aggressive) ? 8.68 kB ? (?)
    apk (release) ? 25.2 kB ? (?)
  • firebase-functions

    Type Base (9a8cd2c) Head (e9ab0ec9) Diff
    aar ? 26.4 kB ? (?)
    apk (aggressive) ? 347 kB ? (?)
    apk (release) ? 1.16 MB ? (?)
  • firebase-functions-ktx

    Type Base (9a8cd2c) Head (e9ab0ec9) Diff
    aar ? 5.86 kB ? (?)
    apk (aggressive) ? 367 kB ? (?)
    apk (release) ? 1.64 MB ? (?)

Test Logs

Notes

Head commit (e9ab0ec9) is created by Prow via merging commits: 9a8cd2c bc0e438.

@kroikie
Copy link
Contributor Author

kroikie commented Oct 27, 2020

@samtstern looks like the smoke test has an issue with ML:

Could not find com.google.firebase:firebase-ml-natural-language

@samtstern
Copy link
Contributor

@kroikie LGTM I don't think the smoke test thing is your fault but hopefully someone else can chime in.

@samtstern samtstern requested a review from davidmotson October 27, 2020 10:49
@kroikie kroikie closed this Oct 27, 2020
@kroikie kroikie reopened this Oct 27, 2020
@google-oss-bot
Copy link
Contributor

@kroikie: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
smoke-tests bc0e438 link /test smoke-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@samtstern samtstern merged commit 4f3ffc5 into firebase:master Nov 11, 2020
@firebase firebase locked and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants