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

Adds fenix support #149

Merged
merged 1 commit into from Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [upcoming]

### Added
* Support pushing [`fenix`](https://github.com/mozilla-mobile/fenix)

## [0.10.1] - 2018-12-20

### Fixed
Expand Down
7 changes: 7 additions & 0 deletions mozapkpublisher/common/apk/checker.py
Expand Up @@ -23,6 +23,8 @@ def cross_check_apks(apks_metadata_per_paths):
cross_check_focus_apks(apks_metadata_per_paths)
elif PRODUCT.is_reference_browser(package_name):
cross_check_reference_browser_apks(apks_metadata_per_paths)
elif PRODUCT.is_fenix(package_name):
cross_check_fenix_apks(apks_metadata_per_paths)
else:
cross_check_fennec_apks(apks_metadata_per_paths)

Expand All @@ -47,6 +49,11 @@ def cross_check_fennec_apks(apks_metadata_per_paths):
_check_all_architectures_and_api_levels_are_present(apks_metadata_per_paths)


def cross_check_fenix_apks(apks_metadata_per_paths):
_check_all_apks_have_the_same_package_name(apks_metadata_per_paths)
_check_apks_version_codes_are_correctly_ordered(apks_metadata_per_paths)


def cross_check_reference_browser_apks(apks_metadata_per_paths):
_check_all_apks_have_the_same_package_name(apks_metadata_per_paths)
_check_apks_version_codes_are_correctly_ordered(apks_metadata_per_paths)
Expand Down
2 changes: 1 addition & 1 deletion mozapkpublisher/common/apk/extractor.py
Expand Up @@ -48,7 +48,7 @@ def extract_metadata(original_apk_path):
metadata['architecture'] = _extract_architecture(apk_zip, original_apk_path)
metadata['locales'] = _extract_locales(apk_zip)

if not PRODUCT.is_reference_browser(package_name):
if not (PRODUCT.is_reference_browser(package_name) or PRODUCT.is_fenix(package_name)):
metadata['firefox_version'] = _extract_firefox_version(apk_zip)
metadata['firefox_build_id'] = _extract_firefox_build_id(apk_zip)

Expand Down
1 change: 1 addition & 0 deletions mozapkpublisher/common/googleplay.py
Expand Up @@ -29,6 +29,7 @@

# Google play allows the creation of custom release tracks for apps.
_ADDITIONAL_TRACK_VALUES = {
'org.mozilla.fenix': ['nightly'],
'org.mozilla.focus': ['nightly'],
'org.mozilla.klar': ['nightly'],
'org.mozilla.reference.browser': ['nightly'],
Expand Down
5 changes: 5 additions & 0 deletions mozapkpublisher/common/utils.py
Expand Up @@ -39,6 +39,7 @@ def filter_out_identical_values(list_):

class PRODUCT(Enum):
KLAR = "org.mozilla.klar"
FENIX = "org.mozilla.fenix"
FOCUS = "org.mozilla.focus"
REFERENCE_BROWSER = "org.mozilla.reference.browser"

Expand All @@ -54,6 +55,10 @@ def contains_value(value):
def is_focus_flavor(value):
return PRODUCT.contains_value(value) and (PRODUCT(value) == PRODUCT.FOCUS or PRODUCT(value) == PRODUCT.KLAR)

@staticmethod
def is_fenix(value):
return PRODUCT.contains_value(value) and PRODUCT(value) == PRODUCT.FENIX

@staticmethod
def is_reference_browser(value):
return PRODUCT.contains_value(value) and PRODUCT(value) == PRODUCT.REFERENCE_BROWSER
5 changes: 4 additions & 1 deletion mozapkpublisher/test/common/apk/test_checker.py
Expand Up @@ -96,6 +96,9 @@ def test_check_number_of_apks():

def test_check_correct_apk_product_types():
_check_correct_apk_product_types({
'fenix.apk': {
'package_name': 'org.mozilla.fenix'
},
'focus.apk': {
'package_name': 'org.mozilla.focus'
},
Expand All @@ -105,7 +108,7 @@ def test_check_correct_apk_product_types():
'reference-browser.apk': {
'package_name': 'org.mozilla.reference.browser'
}
}, [PRODUCT.FOCUS, PRODUCT.KLAR, PRODUCT.REFERENCE_BROWSER])
}, [PRODUCT.FENIX, PRODUCT.FOCUS, PRODUCT.KLAR, PRODUCT.REFERENCE_BROWSER])

with pytest.raises(BadSetOfApks):
_check_correct_apk_product_types({
Expand Down