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: Update owner query with isOktaAuthenticated field #670

Merged
merged 15 commits into from
Jul 25, 2024

Conversation

RulaKhaled
Copy link
Contributor

Purpose/Motivation

What is the feature? Why is this being done?
We need this as a flag to tell if current user is OKTA authenticated to display okta banners

Links to relevant tickets

codecov/engineering-team#2053

What does this PR do?

Include a brief description of the changes in this PR. Bullet points are your friend.

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.

@codecov-staging
Copy link

codecov-staging bot commented Jul 10, 2024

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.70%. Comparing base (2562256) to head (720d324).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main     #670   +/-   ##
=======================================
  Coverage   91.70%   91.70%           
=======================================
  Files         633      632    -1     
  Lines       17010    17014    +4     
=======================================
+ Hits        15599    15603    +4     
  Misses       1411     1411           
Flag Coverage Δ
unit 91.70% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.70% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
codecov_auth/views/okta_cloud.py 100.00% <100.00%> (ø)
graphql_api/tests/helper.py 100.00% <100.00%> (ø)
graphql_api/types/owner/owner.py 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

Copy link

codecov-public-qa bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.70%. Comparing base (2562256) to head (720d324).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #670   +/-   ##
=======================================
  Coverage   91.70%   91.70%           
=======================================
  Files         633      632    -1     
  Lines       17010    17014    +4     
=======================================
+ Hits        15599    15603    +4     
  Misses       1411     1411           
Flag Coverage Δ
unit 91.70% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.70% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
codecov_auth/views/okta_cloud.py 100.00% <100.00%> (ø)
graphql_api/tests/helper.py 100.00% <100.00%> (ø)
graphql_api/types/owner/owner.py 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

Impacted file tree graph

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.01%. Comparing base (2562256) to head (720d324).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##               main       #670   +/-   ##
===========================================
  Coverage   96.01000   96.01000           
===========================================
  Files           813        814    +1     
  Lines         18347      18365   +18     
===========================================
+ Hits          17615      17633   +18     
  Misses          732        732           
Flag Coverage Δ
unit 91.70% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 91.70% <100.00%> (+<0.01%) ⬆️

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.

@RulaKhaled RulaKhaled marked this pull request as ready for review July 25, 2024 10:50
@RulaKhaled RulaKhaled requested a review from a team as a code owner July 25, 2024 10:50
@michelletran-codecov michelletran-codecov dismissed their stale review July 25, 2024 15:57

Session key is incorrect

@require_part_of_org
def resolve_is_user_okta_authenticated(owner: Owner, info) -> bool:
okta_signed_in_accounts = info.context["request"].session.get(
"okta_signed_in_accounts",
Copy link
Contributor

Choose a reason for hiding this comment

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

The session key value is incorrect. I think it's actually okta_logged_in_accounts (the variable is OKTA_SIGNED_IN_ACCOUNTS, which is bad on my part).

I would suggest to import the variable rather than hard-coding the session key here to avoid the mismatch in different parts of the code:

OKTA_SIGNED_IN_ACCOUNTS_SESSION_KEY = "okta_logged_in_accounts"

(also, feel free to update the variable name or the value stored in the session, as it's inconsistent and I missed it).

@RulaKhaled RulaKhaled enabled auto-merge July 25, 2024 17:36
@RulaKhaled RulaKhaled added this pull request to the merge queue Jul 25, 2024
Merged via the queue into main with commit e85b89e Jul 25, 2024
21 of 22 checks passed
@RulaKhaled RulaKhaled deleted the is-okta-authenticated branch July 25, 2024 17:57
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