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

Error Handling When Reverting/Releasing App Version with V1 Mobile UCR References #35168

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

zandre-eng
Copy link
Contributor

@zandre-eng zandre-eng commented Oct 3, 2024

Product Description

One of two alert messages can be shown to the user depending on whether the app version still has V1 set as the mobile UCR restore version or if the app version contains any V1 fixture references:
v1-restore-version-warning

v1-refs-warning

The following conditions will cause one of the new alert messages to be shown:

  • If a user reverts an app to an earlier version containing V1 refs then a non-blocking warning message will be shown.
  • If a user builds a new version of an app containing V1 refs then a non-blocking warning message will be shown.
  • If a user releases an app version containing V1 refs then a blocking error message will be shown.

Technical Summary

Link to ticket here.

This PR introduces some guard rails to ensure that users are not able to release app versions which contain any mobile UCR V1 references. The feature is currently undergoing a process of migrating to V2, and so these extra checks are being put in place to ensure that V1 of the feature is able to be deprecated.

Feature Flag

MOBILE_UCR

Safety Assurance

Safety story

  • Local testing
  • QA to be done

The checks implemented in this PR will only apply to domains that have the MOBILE_UCR feature flag enabled.

Automated test coverage

Automated tests have been created for the new helper function to ensure that it correctly identifies when one or more forms in an app are using mobile UCR V1 fixtures.

QA Plan

QA to be completed. Ticket is available here.

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@zandre-eng zandre-eng added awaiting QA QA in progress. Do not merge product/feature-flag Change will only affect users who have a specific feature flag enabled labels Oct 3, 2024
@zandre-eng zandre-eng marked this pull request as ready for review October 3, 2024 12:44
Copy link
Contributor

@mkangia mkangia left a comment

Choose a reason for hiding this comment

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

This looks good to me.

Aren't we showing user a message even when they just view the app? or is that a different ticket?

<div class="alert alert-warning alert-build">
<h4 class="alert-heading">
<i class="fa fa-exclamation-circle"></i>
{% trans "Warning while making new version" %}</h4>
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are letting user make a new version, you could consider framing this as
Warning for the version {version} or just Warning since the message already has the version number.

Saying, warning while making a new version is a bit confusing because the version was made and was not blocked which seems right since warnings are non blocking but usually a warning isn't a result of an action, an error is, which this is not. So, just for a better user experience, good to keep that text more clear.

@@ -313,9 +315,9 @@ def languages_mapping():
if not mapping:
with open('submodules/langcodes/langs.json', encoding='utf-8') as langs_file:
lang_data = json.load(langs_file)
mapping = dict([(l["two"], l["names"]) for l in lang_data])
mapping = dict([(lang["two"], lang["names"]) for lang in lang_data])
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

if (
MOBILE_UCR_V1_FIXTURE_IDENTIFIER in form.source
or re_mobile_ucr_v1_all_refs.search(form.source)
):
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I assume you want to keep this explicit/clean and so you are using the if block instead of doing

return (MOBILE_UCR_V1_FIXTURE_IDENTIFIER in form.source or re_mobile_ucr_v1_all_refs.search(form.source))

I like explicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting QA QA in progress. Do not merge product/feature-flag Change will only affect users who have a specific feature flag enabled
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants