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

[deliver] fetch live app info if no edit info is present, fixing scenario of having both macOS and iOS apps present #21472

Merged
merged 21 commits into from Sep 29, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion deliver/lib/deliver/upload_metadata.rb
Expand Up @@ -89,7 +89,7 @@ def upload(options)
enabled_languages = detect_languages(options)

app_store_version_localizations = verify_available_version_languages!(options, app, enabled_languages) unless options[:edit_live]
app_info_localizations = verify_available_info_languages!(options, app, enabled_languages) unless options[:edit_live]
app_info_localizations = verify_available_info_languages!(options, app, enabled_languages) unless options[:edit_live] || !is_updating_app_info(options)

if options[:edit_live]
# not all values are editable when using live_version
Expand Down Expand Up @@ -451,6 +451,15 @@ def retry_if_nil(message, tries: 5, wait_time: 10)
end
end

# Checking if the metadata to update includes App Info
def is_updating_app_info(options)
Copy link
Member

Choose a reason for hiding this comment

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

This function could look more Ruby-y 😊 simply:

def updating_app_info?(options)
  LOCALISED_APP_VALUES.keys.any? { |key| options[key] }
end

updating_app_info? is the Ruby naming convention for functions that return boolean values (instead of e.g. is…(…)) 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Clearly, I'm not a ruby-ist :-)

Copy link
Member

Choose a reason for hiding this comment

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

I just know a thing or two! Always happy to share knowledge and help others ❤️

LOCALISED_APP_VALUES.keys.each do |key|
rogerluan marked this conversation as resolved.
Show resolved Hide resolved
return true unless options[key].nil?
rogerluan marked this conversation as resolved.
Show resolved Hide resolved
end

return false
end

# Finding languages to enable
def verify_available_info_languages!(options, app, languages)
app_info = fetch_edit_app_info(app)
Expand Down