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

feat: Receive user name instead of customer intent for new terms UI #1094

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

Conversation

calvin-codecov
Copy link
Contributor

@calvin-codecov calvin-codecov commented Jan 13, 2025

Purpose/Motivation

What is the feature? Why is this being done?

New onboarding changes for pre-PAT appless to make it easier and more clear for users to sign up. We are changing up the required information that a user must fill out to complete onboarding. We will no longer be asking for customer intent and for the user to select a default organization in step that follows this screen.

Links to relevant tickets

codecov/engineering-team#3174

Changes related to the UI changes designated in this Figma: https://www.figma.com/design/SsoxtY2SB73l0wiLbJ8FhZ/GH-2092?node-id=2288-16704&t=sMCRUMT3J1bwIct1-1

What does this PR do?

For the onboarding page, we are:

  • adding name input and requiring it
  • newly requiring email input (previously only required when user was opting into marketing updates)
  • no longer asking for customer intent (Personal or Business)

Notes to Reviewer

Anything to note to the team? Any tips on how to review, or where to start?

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@calvin-codecov calvin-codecov requested a review from a team as a code owner January 13, 2025 22:29
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.12%. Comparing base (4c41647) to head (f322a0d).
Report is 4 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1094      +/-   ##
==========================================
+ Coverage   96.02%   96.12%   +0.10%     
==========================================
  Files         831      829       -2     
  Lines       19563    19538      -25     
==========================================
- Hits        18785    18781       -4     
+ Misses        778      757      -21     
Flag Coverage Δ
unit 96.00% <100.00%> (+3.67%) ⬆️
unit-latest-uploader 96.00% <100.00%> (+3.67%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-staging
Copy link

codecov-staging bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Jan 13, 2025

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
2680 6 2674 7
View the top 3 failed tests by shortest run time
codecov_auth/tests/unit/test_authentication.py::ImpersonationTests::test_impersonation
Stack Traces | 0.379s run time
self = <codecov_auth.tests.unit.test_authentication.ImpersonationTests testMethod=test_impersonation>

    def test_impersonation(self):
        self.client.force_login(user=self.staff_user)
        res = self.client.post(
            "/graphql/gh",
            {"query": "{ me { user { username } } }"},
            content_type="application/json",
        )
>       assert res.json()["data"]["me"] == {"user": {"username": "impersonateme"}}
E       AssertionError: assert None == {'user': {'username': 'impersonateme'}}

.../tests/unit/test_authentication.py:198: AssertionError
graphql_api/tests/mutation/test_update_profile.py::UpdateProfileTestCase::test_when_authenticated
Stack Traces | 0.395s run time
self = <test_update_profile.UpdateProfileTestCase testMethod=test_when_authenticated>

    def test_when_authenticated(self):
        name = "yo"
        data = self.gql_request(
            query, owner=self.owner, variables={"input": {"name": name}}
        )
>       assert data["updateProfile"]["me"]["user"]["name"] == name
E       AssertionError: assert None == 'yo'

.../tests/mutation/test_update_profile.py:36: AssertionError
codecov_auth/tests/unit/views/test_logout.py::LogoutViewTest::test_logout_when_authenticated
Stack Traces | 0.396s run time
self = <codecov_auth.tests.unit.views.test_logout.LogoutViewTest testMethod=test_logout_when_authenticated>

    def test_logout_when_authenticated(self):
        owner = OwnerFactory()
        self.client = Client()
        self.client.force_login_owner(owner)
    
        res = self._post("/graphql/gh/")
>       self.assertEqual(self._is_authenticated(), True)
E       AssertionError: False != True

.../unit/views/test_logout.py:32: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link
Contributor

github-actions bot commented Jan 13, 2025

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Copy link

codecov-public-qa bot commented Jan 13, 2025

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
2681 6 2675 6
View the top 3 failed tests by shortest run time
codecov_auth/tests/unit/test_authentication.py::ImpersonationTests::test_impersonation
Stack Traces | 0.379s run time
self = <codecov_auth.tests.unit.test_authentication.ImpersonationTests testMethod=test_impersonation>

    def test_impersonation(self):
        self.client.force_login(user=self.staff_user)
        res = self.client.post(
            "/graphql/gh",
            {"query": "{ me { user { username } } }"},
            content_type="application/json",
        )
>       assert res.json()["data"]["me"] == {"user": {"username": "impersonateme"}}
E       AssertionError: assert None == {'user': {'username': 'impersonateme'}}

.../tests/unit/test_authentication.py:198: AssertionError
graphql_api/tests/mutation/test_update_profile.py::UpdateProfileTestCase::test_when_authenticated
Stack Traces | 0.395s run time
self = <test_update_profile.UpdateProfileTestCase testMethod=test_when_authenticated>

    def test_when_authenticated(self):
        name = "yo"
        data = self.gql_request(
            query, owner=self.owner, variables={"input": {"name": name}}
        )
>       assert data["updateProfile"]["me"]["user"]["name"] == name
E       AssertionError: assert None == 'yo'

.../tests/mutation/test_update_profile.py:36: AssertionError
codecov_auth/tests/unit/views/test_logout.py::LogoutViewTest::test_logout_when_authenticated
Stack Traces | 0.396s run time
self = <codecov_auth.tests.unit.views.test_logout.LogoutViewTest testMethod=test_logout_when_authenticated>

    def test_logout_when_authenticated(self):
        owner = OwnerFactory()
        self.client = Client()
        self.client.force_login_owner(owner)
    
        res = self._post("/graphql/gh/")
>       self.assertEqual(self._is_authenticated(), True)
E       AssertionError: False != True

.../unit/views/test_logout.py:32: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

and input.customer_intent not in valid_customer_intents
):
raise ValidationError("Invalid customer intent provided")
print("qwerty input: ", input)
Copy link
Contributor

Choose a reason for hiding this comment

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

print

@@ -5,5 +5,6 @@ type User {
student: Boolean!
studentCreatedAt: DateTime
studentUpdatedAt: DateTime
# this will no longer be updated from the UI with Appless
Copy link
Contributor

Choose a reason for hiding this comment

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

we can't delete the customerIntent: String line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would this have any chance of breaking anything in a transition period? I wanted to double check here to make sure it was safe. Would you suggest rolling out gazebo changes first or codecov-api first since we're removing customerIntent but adding name on the SaveTermsAgreementInput side

Copy link
Contributor

@JerrySentry JerrySentry Jan 15, 2025

Choose a reason for hiding this comment

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

Wait so if you are changing the interface of SaveTermsAgreementInput then would gazebo not break when this change is deployed? Assuming gazebo is currently using save terms agreement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would... it sounds like I would need to change this to be a phased rollout in that case. I think I would need to add back customerIntent for now and then just loosen the validations on it as we can't expect it to be passed through from the new UI form. Does that sound accurate?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah sounds about right.

  1. Accept either name or customer intent
  2. Switch gazebo to use name
  3. Remove customer intent from api

@user_bindable.field("customerIntent")
def resolve_customer_intent(user: Owner, info) -> str:
def resolve_customer_intent(user: Owner, info: GraphQLResolveInfo) -> Optional[str]:
Copy link
Contributor

Choose a reason for hiding this comment

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

similarly should this be deleted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants