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

GraphQL-based quilt3.admin API #3990

Merged
merged 52 commits into from
Jun 18, 2024
Merged

GraphQL-based quilt3.admin API #3990

merged 52 commits into from
Jun 18, 2024

Conversation

sir-sigurd
Copy link
Member

@sir-sigurd sir-sigurd commented Jun 4, 2024

Description

TODO

  • better exceptions
  • fix ImportError: cannot import name 'Annotated' from 'typing' (drop Python 3.8?)
  • wrap dates?
  • docstrings
  • type docstrings
  • adminql -> admin
  • add requirements.txt
  • CI
  • Unit tests
  • Documentation
  • Changelog entry (skip if change is not significant to end users, e.g. docs only)

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 88.25911% with 87 lines in your changes missing coverage. Please review.

Project coverage is 37.46%. Comparing base (64e081c) to head (e38e644).
Report is 4 commits behind head on master.

Files Patch % Lines
...python/quilt3/admin/_graphql_client/base_client.py 26.74% 63 Missing ⚠️
.../python/quilt3/admin/_graphql_client/exceptions.py 55.00% 18 Missing ⚠️
.../python/quilt3/admin/_graphql_client/base_model.py 69.23% 4 Missing ⚠️
api/python/quilt3/admin/users.py 98.03% 1 Missing ⚠️
api/python/tests/test_admin_api.py 98.98% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3990      +/-   ##
==========================================
+ Coverage   36.68%   37.46%   +0.77%     
==========================================
  Files         724      746      +22     
  Lines       32254    32717     +463     
  Branches     4773     4604     -169     
==========================================
+ Hits        11833    12256     +423     
- Misses      19259    19798     +539     
+ Partials     1162      663     -499     
Flag Coverage Δ
api-python 90.62% <88.25%> (-0.33%) ⬇️
catalog 10.71% <ø> (+<0.01%) ⬆️
lambda 88.18% <ø> (+0.21%) ⬆️

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.

@drernie
Copy link
Member

drernie commented Jun 6, 2024

This looks great! I assume in the final version it will be something like "quilt3.admin"; 'adminql' is too much information

My main concern is that I find the name and type of "role" confusing; when do I use a role_id vs a role_name?

Is it possible to:

  • standardize on only one
  • change the argument names to be clearer which is which
  • make the type explicit enough to distinguish (rather than just "str")

@sir-sigurd sir-sigurd requested a review from nl0 June 7, 2024 14:03
@sir-sigurd sir-sigurd force-pushed the quilt3-admin branch 3 times, most recently from 5c4dcae to 6f51e65 Compare June 14, 2024 13:01
@sir-sigurd
Copy link
Member Author

CI currently fail because of jd/tenacity#471

@sir-sigurd
Copy link
Member Author

@nl0
does it make sense to rename some functions
set_role -> set_user_role
add_roles -> add_user_roles
remove_roles -> remove_user_roles
?

or maybe use prefixes for consistency? i.e.

get_user -> user_get
get_users -> user_list
set_role -> user_set_role
?

@sir-sigurd sir-sigurd marked this pull request as ready for review June 17, 2024 10:29
@sir-sigurd sir-sigurd requested a review from nl0 June 17, 2024 10:29
@nl0
Copy link
Member

nl0 commented Jun 17, 2024

does it make sense to rename some functions?

yeah i think so

or maybe use prefixes for consistency? i.e.

that feels like a good intent, but the resulting names don't look too nice, so... your call.
imo it would look nice if we had some sort of a namespace (e.g. admin.users.list or smth, idk)

@sir-sigurd
Copy link
Member Author

imo it would look nice if we had some sort of a namespace (e.g. admin.users.list or smth, idk)

I made this change

@sir-sigurd sir-sigurd requested a review from akarve June 17, 2024 13:54
docs/CHANGELOG.md Outdated Show resolved Hide resolved
nl0
nl0 previously approved these changes Jun 17, 2024
Copy link
Member

@nl0 nl0 left a comment

Choose a reason for hiding this comment

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

looks good

@sir-sigurd sir-sigurd added this pull request to the merge queue Jun 18, 2024
Merged via the queue into master with commit e52303c Jun 18, 2024
36 of 39 checks passed
@sir-sigurd sir-sigurd deleted the quilt3-admin branch June 18, 2024 05:57
nl0 added a commit that referenced this pull request Jun 18, 2024
* master:
  Quilt3 v6.0.0a4 (#4007)
  GraphQL-based quilt3.admin API (#3990)
  Bump urllib3 from 1.26.18 to 1.26.19 in /lambdas/pkgevents (#4006)
  Bump urllib3 from 1.26.18 to 1.26.19 in /lambdas/status_reports (#4005)
  Calculate checksum from local file if upload optimization succeeds (#3968)
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.

4 participants