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

ref: Update TOS to work for service less users. #2321

Merged
merged 13 commits into from
Oct 24, 2023
Merged

ref: Update TOS to work for service less users. #2321

merged 13 commits into from
Oct 24, 2023

Conversation

RulaKhaled
Copy link
Contributor

Description

To allow users that haven't yet synced a provider to accept tos, we had to refactor the page to fire the updated serviceless mutation/handle internal user.

Notable Changes

  • Update mutation hook to fire service less request, and to send the marketing consent.
  • Update API to accept suppportsServiceless.
  • Update base layout to redirect to /terms if terms page meant to be displayed.
  • TOS to live behind a flag + have it's own route + handle the redirects.
  • TOS logic
  • Tests

Screenshots

Screen.Recording.2023-10-18.at.4.38.27.PM.mov

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.

RulaKhaled and others added 9 commits October 18, 2023 15:03
Add a feature flagged multi select to the CommitPageTabs component.

GH codecov/engineering-team#344
* feat: add patch column to the pulls list page

* uncomment development settings
…t Detail Page (#2309)

Create new commit fetching hooks for the team plan, as well as creating a new table for files changed tab on the
commit detail page for the new team plan.

GH codecov/engineering-team#633
* feat: setup pull request page to pass around selected flags in links

* Feedback, fix passing links to files+folders, additional testing

* fix file explorer test failing on href match due to new query param pass through

* airplane commit, cant check local dev server: Resolve merge issues / tests + unify codebases missed of commitSHA and commitSha to just commitSha

* Prevent multislect from collapsing + wire up PR details page to pass through flags links

* Fix accidental removal of ref on usePrefetchPullFileEntry

* Add patch column to pulls table (#2308)

* feat: add patch column to the pulls list page

* uncomment development settings

* feat: Create Team Plan Table for the Files Changed Table on the Commit Detail Page (#2309)

Create new commit fetching hooks for the team plan, as well as creating a new table for files changed tab on the
commit detail page for the new team plan.

GH codecov/engineering-team#633

---------

Co-authored-by: Adrian <adrian@codecov.io>
Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io>
@codecov-qa
Copy link

codecov-qa bot commented Oct 18, 2023

Codecov Report

Merging #2321 (d9006de) into main (0889337) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2321      +/-   ##
==========================================
- Coverage   97.26%   97.25%   -0.01%     
==========================================
  Files         721      721              
  Lines        8615     8609       -6     
  Branches     2124     2115       -9     
==========================================
- Hits         8379     8373       -6     
  Misses        233      233              
  Partials        3        3              
Files Coverage Δ
src/layouts/BaseLayout/hooks/useUserAccessGate.js 100.00% <100.00%> (ø)
src/pages/TermsOfService/TermsOfService.jsx 100.00% <100.00%> (ø)
...rc/pages/TermsOfService/hooks/useTermsOfService.ts 100.00% <100.00%> (ø)
src/services/user/useInternalUser.ts 100.00% <ø> (ø)
src/shared/api/api.js 97.56% <100.00%> (+0.26%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0889337...d9006de. Read the comment docs.

@codecov-public-qa
Copy link

codecov-public-qa bot commented Oct 18, 2023

Codecov Report

Merging #2321 (d9006de) into main (0889337) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2321      +/-   ##
==========================================
- Coverage   97.26%   97.25%   -0.01%     
==========================================
  Files         721      721              
  Lines        8615     8609       -6     
  Branches     2124     2103      -21     
==========================================
- Hits         8379     8373       -6     
  Misses        233      233              
  Partials        3        3              
Files Coverage Δ
src/layouts/BaseLayout/hooks/useUserAccessGate.js 100.00% <100.00%> (ø)
src/pages/TermsOfService/TermsOfService.jsx 100.00% <100.00%> (ø)
...rc/pages/TermsOfService/hooks/useTermsOfService.ts 100.00% <100.00%> (ø)
src/services/user/useInternalUser.ts 100.00% <ø> (ø)
src/shared/api/api.js 97.56% <100.00%> (+0.26%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0889337...d9006de. Read the comment docs.

@netlify
Copy link

netlify bot commented Oct 18, 2023

Deploy Preview for gazebo-staging ready!

Name Link
🔨 Latest commit b72198f
🔍 Latest deploy log https://app.netlify.com/sites/gazebo-staging/deploys/652feed5a2fea40008380375
😎 Deploy Preview https://deploy-preview-2321--gazebo-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #2321 (d9006de) into main (0889337) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2321   +/-   ##
=====================================
  Coverage   97.26   97.26           
=====================================
  Files        721     721           
  Lines       8615    8609    -6     
  Branches    2118    2103   -15     
=====================================
- Hits        8379    8373    -6     
+ Misses       234     233    -1     
- Partials       2       3    +1     
Files Coverage Δ
src/layouts/BaseLayout/hooks/useUserAccessGate.js 100.00% <100.00%> (ø)
src/pages/TermsOfService/TermsOfService.jsx 100.00% <100.00%> (ø)
...rc/pages/TermsOfService/hooks/useTermsOfService.ts 100.00% <100.00%> (ø)
src/services/user/useInternalUser.ts 100.00% <ø> (ø)
src/shared/api/api.js 97.56% <100.00%> (+0.26%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0889337...d9006de. Read the comment docs.

@netlify
Copy link

netlify bot commented Oct 18, 2023

Deploy Preview for gazebo-staging ready!

Name Link
🔨 Latest commit d9006de
🔍 Latest deploy log https://app.netlify.com/sites/gazebo-staging/deploys/6537c5fe39bc570008abefbb
😎 Deploy Preview https://deploy-preview-2321--gazebo-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

<TermsOfService />
</Suspense>
)
return <Redirect to="/terms" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think having a dedicated route and using redirects means the original path the user was trying to access will be lost. Example:

User comes from a PR link, hasn't signed TOS, when they sign it they're sent to the /:provider/:org not the PR they clicked on.

https://github.com/codecov/gazebo/pull/2321/files#diff-a8fba335305fed7cd0a638ac77db50888a5c94a8c0115d5cd78a00664904dec2R112

Is this a known trade off we're making?

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’s fine. we require no synced services to render this page, TOS lived under a component that used queries that serve on providers so it made sense to take it out, otherwise we would have to alter HomePageRedirect
and other components to make this happen

Copy link
Contributor Author

@RulaKhaled RulaKhaled Oct 18, 2023

Choose a reason for hiding this comment

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

Ps. Might be worth it to do the same thing for default org? sync page has it’s own dedicated route as well, I think it’s weird to jump from /terms -> /sync -> /gh But then again, default org works fine with services.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've to raised this to AJ. I (unfortunately) think loosing the navigation path is not good UX and that another approach might be needed here.. But I'll let him weigh the trade offs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure. do you mind including me in the conversation please?

Copy link
Contributor

@terry-codecov terry-codecov Oct 19, 2023

Choose a reason for hiding this comment

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

Yup for sure! I directed him to this PR actually how ever if more slacking happens we'll move to the team channel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

synced w/AJ i'll try to get it working without a new route, thought it does not effect new users but AJ believe it's good to handle too

@codecov-staging
Copy link

codecov-staging bot commented Oct 20, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@0889337). Click here to learn what that means.
The diff coverage is 100.00%.

❗ Current head 198ff06 differs from pull request most recent head d9006de. Consider uploading reports for the commit d9006de to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2321   +/-   ##
=======================================
  Coverage        ?   97.41%           
=======================================
  Files           ?      716           
  Lines           ?     8520           
  Branches        ?     2085           
=======================================
  Hits            ?     8300           
  Misses          ?      218           
  Partials        ?        2           
Files Coverage Δ
src/layouts/BaseLayout/hooks/useUserAccessGate.js 100.00% <100.00%> (ø)
src/pages/TermsOfService/TermsOfService.jsx 100.00% <100.00%> (ø)
...rc/pages/TermsOfService/hooks/useTermsOfService.ts 100.00% <100.00%> (ø)
src/services/user/useInternalUser.ts 100.00% <ø> (ø)
src/shared/api/api.js 97.56% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0889337...d9006de. Read the comment docs.

@RulaKhaled RulaKhaled marked this pull request as draft October 20, 2023 12:57
@RulaKhaled RulaKhaled marked this pull request as ready for review October 23, 2023 10:58
Copy link
Contributor

@terry-codecov terry-codecov left a comment

Choose a reason for hiding this comment

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

We can finally complete this?! 🙌

let uri = `${config.API_URL}/graphql/${provider}`

if (supportsServiceless && !provider) {
uri = `${config.API_URL}/graphql/`
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the / needed when the original one doesn't have it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yah the endpoint requires/ unlike when there are providers passed

@RulaKhaled RulaKhaled merged commit 645ec79 into main Oct 24, 2023
31 checks passed
@RulaKhaled RulaKhaled deleted the tos-refactor branch October 24, 2023 13:56
RulaKhaled added a commit that referenced this pull request Oct 31, 2023
* Update with service less requests

* Make sure hook supports service less

* feat: Add Flag MultiSelect to CommitPageTabs (#2303)

Add a feature flagged multi select to the CommitPageTabs component.

GH codecov/engineering-team#344

* Add patch column to pulls table (#2308)

* feat: add patch column to the pulls list page

* uncomment development settings

* feat: Create Team Plan Table for the Files Changed Table on the Commit Detail Page (#2309)

Create new commit fetching hooks for the team plan, as well as creating a new table for files changed tab on the
commit detail page for the new team plan.

GH codecov/engineering-team#633

* Setup pull request page to pass around selected flags (#2282)

* feat: setup pull request page to pass around selected flags in links

* Feedback, fix passing links to files+folders, additional testing

* fix file explorer test failing on href match due to new query param pass through

* airplane commit, cant check local dev server: Resolve merge issues / tests + unify codebases missed of commitSHA and commitSha to just commitSha

* Prevent multislect from collapsing + wire up PR details page to pass through flags links

* Fix accidental removal of ref on usePrefetchPullFileEntry

* Add patch column to pulls table (#2308)

* feat: add patch column to the pulls list page

* uncomment development settings

* feat: Create Team Plan Table for the Files Changed Table on the Commit Detail Page (#2309)

Create new commit fetching hooks for the team plan, as well as creating a new table for files changed tab on the
commit detail page for the new team plan.

GH codecov/engineering-team#633

---------

Co-authored-by: Adrian <adrian@codecov.io>
Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io>

* chore: Remove segment from frontend (#2314)

* Update with tests

* test with support service less

* adjust logic to handle original route

* it's fine it works with no providers

---------

Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io>
Co-authored-by: Adrian <adrian@codecov.io>
Co-authored-by: Terry <87824812+terry-codecov@users.noreply.github.com>
RulaKhaled added a commit that referenced this pull request Nov 3, 2023
* first pass, wheeeeeo

* Sorting functionality

* Update with tests

* wrap up repos list:

* Spelling correction (#2336)

* 616 add patch setction pr page team tier (#2337)

* feat: add header component for team tier customers

* feat: converted Header.jsx to Header.tsx + tests

* fix: add comparison schema types

* fix: Filter out certain browser from sending events to Sentry (#2338)

Filter out events for a given browser because they don't have all JS functions fully implemented causing issues that we cannot address.

* feat: Hide Flag MultiSelect when on Team Plan on Commit Detail Page (#2327)

We will need to hide the flag multi select on the commit detail page when the user is on the team plan as they are not an available feature to those users.

GH codecov/engineering-team#687

* feat, ref: Disable Flag MultiSelect on Coverage Tab when on a Team Plan (#2329)

Disable the flag multi-select on the coverage tab when users/orgs are on a team plan.

GH codecov/engineering-team#685

* feat: Grab flags in IndirectChangesTable and pass along with request (#2335)

Update indirect changes tab on the commit detail page to grab flags from the url params and pass along as query args.

GH codecov/engineering-team#348

* feat: Update CommitDetailPage FilesChangedTable to pass along flags (#2334)

Update the files changed tab on the commit detail page to grab flags url param and pass along as query args.

GH codecov/engineering-team#347

* ref: Update TOS to work for service less users. (#2321)

* Update with service less requests

* Make sure hook supports service less

* feat: Add Flag MultiSelect to CommitPageTabs (#2303)

Add a feature flagged multi select to the CommitPageTabs component.

GH codecov/engineering-team#344

* Add patch column to pulls table (#2308)

* feat: add patch column to the pulls list page

* uncomment development settings

* feat: Create Team Plan Table for the Files Changed Table on the Commit Detail Page (#2309)

Create new commit fetching hooks for the team plan, as well as creating a new table for files changed tab on the
commit detail page for the new team plan.

GH codecov/engineering-team#633

* Setup pull request page to pass around selected flags (#2282)

* feat: setup pull request page to pass around selected flags in links

* Feedback, fix passing links to files+folders, additional testing

* fix file explorer test failing on href match due to new query param pass through

* airplane commit, cant check local dev server: Resolve merge issues / tests + unify codebases missed of commitSHA and commitSha to just commitSha

* Prevent multislect from collapsing + wire up PR details page to pass through flags links

* Fix accidental removal of ref on usePrefetchPullFileEntry

* Add patch column to pulls table (#2308)

* feat: add patch column to the pulls list page

* uncomment development settings

* feat: Create Team Plan Table for the Files Changed Table on the Commit Detail Page (#2309)

Create new commit fetching hooks for the team plan, as well as creating a new table for files changed tab on the
commit detail page for the new team plan.

GH codecov/engineering-team#633

---------

Co-authored-by: Adrian <adrian@codecov.io>
Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io>

* chore: Remove segment from frontend (#2314)

* Update with tests

* test with support service less

* adjust logic to handle original route

* it's fine it works with no providers

---------

Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io>
Co-authored-by: Adrian <adrian@codecov.io>
Co-authored-by: Terry <87824812+terry-codecov@users.noreply.github.com>

* restructure folders anticipating second header component for team tier (#2340)

* feat: add hook for commit detail page team tier (#2341)

* build: Update PostCSS (#2346)

Update PostCSS dependency.

* Migrate TextInput to TypeScript (#2342)

* Migrate textinput to TS

* Add story

* formatting

* organize imports

* Connect flag selector to flags filter on PR details page (#2343)

* feat: Update impacted files resolver for use pull, connect the flag selector to the api.

* update missing logic as requested + unknown flags message to be aligned with repo overview design

* Noticed the changing the pull query broke impacted files while smoke testing, dupicated the same compatibility work for the new resolver.

* Refactor to use a impacted files enum as requested.

* fix: Attempting to fix CommitDetailPage and RepoPage Tests (#2350)

Addressing flaky tests in CommitDetailPage and RepoPage.

* Add patch section commit detail page team tier (#2344)

* restructure folders anticipating second header component for team tier

* feat: add patch coverage section to commit detail page for team tier customer

* fix: rename HeaderDefault to HeaderTeam for team file

* Convert Sparkline to typescript (#2347)

* Convert sparkline to typescript

* Consistent type defs

* better variable names

* use enum

* quick fixes

* Update use memo

* Update tests with getSortingOption

* pull out the function of the test block

---------

Co-authored-by: Joe Becher <joe@codecov.io>
Co-authored-by: Adrian <adrian@codecov.io>
Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io>
Co-authored-by: Terry <87824812+terry-codecov@users.noreply.github.com>
Co-authored-by: Rohit Vinnakota <148245014+rohitvinnakota-codecov@users.noreply.github.com>
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.

None yet

4 participants