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

Add documentation for the slack API #1610

Open
daveoconnor opened this issue Jan 17, 2025 · 0 comments
Open

Add documentation for the slack API #1610

daveoconnor opened this issue Jan 17, 2025 · 0 comments
Assignees

Comments

@daveoconnor
Copy link
Collaborator

When trying to run just manage release_tasks to import the data for release reports I got:

Updating slack activity buckets...
Traceback (most recent call last):
  File "/code/manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/venv/lib/python3.11/site-packages/djclick/adapter.py", line 68, in run_from_argv
    exit_code = self.main(
                ^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/djclick/adapter.py", line 50, in invoke
    return super(DjangoCommandMixin, self).invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/code/libraries/management/commands/release_tasks.py", line 103, in command
    handled_commits = run_commands(progress)
                      ^^^^^^^^^^^^^^^^^^^^^^
  File "/code/slack/management/commands/fetch_slack_activity.py", line 234, in inner
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/code/libraries/management/commands/release_tasks.py", line 77, in run_commands
    call_command("fetch_slack_activity")
  File "/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 194, in call_command
    return command.execute(*args, **defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/djclick/adapter.py", line 118, in execute
    self.invoke(ctx)
  File "/venv/lib/python3.11/site-packages/djclick/adapter.py", line 50, in invoke
    return super(DjangoCommandMixin, self).invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/code/slack/management/commands/fetch_slack_activity.py", line 234, in inner
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/code/slack/management/commands/fetch_slack_activity.py", line 292, in command
    selected_channels.extend(get_my_channels())
  File "/code/slack/management/commands/fetch_slack_activity.py", line 32, in get_my_channels
    for page in client.conversations_list():
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/slack_sdk/web/client.py", line 3124, in conversations_list
    return self.api_call("conversations.list", http_verb="GET", params=kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/slack_sdk/web/base_client.py", line 157, in api_call
    return self._sync_send(api_url=api_url, req_args=req_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/slack_sdk/web/base_client.py", line 188, in _sync_send
    return self._urllib_api_call(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/slack_sdk/web/base_client.py", line 319, in _urllib_api_call
    ).validate()
      ^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/slack_sdk/web/slack_response.py", line 199, in validate
    raise e.SlackApiError(message=msg, response=self)
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://slack.com/api/conversations.list)
The server responded with: {'ok': False, 'error': 'not_authed'}
error: Recipe `manage` failed on line 131 with exit code 1

Documentation should be added on how to set that up.

@daveoconnor daveoconnor converted this from a draft issue Jan 17, 2025
@daveoconnor daveoconnor self-assigned this Jan 17, 2025
@daveoconnor daveoconnor moved this to In Progress in website-v2 Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

1 participant