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

MM-15205: Group Rest API #18

Merged
merged 3 commits into from
May 22, 2019
Merged

MM-15205: Group Rest API #18

merged 3 commits into from
May 22, 2019

Conversation

lieut-data
Copy link
Member

@lieut-data lieut-data commented May 20, 2019

This introduces the /api/group endpoints, as well as new /api/installation endpoints for joining and leaving a group.

The API supports changing the target version of the installation group, but defers the propagation of same to the corresponding installations to https://mattermost.atlassian.net/browse/MM-15369.

I also fixed a minor caching issue in internal/tools/k8s with the use of TempDir that precludes go test ./... from successfully caching these tests.

Fixes: https://mattermost.atlassian.net/browse/MM-15205

This introduces the /api/group endpoints, as well as new /api/installation endpoints for joining and leaving a group.

The API supports changing the target version of the installation group, but defers the propagation of same to the corresponding installations to https://mattermost.atlassian.net/browse/MM-15369.
@lieut-data lieut-data added the 2: Dev Review Requires review by a developer label May 20, 2019
Copy link
Contributor

@gabrieljackson gabrieljackson left a comment

Choose a reason for hiding this comment

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

This looks great!

Based on my understanding of the code, it looks like we retain the group ID setting on an installation when deleting a group if said installation was part of the group. I think this makes sense, but just wanted to make sure. We didn't want to remove the group ID value from the installation at that time as well, did we?

internal/api/group.go Outdated Show resolved Hide resolved
return nil

default:
return errors.Errorf("failed with status code %d", resp.StatusCode)
Copy link
Contributor

Choose a reason for hiding this comment

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

super nit: this error message is used heavily throughout the code. Perhaps we may want a helper function to return it in a standard way to make updating it in the future a little easier. 0/5 on this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that this needs some attention. I'd like to also expose the actual error message to the client vs. requiring the server logs to explain. I'll add this as a TODO to revisit holistically.

@lieut-data
Copy link
Member Author

@gabrieljackson, your understanding of the GroupID being left set on an installation is correct. I had hoped to avoid cascading the necessary UPDATE to all associated installations (which might be in various states of being locked, etc.). This also has the nice advantage of technically being reversible (though the planned history tables would have enabled that anyway.)

@lieut-data lieut-data merged commit 72f0d19 into master May 22, 2019
@lieut-data lieut-data added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a developer labels May 22, 2019
@lieut-data lieut-data deleted the mm-15205-group-rest-api branch May 22, 2019 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
3 participants