Skip to content

Conversation

byteakp
Copy link

@byteakp byteakp commented Jun 12, 2025

Add Slack Command to Trigger Internal Reports by Org, Site, and Audit Type

This PR introduces support for selectively running internal reports via the Slack command /run internal report using up to four arguments:
/run internal report [reportType] [orgId] [siteBaseURL] [auditType]

This enhancement allows users to target specific orgs, sites, or audit types when retriggering reports, avoiding the need to rerun reports for all customers — particularly useful when fixing bugs or reprocessing failed audits.

✅ Key Features

  • Accepts optional arguments: orgId, siteBaseURL, auditType
  • Sends filtered SQS message to the reports queue
  • Helps resolve repeated manual reprocessing
  • Improves support and ops workflows

🧪 Tests

Added unit tests to cover:

  • Command with no filters (default behavior)
  • Command with orgId only
  • orgId + siteBaseURL
  • orgId + siteBaseURL + auditType

Each test verifies the correct SQS message structure is sent.


📌 Notes

  • Downstream services (like spacecat-jobs-dispatcher) must support filtering on these fields.
  • Help text for the Slack command has been updated accordingly.
  • No changes were made to the backend API controllers.

🔗 Related Issues

Closes #235
Slack command/API to (re)trigger reporting for a specific org/site and audit type

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.

Slack command/API to (re)trigger reporting for a specific org/site and audit type
1 participant