-
Notifications
You must be signed in to change notification settings - Fork 768
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
Use graphql rather than rest API for Github team membership #1786
Conversation
This PR is causing integration test failures for me locally:
Can you reproduce this? |
Hi @kfcampbell I can run the tests but I feel like I am struggling with the test setup required for this PR because I am seeing that error on the main branch as well as on my branch... I have a test organisation and I even made a test user but can't seem to get the setup to work with the correct env vars etc. Could I get some guidance? Thank! |
Hi. I ran into the issue that required this PR, so I'm interested in getting this merged. I ran the acceptance test locally and ran into the same issue @kfcampbell described, but I think the issue stems from the fact that team membership is not returned on the API if organization membership has not been accepted yet. This comment in the original PR for
The way I got my acceptance test to run successfully locally is by setting env |
I can confirm that @jsifuentes is absolutely right and the only way to make this test work is by using a user that you have already added to the organization as a member. I have done this and it works and tests pass. I'm not sure how the maintainers wish to proceed on this. @kfcampbell do you have any thoughts? |
This change should provide better diffing for team membership for teams with child teams. Currently, child team members are included in the parent team's members list and so diffs are incorrect. See [Issue 1193](integrations#1193).
9aae4aa
to
d05bb3d
Compare
Thank you both! I've been able to confirm acceptance tests are passing now. I appreciate the work here! |
This doesn't appear to do paging, cutting off teams at 100 members and making the plan think it needs to add a bunch of new members. |
…ions#1786) This change should provide better diffing for team membership for teams with child teams. Currently, child team members are included in the parent team's members list and so diffs are incorrect. See [Issue 1193](integrations#1193).
Add docs, update tests, small changes to rulesets octoherd: delete pull_request_template.md feat: add pull_request_template.md PR template feat: add data source to get organization members' SAML/SCIM linked identities (integrations#1778) * add `github_organization_external_identities` which returns a list of github organization members and their SAML linked identity * add docs * add more fields to external_identities * docs --------- Co-authored-by: Keegan Campbell <me@kfcampbell.com> fix: Github Environments Policy feature causing the provider to produce inconsistent result (integrations#1799) * Add deployment policy resource - Add the initial code to manage the resource - Add sample configuration used to test it TODO - Documentation - Tests * Add schema description * Fix creation of resource ID * Add tests * Add documentation * Add terraform import support * Undo example add * Fix formatting * PR feedback * fix: environment branch policy failing to find the created resource The `Read` operation of the Environments Branch Policy resource was failing to find the newly created Branch policies, due to wrongly encoded environment name. Which cause the provider to be inconsistent. This fix uses `url.PathEscape` instead of `url.QueryEscape` since we are using path parameters with the Github API in that case. Additionally 2 operations - `Read` and `Delete` don't need to use it as they receive the environment name already parsed and attempting to encode it again breaks the name. * Fix incorrect merge --------- Co-authored-by: Massimiliano Donini <massimiliano.donini@gmail.com> Co-authored-by: Keegan Campbell <me@kfcampbell.com> Enforce valid chars in repo name (integrations#1806) * Enforce valid chars in repo name Signed-off-by: Benoit Donneaux <ben@tergology.com> * Add dash to validate repo name Signed-off-by: Benoit Donneaux <ben@tergology.com> * Better name validation message Signed-off-by: Benoit Donneaux <ben@tergology.com> * Test repo name max length Signed-off-by: Benoit Donneaux <ben@tergology.com> * Test space in repo name Signed-off-by: Benoit Donneaux <ben@tergology.com> --------- Signed-off-by: Benoit Donneaux <ben@tergology.com> Co-authored-by: Keegan Campbell <me@kfcampbell.com> Use graphql rather than rest API for Github team membership (integrations#1786) This change should provide better diffing for team membership for teams with child teams. Currently, child team members are included in the parent team's members list and so diffs are incorrect. See [Issue 1193](integrations#1193). feat: add immediate-response.yml auto responder workflow build(deps): bump peter-evans/create-or-update-comment Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 6534843181fc2aeb7f9f1cd3cd4a7b956cada2db to 716151b9579b05352dbf244d48e968d211889bbc. - [Release notes](https://github.com/peter-evans/create-or-update-comment/releases) - [Commits](peter-evans/create-or-update-comment@6534843...716151b) --- updated-dependencies: - dependency-name: peter-evans/create-or-update-comment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Add Codespaces Organization Secret Repositories Resource. Add depends_on to prevent branch policy being created before the corresponding environment (which results in an error), add more detail about the error thrown if deployment_branch_policy.custom_branch_policies is not set to true, tf fmt example build(deps): bump peter-evans/create-or-update-comment (integrations#1830) Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 716151b9579b05352dbf244d48e968d211889bbc to 38217c6b94b54c0dbbe75be237257364e2dd2e62. - [Release notes](https://github.com/peter-evans/create-or-update-comment/releases) - [Commits](peter-evans/create-or-update-comment@716151b...38217c6) --- updated-dependencies: - dependency-name: peter-evans/create-or-update-comment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> build(deps): bump golang.org/x/crypto from 0.11.0 to 0.12.0 (integrations#1829) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.11.0 to 0.12.0. - [Commits](golang/crypto@v0.11.0...v0.12.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Keegan Campbell <me@kfcampbell.com> build(deps): bump golang.org/x/oauth2 from 0.10.0 to 0.11.0 (integrations#1828) Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.10.0 to 0.11.0. - [Commits](golang/oauth2@v0.10.0...v0.11.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> fix: `github_repository_collaborators` - mark `invitation_ids` as changed when new user invited (integrations#1825) * fix: mark invitation_ids as changed if new user is invited * fix: documentation --------- Co-authored-by: Keegan Campbell <me@kfcampbell.com> feat: expose SAML external identity exposed for GitHub user (integrations#1796) * create github_user_external_identity datasource * add scim information and error handling for bad username org combo * cleanup commentzs * add docs for external identity * move external identity to its own struct * add variable to make referencing external identity easier * add test * add documentation * remove old docs * add docs reference in github.erb --------- Co-authored-by: Keegan Campbell <me@kfcampbell.com> Do not change squash_merge/merge_commit if it is not allowed in conf (integrations#1834) Co-authored-by: Keegan Campbell <me@kfcampbell.com> build(deps): bump peter-evans/create-or-update-comment Bumps [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment) from 38217c6b94b54c0dbbe75be237257364e2dd2e62 to 5f22cb87da9514ab329de42e5462372dc19928a5. - [Release notes](https://github.com/peter-evans/create-or-update-comment/releases) - [Commits](peter-evans/create-or-update-comment@38217c6...5f22cb8) --- updated-dependencies: - dependency-name: peter-evans/create-or-update-comment dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> add primary_language to repository datasource add primary_language to repository resource add test to repository datasource add docs for primary_language change add test for resource update name of testcase run linting update comment Update to go-github v54
…ions#1786) This change should provide better diffing for team membership for teams with child teams. Currently, child team members are included in the parent team's members list and so diffs are incorrect. See [Issue 1193](integrations#1193).
This change should provide better diffing for team members for teams with child teams. Currently, child team members are included in the parent team's members list and so diffs are incorrect.
See Issue 1193.
Resolves #1193
Behavior
Before the change?
Currently, child team members are included in the parent team's members list and so diffs are incorrect.
Say we have a team
team-a
, with membersuser-1
anduser-2
and child teamsteam-b
- withuser-3
as a member - andteam-c
- withuser-4
as a member - then we expect to see only the membersuser-1
anduser-2
in the diff of team membership resource. However, we instead seeuser-3
anduser-4
in the diff as needing to be removed.After the change?
Using the graphQL API rather than the rest API for reading the team members allows us to specify that we only want users with immediate membership.
Other information
Additional info
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
Type: Breaking change
label)If
Yes
, what's the impact:Pull request type
Please add the corresponding label for change this PR introduces:
Type: Bug
Type: Feature
Type: Documentation
Type: Maintenance