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

Top level option abstractions #215

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [upcoming]

### Changed
* Separates read-only logic from logic that requires a transaction
* `--service-account` and `--credentials` is now only required if `--do-not-contact-google-play` isn't provided
* `push_apk` and `update_apk_description` now accept types for `track` and `connection`, rather than mutually-exclusive primitive parameters

### Fixed
* `check_rollout` no longer ignores `--do-not-contact-google-play`

## [4.1.0] - 2019-07-10
### Removed
* `--skip-check-package-names`. When pushing or checking an APK, expected package names must always be provided
Expand Down
18 changes: 8 additions & 10 deletions mozapkpublisher/check_rollout.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
import requests

from argparse import ArgumentParser
from mozapkpublisher.common.googleplay import EditService, add_general_google_play_arguments

from mozapkpublisher.common.googleplay import add_general_google_play_arguments, \
ReadOnlyGooglePlay, connection_for_options

DAY = 24 * 60 * 60

logger = logging.getLogger(__name__)


def check_rollout(edit_service, days):
def check_rollout(google_play, days):
"""Check if package_name has a release on staged rollout for too long"""
track_status = edit_service.get_track_status(track='production')
track_status = google_play.get_rollout_status()
releases = track_status['releases']
for release in releases:
if release['status'] == 'inProgress':
Expand All @@ -39,13 +39,11 @@ def main():
parser.add_argument('--days', help='The time before we warn about incomplete staged rollout of a release (default: 7)',
type=int, default=7)
config = parser.parse_args()
connection = connection_for_options(config.contact_google_play, config.service_account,
config.google_play_credentials_file)

edit_service = EditService(
config.service_account,
config.google_play_credentials_file.name,
package_name='org.mozilla.firefox',
)
for (release, age) in check_rollout(edit_service, config.days):
google_play = ReadOnlyGooglePlay.create(connection, 'org.mozilla.firefox')
for (release, age) in check_rollout(google_play, config.days):
print('fennec {} is on staged rollout at {}% but it shipped {} days ago'.format(
release['name'], int(release['userFraction'] * 100), int(age / DAY)))

Expand Down
7 changes: 0 additions & 7 deletions mozapkpublisher/common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ def __init__(self, checked_file, expected, actual):
)


class NoTransactionError(LoggedError):
def __init__(self, package_name):
super(NoTransactionError, self).__init__(
'Transaction has not been started for package "{}"'.format(package_name)
)


class NotMultiLocaleApk(LoggedError):
def __init__(self, apk_path, unique_locales):
super(NotMultiLocaleApk, self).__init__(
Expand Down
Loading