-
Notifications
You must be signed in to change notification settings - Fork 6
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 endpoint to create slack channel for a given proposal #76
Conversation
This commit adds the SlackChannelManagersView model to the beamlines.py file in the src/nsls2api/models directory. The model includes a list of slack_channel_managers and a projection setting for the corresponding database field. This model will be used to manage the Slack channel managers for each beamline.
The commit adds a new endpoint `/beamline/{name}/slack-channel-managers` to the `beamline_api.py` file in the `src/nsls2api/api/v1` directory. This endpoint allows users to retrieve the Slack channel managers for a specific beamline. If the beamline is not found, a 404 error is returned.
This commit adds the SlackUser model to the `slack_models.py` file in the `src/nsls2api/models` directory. The model includes fields for `user_id`, `username`, and `email`. This model will be used to represent a Slack user in the application.
This commit adds functionality to retrieve the Slack user IDs of the channel managers for a given beamline. It introduces a new function `slack_channel_managers` in the `beamline_service.py` file. The function takes the name of the beamline as input and returns a list of Slack user IDs. It also includes necessary error handling if the beamline is not found.
Also added various docs
) | ||
|
||
# TODO: Uncomment to actually add the users when we are sure!! | ||
# slack_service.add_users_to_channel(channel_id=channel_id, user_ids=proposal_user_ids) |
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.
This is the line that needs to be uncommented to add all the users to the slack channel
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.
This is a very nice addition to the API services. I've noted some things for consideration.
…d description parameter.
Co-authored-by: Padraic Shafer <[email protected]>
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.
Looks good!
Added endpoint to create a Slack channel for a proposal.
It will add the "bot" to the channel and then add all the beamline slack managers and all the proposal users that have a valid username.
Also added an endpoint for the beamline to list the slack channel managers
Note: currently the line to actually add external users is commented out until we are sure this works ok.