add_silo_decorators.py 868 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env sentry exec
  2. from __future__ import annotations
  3. from sentry.utils.silo.add_silo_decorators import add_silo_decorators
  4. from sentry.utils.silo.common import Keywords
  5. """
  6. Instructions for use:
  7. 1. Commit or stash any Git changes in progress.
  8. 2. Add keywords to identify model and api classes in each silo.
  9. 3. From the Sentry project root, do
  10. ./scripts/silo/audit_silo_decorators.py | ./scripts/silo/add_silo_decorators.py
  11. 4. Do `git status` or `git diff` to observe the results. Commit if you're happy.
  12. """
  13. SILO_KEYWORDS = {
  14. "control": Keywords(
  15. include_words=["User", "Auth", "Identity"],
  16. ),
  17. "customer": Keywords(
  18. include_words=["Organization", "Project", "Team", "Group", "Event", "Issue"],
  19. exclude_words=["JiraIssue"],
  20. ),
  21. }
  22. if __name__ == "__main__":
  23. add_silo_decorators(silo_keywords=SILO_KEYWORDS)