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

Validate apps for Build Distribution #43

Merged
merged 8 commits into from
Dec 24, 2024

Conversation

Itaybre
Copy link
Collaborator

@Itaybre Itaybre commented Dec 23, 2024

No description provided.


module EmergeCLI
module Commands
class ValidateApp < EmergeCLI::Commands::GlobalOptions
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this be namespaced in a BuildDistribution module? "Validate app" could mean a ton of things for us. 😅

when '.app'
handle_app
else
raise 'Unknown file extension'
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: include the extension in the message

return
end

command = "codesign -dvvv '#{app_path}'"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Long-term it would be nice to wrap this behavior in a class like Android perftesting does.

Logger.debug command
stdout, _, status = Open3.capture3(command)
Logger.debug stdout
raise '❌ Codesign check failed' unless status.success?
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this failing mean? Can we give the user more information on what is actionable on their part?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It usually just fails, possibly a signature mismatch.
Hard to get the cause

end

def read_entitlements(app_path)
entitlements_path = File.join(app_path, 'embedded.mobileprovision')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this correct? It's named entitlements but reading the provisioning profile file.


expiration_date = parsed_data['ExpirationDate']
if expiration_date > Time.now
Logger.info '✅ Provisioning profile hasn\'t expired'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we include the expiration_date in the messages?

@@ -61,6 +62,10 @@ module EmergeCLI
prefix.register 'validate-linkmaps', Commands::ValidateLinkmaps
prefix.register 'validate-xcode-project', Commands::ValidateXcodeProject
end

register 'build-distribution' do |prefix|
prefix.register 'validate-app', Commands::ValidateApp
Copy link
Collaborator

Choose a reason for hiding this comment

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

How will this work for Android?

@Itaybre Itaybre merged commit f39269f into main Dec 24, 2024
5 checks passed
@Itaybre Itaybre deleted the feature/binary_validation_distribution branch December 24, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants