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: Set token required in Tokenless section under org upload token #3366

Merged
merged 10 commits into from
Oct 11, 2024

Conversation

RulaKhaled
Copy link
Contributor

@RulaKhaled RulaKhaled commented Oct 8, 2024

Description

Hook up API work with tokenless section under org upload token tab.

depends on:

Notable Changes

  • New mutation hook
  • Hook up api work with section
  • A lot of tests

Screenshots

Nothing visual changed, notification on a successful mutation is sent:

Screen.Recording.2024-10-09.at.10.53.25.AM.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.

@codecov-staging
Copy link

codecov-staging bot commented Oct 8, 2024

Bundle Report

Changes will increase total bundle size by 2.95kB (0.05%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-array-push 6.13MB 2.95kB (0.05%) ⬆️

Copy link

codecov bot commented Oct 8, 2024

Bundle Report

Changes will increase total bundle size by 2.95kB (0.05%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-array-push 6.13MB 2.95kB (0.05%) ⬆️

@codecov-qa
Copy link

codecov-qa bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.16%. Comparing base (292f404) to head (967a5be).
Report is 9 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ken/TokenlessSection/useSetUploadTokenRequired.tsx 89.47% 2 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3366      +/-   ##
==========================================
- Coverage   99.17%   99.16%   -0.02%     
==========================================
  Files         802      804       +2     
  Lines       14139    14185      +46     
  Branches     3896     3911      +15     
==========================================
+ Hits        14022    14066      +44     
- Misses        108      110       +2     
  Partials        9        9              
Files with missing lines Coverage Δ
...ploadToken/TokenlessSection/TokenRequiredModal.tsx 100.00% <100.00%> (ø)
...gUploadToken/TokenlessSection/TokenlessSection.tsx 100.00% <100.00%> (ø)
...rvices/navigation/useNavLinks/useStaticNavLinks.js 98.80% <100.00%> (+0.01%) ⬆️
...ken/TokenlessSection/useSetUploadTokenRequired.tsx 89.47% <89.47%> (ø)

... and 3 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.93% <94.73%> (-0.02%) ⬇️
Services 99.45% <100.00%> (+<0.01%) ⬆️
Shared 99.80% <ø> (ø)
UI 99.10% <ø> (ø)

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 292f404...967a5be. Read the comment docs.

Copy link

codecov-public-qa bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.16%. Comparing base (292f404) to head (967a5be).
Report is 5 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3366      +/-   ##
==========================================
- Coverage   99.17%   99.16%   -0.02%     
==========================================
  Files         802      804       +2     
  Lines       14139    14185      +46     
  Branches     3901     3911      +10     
==========================================
+ Hits        14022    14066      +44     
- Misses        108      110       +2     
  Partials        9        9              
Files Coverage Δ
...ploadToken/TokenlessSection/TokenRequiredModal.tsx 100.00% <100.00%> (ø)
...gUploadToken/TokenlessSection/TokenlessSection.tsx 100.00% <100.00%> (ø)
...rvices/navigation/useNavLinks/useStaticNavLinks.js 98.80% <100.00%> (+0.01%) ⬆️
...ken/TokenlessSection/useSetUploadTokenRequired.tsx 89.47% <89.47%> (ø)

... and 3 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.93% <94.73%> (-0.02%) ⬇️
Services 99.45% <100.00%> (+<0.01%) ⬆️
Shared 99.80% <ø> (ø)
UI 99.10% <ø> (ø)

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 292f404...967a5be. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ken/TokenlessSection/useSetUploadTokenRequired.tsx 89.47% 2 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3366      +/-   ##
==========================================
- Coverage   99.17%   99.16%   -0.02%     
==========================================
  Files         802      804       +2     
  Lines       14139    14185      +46     
  Branches     3901     3911      +10     
==========================================
+ Hits        14022    14066      +44     
- Misses        108      110       +2     
  Partials        9        9              
Files with missing lines Coverage Δ
...ploadToken/TokenlessSection/TokenRequiredModal.tsx 100.00% <100.00%> (ø)
...gUploadToken/TokenlessSection/TokenlessSection.tsx 100.00% <100.00%> (ø)
...rvices/navigation/useNavLinks/useStaticNavLinks.js 98.80% <100.00%> (+0.01%) ⬆️
...ken/TokenlessSection/useSetUploadTokenRequired.tsx 89.47% <89.47%> (ø)

... and 3 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.93% <94.73%> (-0.02%) ⬇️
Services 99.45% <100.00%> (+<0.01%) ⬆️
Shared 99.80% <ø> (ø)
UI 99.10% <ø> (ø)

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 292f404...967a5be. Read the comment docs.

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.16%. Comparing base (292f404) to head (967a5be).
Report is 9 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ken/TokenlessSection/useSetUploadTokenRequired.tsx 89.47% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3366      +/-   ##
==========================================
- Coverage   99.17%   99.16%   -0.02%     
==========================================
  Files         802      804       +2     
  Lines       14139    14185      +46     
  Branches     3901     3906       +5     
==========================================
+ Hits        14022    14066      +44     
- Misses        108      110       +2     
  Partials        9        9              
Files with missing lines Coverage Δ
...ploadToken/TokenlessSection/TokenRequiredModal.tsx 100.00% <100.00%> (ø)
...gUploadToken/TokenlessSection/TokenlessSection.tsx 100.00% <100.00%> (ø)
...rvices/navigation/useNavLinks/useStaticNavLinks.js 98.80% <100.00%> (+0.01%) ⬆️
...ken/TokenlessSection/useSetUploadTokenRequired.tsx 89.47% <89.47%> (ø)

... and 3 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.93% <94.73%> (-0.02%) ⬇️
Services 99.45% <100.00%> (+<0.01%) ⬆️
Shared 99.80% <ø> (ø)
UI 99.10% <ø> (ø)

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 292f404...967a5be. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Oct 9, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
326a561 Wed, 09 Oct 2024 08:57:10 GMT Expired Expired
625dc4a Wed, 09 Oct 2024 09:24:50 GMT Expired Expired
d78982f Wed, 09 Oct 2024 09:38:38 GMT Expired Expired
d44f87d Wed, 09 Oct 2024 10:35:34 GMT Expired Expired
967a5be Thu, 10 Oct 2024 03:44:56 GMT Cloud Enterprise

@RulaKhaled RulaKhaled marked this pull request as ready for review October 9, 2024 16:22
}
})

const mockedUseFlags = useFlags as jest.Mock
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 we may need to swap these to vi.mock() similar to this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

if (
!isUploadTokenRequiredLoading &&
uploadTokenRequiredData &&
uploadTokenRequiredData?.uploadTokenRequired !== null
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: if we're checking for uploadTokenRequiredData I think we don't need the ? on uploadTokenRequiredData?.uploadTokenRequired

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TS is weird, this actually tests if it's set to boolean, if i just do uploadTokenRequiredData?.uploadTokenRequired !== null and set it to uploadTokenRequiredData?.uploadTokenRequired it complains about a nullable value:
Screenshot 2024-10-10 at 5 29 32 AM
Screenshot 2024-10-10 at 5 29 29 AM

})
}
},
onError: () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

weird how it says this line is uncovered when you specifically have a test for 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.

I KNOW RIGHT

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 have some feedback for codecov..

Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

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

couple small comments but nothing blocking

@RulaKhaled RulaKhaled added this pull request to the merge queue Oct 11, 2024
Merged via the queue into main with commit f3dbf03 Oct 11, 2024
49 of 62 checks passed
@RulaKhaled RulaKhaled deleted the set-tokenless-changes branch October 11, 2024 12:35
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.

3 participants