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: Accept service less requests gq #187

Merged
merged 3 commits into from
Oct 18, 2023
Merged

Conversation

RulaKhaled
Copy link
Contributor

Purpose/Motivation

What is the feature? Why is this being done?
To be able to use TOS with service less requests, we need to update the mutation (graphql endpoints) to accept no service, and raise a proper exception otherwise.

What does this PR do?

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

  • Add new MissingService exception
  • Allow non-service based TOS mutation
  • Add tests

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.

@RulaKhaled RulaKhaled changed the title Accept service less requests ref: Accept service less requests gq Oct 12, 2023
@codecov-qa
Copy link

codecov-qa bot commented Oct 12, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (e2f2435) 95.62% compared to head (92ecc34) 95.62%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #187   +/-   ##
=======================================
  Coverage   95.62%   95.62%           
=======================================
  Files         600      600           
  Lines       15209    15219   +10     
=======================================
+ Hits        14543    14553   +10     
  Misses        666      666           
Flag Coverage Δ
unit 95.62% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 95.62% <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.

@codecov-public-qa
Copy link

codecov-public-qa bot commented Oct 12, 2023

Codecov Report

Merging #187 (92ecc34) into main (e2f2435) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #187   +/-   ##
=======================================
  Coverage   95.62%   95.62%           
=======================================
  Files         600      600           
  Lines       15209    15219   +10     
=======================================
+ Hits        14543    14553   +10     
  Misses        666      666           
Flag Coverage Δ
unit 95.62% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 95.62% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
codecov/commands/base.py 100.00% <100.00%> (ø)
codecov/commands/exceptions.py 100.00% <100.00%> (ø)
...commands/owner/interactors/save_terms_agreement.py 100.00% <100.00%> (ø)
graphql_api/actions/owner.py 100.00% <100.00%> (ø)
graphql_api/helpers/mutation.py 100.00% <ø> (ø)
graphql_api/urls.py 100.00% <ø> (ø)

Impacted file tree graph

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #187 (92ecc34) into main (e2f2435) will not change coverage.
The diff coverage is 100.00%.

@@          Coverage Diff          @@
##            main    #187   +/-   ##
=====================================
  Coverage   95.52   95.52           
=====================================
  Files        714     714           
  Lines      15615   15625   +10     
=====================================
+ Hits       14915   14925   +10     
  Misses       700     700           
Flag Coverage Δ
unit 95.62% <100.00%> (+<0.01%) ⬆️
unit-latest-uploader 95.62% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
codecov/commands/base.py 100.00% <100.00%> (ø)
codecov/commands/exceptions.py 100.00% <100.00%> (ø)
...commands/owner/interactors/save_terms_agreement.py 100.00% <100.00%> (ø)
graphql_api/actions/owner.py 100.00% <100.00%> (ø)
graphql_api/helpers/mutation.py 100.00% <ø> (ø)
graphql_api/urls.py 100.00% <ø> (ø)

self.gql_request(query, provider="", owner=current_org)
except MissingService as e:
assert str(e) == "Missing service"
raise
Copy link
Contributor

Choose a reason for hiding this comment

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

If this test is passing then maybe this error is not being rased as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why?

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 the test would error if this exception was indeed being raised

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wait i see what you mean, looking into it

@RulaKhaled RulaKhaled merged commit b156204 into main Oct 18, 2023
17 of 18 checks passed
@RulaKhaled RulaKhaled deleted the accept-service-less-requests branch October 18, 2023 12:16
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

2 participants