-
Notifications
You must be signed in to change notification settings - Fork 37
Bug2015223: Adds Thunderbird Release AppID #1338
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,13 @@ | ||
| work_dir: { "$eval": "WORK_DIR" } | ||
| artifact_dir: { "$eval": "ARTIFACTS_DIR" } | ||
| verbose: { "$eval": "VERBOSE == 'true'" } | ||
| app_id: { "$eval": "APP_ID" } | ||
| app_ids: | ||
| beta: {"$eval": "APP_ID_BETA" } | ||
| stable: {"$eval": "APP_ID_STABLE"} | ||
| esr: | ||
| $if: 'COT_PRODUCT == "thunderbird"' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: instead of hardcoding thunderbird, maybe use |
||
| then: { "$eval": "APP_ID_ESR"} | ||
| else: '' | ||
| taskcluster_scope_prefix: { "$eval": "TASKCLUSTER_SCOPE_PREFIX" } | ||
| push_to_flathub: { "$eval": "ENV == 'prod'" } | ||
| flathub_url: { "$eval": "FLATHUB_URL" } | ||
|
|
@@ -12,4 +18,8 @@ token_locations: | |
| then: | ||
| beta: { "$eval": "REPO_TOKEN_BETA_PATH" } | ||
| stable: { "$eval": "REPO_TOKEN_STABLE_PATH" } | ||
| esr: | ||
| $if: 'COT_PRODUCT == "thunderbird"' | ||
| then: { "$eval": "REPO_TOKEN_ESR_PATH" } | ||
| else: '' | ||
| else: {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,18 +142,18 @@ def files(tar, path): | |
| return os.path.join(flatpak_tar_basedir, flatpak_deflated_dir) | ||
|
|
||
|
|
||
| def check_app_id_matches_flatpak(context, flatpak_path): | ||
| def check_app_id_matches_flatpak(context, flatpak_path, channel): | ||
| # Extract all ostree refs from the supplied Flatpak repo | ||
| flatpak_refs = subprocess.check_output(["ostree", "refs"], cwd=flatpak_path).decode().splitlines() | ||
|
|
||
| # Consolidate ostree refs into list of Flatpak IDs available in repo | ||
| flatpak_refs = [ref.split("/")[1] for ref in flatpak_refs if ref.startswith("app/")] | ||
|
|
||
| # Create a list, if any, of all unexpected Flatpak IDs present in repo | ||
| invalid_refs = set(flatpak_refs) - {context.config["app_id"]} | ||
| invalid_refs = set(flatpak_refs) - {context.config["app_ids"]} | ||
|
|
||
| if context.config["app_id"] not in flatpak_refs: | ||
| raise TaskVerificationError(f"Supplied app ID ({context.config['app_id']}) is not present in Flatpak!") | ||
| if context.config["app_ids"][channel] not in flatpak_refs: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to check that |
||
| raise TaskVerificationError(f"Supplied app ID ({context.config['app_ids'][channel]}) is not present in Flatpak!") | ||
|
|
||
| if len(invalid_refs) > 0: | ||
| raise TaskVerificationError("One or more invalid app IDs are present in Flatpak!") | ||
|
|
@@ -191,7 +191,7 @@ def push(context, flatpak_file_path, channel): | |
| deflated_dir = check_and_extract_tar_archive(context, flatpak_file_path) | ||
|
|
||
| log.info("Verifying supplied app ID matches flatpak app ID...") | ||
| check_app_id_matches_flatpak(context, deflated_dir) | ||
| check_app_id_matches_flatpak(context, deflated_dir, channel) | ||
|
|
||
| log.info(f"Pushing the flatpak to the associated {publish_build_output}") | ||
| run_flat_manager_client_process(context, token_args + ["push", publish_build_output, deflated_dir]) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| from scriptworker.exceptions import TaskVerificationError | ||
|
|
||
| _CHANNELS_AUTHORIZED_TO_REACH_FLATHUB = ("beta", "stable") | ||
| _CHANNELS_AUTHORIZED_TO_REACH_FLATHUB = ("beta", "stable", "esr") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this effectively |
||
| ALLOWED_CHANNELS = ("mock", *_CHANNELS_AUTHORIZED_TO_REACH_FLATHUB) | ||
|
|
||
|
|
||
|
|
||
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.