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: Create logic for OKTA banners #3043

Merged
merged 3 commits into from
Jul 26, 2024
Merged

feat: Create logic for OKTA banners #3043

merged 3 commits into from
Jul 26, 2024

Conversation

RulaKhaled
Copy link
Contributor

@RulaKhaled RulaKhaled commented Jul 21, 2024

Description

Conditionally render OKTA banners according to enabled/enforced settings.

NOTE: keeping this as a draft until we have the API work ready

Notable Changes

  • Created okta banners logic
  • Tests

Screenshots

nothing visual changed.

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 Jul 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3043   +/-   ##
=======================================
  Coverage   98.36%   98.36%           
=======================================
  Files         914      915    +1     
  Lines       13604    13615   +11     
  Branches     3657     3687   +30     
=======================================
+ Hits        13382    13393   +11     
  Misses        218      218           
  Partials        4        4           
Files Coverage Δ
...ntSettings/tabs/OktaAccess/hooks/useOktaConfig.tsx 100.00% <ø> (ø)
src/shared/GlobalTopBanners/GlobalTopBanners.tsx 100.00% <100.00%> (ø)
...hared/GlobalTopBanners/OktaBanners/OktaBanners.tsx 100.00% <100.00%> (ø)
...TopBanners/OktaEnabledBanner/OktaEnabledBanner.tsx 100.00% <ø> (ø)
...pBanners/OktaEnforcedBanner/OktaEnforcedBanner.tsx 100.00% <ø> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.71% <ø> (ø)
Pages 99.16% <ø> (ø)
Services 99.47% <ø> (ø)
Shared 99.69% <100.00%> (+<0.01%) ⬆️
UI 94.36% <ø> (ø)

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 bb1d052...4129a3f. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Jul 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.36%. Comparing base (bb1d052) to head (4129a3f).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3043   +/-   ##
=======================================
  Coverage   98.36%   98.36%           
=======================================
  Files         914      915    +1     
  Lines       13604    13615   +11     
  Branches     3679     3610   -69     
=======================================
+ Hits        13382    13393   +11     
  Misses        218      218           
  Partials        4        4           
Files Coverage Δ
...ntSettings/tabs/OktaAccess/hooks/useOktaConfig.tsx 100.00% <ø> (ø)
src/shared/GlobalTopBanners/GlobalTopBanners.tsx 100.00% <100.00%> (ø)
...hared/GlobalTopBanners/OktaBanners/OktaBanners.tsx 100.00% <100.00%> (ø)
...TopBanners/OktaEnabledBanner/OktaEnabledBanner.tsx 100.00% <ø> (ø)
...pBanners/OktaEnforcedBanner/OktaEnforcedBanner.tsx 100.00% <ø> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.71% <ø> (ø)
Pages 99.16% <ø> (ø)
Services 99.47% <ø> (ø)
Shared 99.69% <100.00%> (+<0.01%) ⬆️
UI 94.36% <ø> (ø)

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 bb1d052...4129a3f. Read the comment docs.

Copy link

codecov bot commented Jul 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.36%. Comparing base (bb1d052) to head (4129a3f).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##               main      #3043   +/-   ##
===========================================
  Coverage   98.36000   98.36000           
===========================================
  Files           914        915    +1     
  Lines         13604      13615   +11     
  Branches       3657       3687   +30     
===========================================
+ Hits          13382      13393   +11     
  Misses          218        218           
  Partials          4          4           
Files Coverage Δ
...ntSettings/tabs/OktaAccess/hooks/useOktaConfig.tsx 100.00% <ø> (ø)
src/shared/GlobalTopBanners/GlobalTopBanners.tsx 100.00% <100.00%> (ø)
...hared/GlobalTopBanners/OktaBanners/OktaBanners.tsx 100.00% <100.00%> (ø)
...TopBanners/OktaEnabledBanner/OktaEnabledBanner.tsx 100.00% <ø> (ø)
...pBanners/OktaEnforcedBanner/OktaEnforcedBanner.tsx 100.00% <ø> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.71% <ø> (ø)
Pages 99.16% <ø> (ø)
Services 99.47% <ø> (ø)
Shared 99.69% <100.00%> (+<0.01%) ⬆️
UI 94.36% <ø> (ø)

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 bb1d052...4129a3f. Read the comment docs.

Copy link

codecov-public-qa bot commented Jul 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.36%. Comparing base (bb1d052) to head (4129a3f).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3043   +/-   ##
=======================================
  Coverage   98.36%   98.36%           
=======================================
  Files         914      915    +1     
  Lines       13604    13615   +11     
  Branches     3679     3682    +3     
=======================================
+ Hits        13382    13393   +11     
  Misses        218      218           
  Partials        4        4           
Files Coverage Δ
...ntSettings/tabs/OktaAccess/hooks/useOktaConfig.tsx 100.00% <ø> (ø)
src/shared/GlobalTopBanners/GlobalTopBanners.tsx 100.00% <100.00%> (ø)
...hared/GlobalTopBanners/OktaBanners/OktaBanners.tsx 100.00% <100.00%> (ø)
...TopBanners/OktaEnabledBanner/OktaEnabledBanner.tsx 100.00% <ø> (ø)
...pBanners/OktaEnforcedBanner/OktaEnforcedBanner.tsx 100.00% <ø> (ø)
Components Coverage Δ
Assets 53.84% <ø> (ø)
Layouts 97.71% <ø> (ø)
Pages 99.16% <ø> (ø)
Services 99.47% <ø> (ø)
Shared 99.69% <100.00%> (+<0.01%) ⬆️
UI 94.36% <ø> (ø)

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 bb1d052...4129a3f. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented Jul 21, 2024

Bundle Report

Changes will increase total bundle size by 5.77kB ⬆️

Bundle name Size Change
gazebo-staging-array-push 5.87MB 5.77kB ⬆️

Copy link

codecov bot commented Jul 21, 2024

Bundle Report

Changes will increase total bundle size by 5.77kB ⬆️

Bundle name Size Change
gazebo-production-array-push 5.87MB 5.77kB ⬆️

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Jul 21, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
b933a28 Sun, 21 Jul 2024 11:20:23 GMT Expired Expired
4129a3f Mon, 22 Jul 2024 08:52:14 GMT Cloud Enterprise

@RulaKhaled RulaKhaled marked this pull request as ready for review July 25, 2024 17:58

const oktaConfig = data?.owner?.account?.oktaConfig

if (!owner || !oktaConfig?.enabled || !data?.owner?.isUserOktaAuthenticated)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can potentially move the !owner call to before the hook if we want to avoid calling the hook

Its a slight perf upgrade, not sure how much its worth in practice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't unconditionally call a hook!

@RulaKhaled RulaKhaled added this pull request to the merge queue Jul 26, 2024
Merged via the queue into main with commit 7b6fa54 Jul 26, 2024
61 checks passed
@RulaKhaled RulaKhaled deleted the show-okta-banners branch July 26, 2024 11:49
Copy link

sentry-io bot commented Jul 29, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: Cannot read properties of undefined (reading 'json') /:provider/:owner/:repo/pull/:pullId View Issue

Did you find this useful? React with a 👍 or 👎

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