Skip to content

Conversation

@xiangkangjw
Copy link
Contributor

App-scoped actions for Firebase apps within Firebase projects. Uses Firebase Management REST APIs (https://firebase.google.com/docs/projects/api/reference/rest/)

App-scoped actions for Firebase apps within Firebase projects. Uses Firebase Management REST APIs (https://firebase.google.com/docs/projects/api/reference/rest/)
@schmidt-sebastian
Copy link
Contributor

This PR only contains previously reviewed changes.

@weixifan
Copy link
Contributor

weixifan commented Nov 1, 2018

I fixed some iOS vs Android mistakes in the Javadoc for various methods in FirebaseProjectManagement. I will assign a reviewer in case there are comments about that change.

@weixifan
Copy link
Contributor

weixifan commented Nov 2, 2018

I also just adjusted the error codes list. Both Android certificates and Apps are handled by the same error codes map, so I changed the term "App" to simply "resource." Please take a look.

@schmidt-sebastian
Copy link
Contributor

Still LGTM

@weixifan
Copy link
Contributor

weixifan commented Nov 2, 2018

Unfortunately I discovered more things to fix. :(

Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together, and sorry for not commenting on it earlier. Please check out the things I've pointed out.

@hiranya911 hiranya911 removed the request for review from weixifan November 2, 2018 14:49
@weixifan weixifan assigned hiranya911 and unassigned weixifan Nov 7, 2018
/**
* Returns the fully qualified resource name of this SHA certificate.
*/
String getName() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be public. Please see the API proposal document for the precise public API.

Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes. I think we're almost there. My big concern is around how the waiting/polling logic is implemented. I would advocate for a simpler implementation using loops and Thread.sleep(). Then just run the logic on the calling thread (for sync methods), or on a separate thread (for async methods). Take everything else as an optional suggestion.

this.requestFactory =
httpTransport.createRequestFactory(new FirebaseRequestInitializer(app));

this.scheduledExecutor = new FirebaseScheduledExecutor(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please expose the existing FirebaseApp.schedule() method via a trampoline. Also look into implementing this waiting logic as a simple loop with Thread.sleep() without using additional threads (see my comments below). Then we can treat this method as any other method in the SDK, and have it be called either on the calling thread (for sync operation) or a separate thread (for async operation).

@hiranya911 hiranya911 assigned weixifan and unassigned hiranya911 Nov 7, 2018
@weixifan
Copy link
Contributor

weixifan commented Nov 8, 2018

Edit: The question below has been resolved. Just confirmed with my teammate that we are deliberately enforcing the rule that any ShaCertificate that the user wants to delete must come from the getShaCertificates(...) call. We will keep the other constructor package private. Thanks.

Thanks for the review. Aside from the asynchronous polling question that remains, we have another small issue: I noticed that for the AndroidApp.deleteShaCertificate(...) method, the caller must pass in a ShaCertificate, constructed with the name field set. This means we either force the caller to only be able to pass in a ShaCertificate returned by the getShaCertificates() method, or we expose a public method allowing the caller to create a ShaCertificate with a caller-supplied name field. I think we should allow the user to delete Android SHA certificates without having to call getShaCertificates first, if they happen to know the full resource name of the certificate they want to delete prior to calling it, but this isn't that critical. Please let me know what you think.

@weixifan weixifan assigned hiranya911 and unassigned xiangkangjw Nov 12, 2018
…that we do not directly expose the ScheduledExecutorService.
…(), and waiting before the first polling call.
…rebase-admin-java into xiangkang-project-management
@weixifan weixifan removed their assignment Nov 22, 2018
Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for making the changes.

@hiranya911 hiranya911 assigned weixifan and unassigned hiranya911 Nov 26, 2018
@weixifan weixifan merged commit 4f21d1e into master Nov 26, 2018
@weixifan
Copy link
Contributor

Thank you for the reviews. I have added the client version header as we discussed.

@weixifan weixifan deleted the xiangkang-project-management branch November 26, 2018 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants