-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add GraphQL Queries for Managing the IP Allow List (and Other Small Usability Fixes) #757
base: master
Are you sure you want to change the base?
Conversation
Adding some GraphQL queries for managing the IP allow list feature in github.com. These queries include: - a query for getting the IP allow list configuration for an enterprise. - a query for getting the IP allow list configuration for an organization. - a query for adding an IP address to an IP allow list. - a query for removing an IP address from an IP allow list. - a query for enabling an IP allow list. - a query for disabling an IP allow list.
The previous file names were a bit disorganised (some had numbers in the beginning, while some had the scope between the file name). This commit addresses this to ensure that consumers are able to identify which GraphQL file to look for based on their needs.
The existing variables are too specific to the GitHub org. This commit addresses this in the following files: - org-repos-fragment-directive-2.graphql - org-repos-fragment-directive.graphql --- In addition, the following files have references to variable usage, but was not explicitly declared anywhere: - enterprise-saml-identities.graphql - org-branches-and-commits-by-repository.graphql - org-members-by-team.graphql - org-pr-merged-info-by-repository.graphql - repo-get-all-branches.graphql - repos-get-last-issue-comment.graphql I've updated the above files to just use simple strings to replace prior to using the queries in them.
I noticed from another PR that we are using `ORG_NAME` for generic organization variables. This commit updates all the queries to use `ORG_NAME` instead of `ORGANIZATION_SLUG` to be consistent with the rest of the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested all the queries and mutations and they work and look great, thanks for your effort cleaning up as well.
One thing I want to note is the clientMutationId: "true"
, this input is "always added, but it’s not passed to the resolve method. The value is re-inserted to the response. (It’s for client libraries to manage optimistic updates.)" per https://graphql-ruby.org/api-doc/1.8.13/GraphQL/Schema/RelayClassicMutation e.g.
That means to me that it is not necessary to pass (as I've tested as well for at least one mutation), but it also might be confusing to set this to "true"
as this is not a boolean. Maybe we should either remove it, or replace it with a placeholder like "CLIENT_MUTATION_ID"
to make sure this is understood as it should be?
Otherwise I am happy to 👍🏻
This variable is always added, so it is not necessary to set it manually. Reference doc: https://graphql-ruby.org/api-doc/1.8.13/GraphQL/Schema/RelayClassicMutation Thanks to @sn2b for pointing this out!
Added new queries to separately enable and disable IP allow lists for GitHub Apps only and IP addresses only.
This pull request introduces several new GraphQL queries and mutations to manage IP allow lists for organizations and enterprise accounts. The changes include adding, enabling, disabling, and removing IP allow list entries, as well as renaming some existing query files for better clarity.
IP Allow List Management:
graphql/queries/enterprise-get-ip-allow-list.graphql
).graphql/queries/ip-allow-list-add-ip.graphql
).graphql/queries/ip-allow-list-disable-github-apps-only.graphql
).graphql/queries/ip-allow-list-disable-ip-address-only.graphql
).graphql/queries/ip-allow-list-enable.graphql
).SAML Identity Management:
graphql/queries/enterprise-saml-identities.graphql
).General Query Updates:
ISSUE_ID
(graphql/queries/issue-add-comment.graphql
).graphql/queries/org-branches-and-commits-by-repository.graphql
).graphql/queries/org-get-ip-allow-list.graphql
).graphql/queries/org-members-by-team.graphql
).Renaming for Clarity:
graphql/queries/enterprise-saml-identities.graphql
: Renamed fromgraphql/queries/saml-identities-enterprise-level.graphql
for better clarity.graphql/queries/issue-add-comment.graphql
: Renamed fromgraphql/queries/11-mutation-issue-comment-add.graphql
for better clarity.graphql/queries/org-branches-and-commits-by-repository.graphql
: Renamed fromgraphql/queries/branches-and-commits-by-repository.graphql
for better clarity.graphql/queries/org-pr-merged-info-by-repository.graphql
: Renamed fromgraphql/queries/pr-merged-info-by-repository.graphql
for better clarity.graphql/queries/org-repos-fragment-directive-2.graphql
: Renamed fromgraphql/queries/9-org-repos-fragment-directive-2.graphql
for better clarity.