Skip to content

Conversation

@stuartcampbell
Copy link
Collaborator

@stuartcampbell stuartcampbell commented Jul 15, 2025

The main improvement in this PR is to increase the usefulness of the GET endpoint /v1/proposal/{proposal_id}/slack-channels.

This will resolve #186.

@stuartcampbell stuartcampbell added this to the 0.7 milestone Jul 15, 2025
@stuartcampbell stuartcampbell self-assigned this Jul 15, 2025
@stuartcampbell stuartcampbell requested a review from Copilot July 15, 2025 21:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Enhances the Slack integration for proposal channels by introducing detailed conversation retrieval and updating the GET endpoint to return richer channel information.

  • Added SlackConversation model and get_conversation_details service to fetch full channel details including members.
  • Enriched get_user_info with bot status, real name, and pending invitation; increased conversations_members limit.
  • Modified /v1/proposal/{proposal_id}/slack-channels endpoint to return SlackConversation objects via get_conversation_details.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/nsls2api/services/slack_service.py Introduce get_conversation_details, enhance get_user_info, adjust member retrieval, rename function
src/nsls2api/models/slack_models.py Add SlackConversation and SlackUserProfile Pydantic models
src/nsls2api/api/v1/proposal_api.py Change endpoint return type to SlackConversation and incorporate new service
Comments suppressed due to low confidence (1)

src/nsls2api/services/slack_service.py:328

  • Remove the /1000.0 division since Slack's updated timestamp is in seconds, not milliseconds, to avoid incorrect date calculations.
                info_response.get("channel", {}).get("updated", 0) / 1000.0

stuartcampbell and others added 2 commits July 15, 2025 17:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@stuartcampbell stuartcampbell marked this pull request as ready for review July 16, 2025 19:16
Copy link
Collaborator

@nmaytan nmaytan left a comment

Choose a reason for hiding this comment

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

I looked through this and have just a couple suggestions

stuartcampbell and others added 25 commits July 22, 2025 13:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@stuartcampbell stuartcampbell requested a review from nmaytan July 22, 2025 18:07
@nmaytan nmaytan merged commit 4a457fc into NSLS2:main Jul 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Various improvements to Slack channel integration

2 participants