[BUG] Ensure github_emu_group_mapping behaves correctly if mapping changes upstream#3118
Conversation
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
stevehipwell
left a comment
There was a problem hiding this comment.
I've added some review comments, but please could you remove the new deps. I don't think we should be introducing new dependencies with functional changes and I'm not sold on the value of doing something like this especially where we get a whole old copy of go-github in the vendor dir.
Regarding
Regarding I would propose we keep both package additions as neither should be posing a risk for the functionality of the provider, while trying to make maintenance simpler |
|
RE RE |
8af4f04 to
705b3b0
Compare
@stevehipwell Thanks for the |
stevehipwell
left a comment
There was a problem hiding this comment.
Sorry, but I'm not following the point of matchTeamID()? Given that the team ID can't change without recreating the resource I'd only expect there to be a call to client.Teams.GetTeamBySlug() in create, to set it into the schema, and also in the diff if the slug changes. Other than that there shouldn't be any need to call that API during the general lifecycle.
FYI I like the addition of team_id to the schema, I'll add that into my team changes.
@stevehipwell My idea with But I just realize that in You're right. it's unnecessary! |
stevehipwell
left a comment
There was a problem hiding this comment.
This is coming along well, I've added some questions/suggestions but the main one is to remove the unnecessary API call to get the team ID in read.
0d4e974 to
0da08b1
Compare
0da08b1 to
c12065a
Compare
stevehipwell
left a comment
There was a problem hiding this comment.
I should have clarified the table test comment, I'm expecting the table tests to be self contained. Otherwise there isn't much point as it's non-trivial to add new cases.
c12065a to
2649046
Compare
|
@deiga this PR has conflicts. |
2649046 to
7f04918
Compare
|
@stevehipwell Conflicts resolved |
stevehipwell
left a comment
There was a problem hiding this comment.
@deiga could you remove the migration test from this PR and add it to a new PR? I think that pattern needs more discussion and may benefit from being looked at from a simpler perspective, such as actions secret. If this is done I think we're ready to merge.
fa53c43 to
4d3de7a
Compare
|
@stevehipwell Done |
|
@deiga could you please rebase this PR? |
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…alGroupsForTeamBySlug` to ensure we match state and reality Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…nnecessary code Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
- Adds `github.com/migueleliasweb/go-github-mock` package for mocking go-github endpoints - Adds `github.com/go-test/deep` package for better error messages when types of fields differ Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
… `ForceNew` Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…ice. We need to directly lookup TeamID Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
4d3de7a to
9c3367d
Compare
|
@stevehipwell Done |
Before the change?
Readwould not check if the Team and External Group we're still connected to each othergroup_idwould not force a new resource, potentially leaving dangling connectionsCreateandUpdateshared same functionality, leading to potentially wasted API callsAfter the change?
<team_id>:<team_slug>:<group_id>Readproperly checks that Team ID ofteam_slugand any Team mapped togroup_idmatchgroup_idforces new resource creationCreateandUpdateto allow fine-grained control inUpdateteam_slugchange to vlaidate if it's a team rename or switchPull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!