-
Notifications
You must be signed in to change notification settings - Fork 11
Fix check against app identifier #54
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
Conversation
@JasperGuo , @Cokile Could one you review this when you get a moment please? Super small PR. |
asconnect/build_client.py
Outdated
@@ -117,7 +117,7 @@ def get_from_build_number(self, bundle_id: str, build_number: str) -> Build | No | |||
if not app: | |||
break | |||
|
|||
if app.bundle_id == bundle_id: | |||
if app.identifier == bundle_id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you help me understand how this would work if app.identifier
is a numeric value, while bundle_id
is not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. This was confusing and wrong. I've fixed the other calls so that app identifier is passed in the correct places.
It's always a numeric identifier from what I can see, but Apple always return it as a string, so I've left it as a string in case they make changes in the future.
There's a more interesting problem though. In your code, in testflight.py
, you are doing this (snipped):
app_identifier = state.bundle_id()
app = self.client.app.get_from_bundle_id(app_identifier)
self.client.build.upload(ipa_path=ipa_path, platform=asconnect.Platform.IOS, max_attempts=10)
current_build = self.client.build.wait_for_build_to_process(
app_identifier, str(self.metadata.build_number)
)
That app_identifier
you pass into wait_for_build_to_process
(which in turn calls get_from_build_number
) is the bundle ID rather than the Apple specific identifier. Which means you are checking Apple's identifier against the bundle ID, which should never succeed. Except that it does. I don't have your API keys, so I can't confirm what is being returned.
Can you make a call to get_from_build_number
with one of your build numbers and see what the app ID is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dalemyers Tested with the get_from_build_number
, the app ID is a numeric identifier.
For the code in testflight.py
, we should have named the variable app_bundle_id
instead of app_identifier
. Since wait_for_build_to_process
(which in turn calls get_from_build_number
) accepts bundle id, we just pass the correct value to call the method, though using a confusing variable name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, will check against app identifer instead of bundle id make differences? IIRC, there should not have multile apps with the same bundle id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe it should make a difference, however, getting the bundle_id requires parsing the bundle. You don't have to do that if you use the app ID. Makes it easier for users who don't already know their bundle ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this is all wrong. I'm going to close this PR.
e674f88
to
73939ba
Compare
We were checking
bundle_id
which iscom.microsoft.Whatever
but should be checkingidentifier
which is a numeric value that Apple generates.