Commit Graph

1031 Commits

Author SHA1 Message Date
Klaas van Schelven
cf3b588eb7 Setting of value: outside 'try'
if inside, an error in self.get_tenant() results in an
non-executable finally block.

Also: make the 'del' more defensive by making it a 'pop'
2025-01-29 13:37:31 +01:00
Klaas van Schelven
01578d7829 Add print_phonehome management command
useful for:

* figuring out what phonehome will report
* getting some stats on-screen locally
2025-01-29 10:06:41 +01:00
Klaas van Schelven
452ac806b7 Raise from None
See https://www.bugsink.com/blog/using-raise-from-none-in-python/
in this case: PermissionDenied so clearly implies 'not found in db' that
the details of not finding are truly immaterial
2025-01-29 09:09:05 +01:00
Klaas van Schelven
59372aba33 First version of multi-tenant setup (EE) 2025-01-29 09:04:19 +01:00
Klaas van Schelven
d30c3ad704 Drop 'no contributions' rule; add CLA instead
CLA generated with https://contributoragreements.org/u2s/2r8vzl3ap4

Fixes #27
2025-01-24 16:12:07 +01:00
Klaas van Schelven
7f61c555a2 'This might mean' refers to 'No open issues'; make this show in the interface 2025-01-24 11:47:12 +01:00
Klaas van Schelven
705cf43fc2 Remove doc-TODO 2025-01-24 11:43:28 +01:00
Klaas van Schelven
cf23ba707e Warn about top-level settings 2025-01-24 11:40:13 +01:00
Klaas van Schelven
c6adfd7511 Remove 'slug' field from team
it was unused; probably added analogously with project (where it _is_ used)
2025-01-24 10:21:39 +01:00
Klaas van Schelven
ba7472321a Fix broken import
broken in ae9cb209a5
2025-01-23 12:30:00 +01:00
Klaas van Schelven
6c39c0b0af Reset password: as a command 2025-01-23 12:14:46 +01:00
Klaas van Schelven
ae9cb209a5 Create 'bsmain' (for bugsink-main) app to hold commands
As had been noted on some of the commands, 'ingest' was not the best place for
them.  However, [project-level apps are not supported in
Django](https://forum.djangoproject.com/t/allow-project-to-have-management-commands/5220/2)
So just create a 'main' app. I want to qualify it as 'myproject-main' though, to avoid
further unqualified global namespace pollution. And I want to avoid prefixing with 'bugsink'
b/c that's annoying for tab-completion. So 'bs' it is.

I've moved all commands over; even though a case could be made that the "feeding" commands
(raise_exception, send_json, stress_test) are somewhat related to ingestion, that's not
a very good case :-)
2025-01-23 11:55:34 +01:00
Klaas van Schelven
7727bc6168 Show dsn-as-understood when failing to authenticate in error message
status code for PermissionDenied rather than 404 also
2025-01-22 22:15:53 +01:00
Klaas van Schelven
f1086fcb55 When Dogfooding, set release to version 2025-01-21 10:35:47 +01:00
Klaas van Schelven
347892c093 Add MINIMIZE_INFORMATION_EXPOSURE setting
for now this just controls the /settings/ view, it may control other things (400, 500,
verbose_csrf_middleware) later
2025-01-21 09:44:19 +01:00
Klaas van Schelven
cdc11b7207 Document that Sentry does handle non-list-non-values exceptions 2025-01-17 21:37:33 +01:00
Klaas van Schelven
e7bcec1086 UX improvement for 400, 403, 404 and 500 API 'pages' (just return text)
this makes the output easier to read on the side of the tool (usually: our debug tool, not some
actual SDK) that has to deal with this on-screen
2025-01-17 18:01:05 +01:00
Klaas van Schelven
501724b9a3 server_error (handle_500): get exception ASAP
Not prompted by an observed bug, but by the refusal to think about how
how sys.exc_info() interacts with the template-failure-handling. Better
get it ASAP.
2025-01-17 17:28:47 +01:00
Klaas van Schelven
6048c1229a In bad_request handler, don't refetch the exception
Not prompted by an observed bug, but by the observation that exception is already
passed in as an argument. Likely, this was copied from the '500' case, where it
is not. Despite not having observed a bug, the improved version is more likely
to be correct (I don't want to have to think about how sys.exc_info() interacts
with the template-failure-handling right above)
2025-01-17 17:26:45 +01:00
Klaas van Schelven
cbda88f597 Deal with non-list non-values exceptions
See https://github.com/devSparkle/sentry-roblox/issues/32
2025-01-17 17:05:29 +01:00
Klaas van Schelven
505cae4b18 fix: don't raise non-existing exception
the previously referred type is from the DRF, but we don't use that
2025-01-17 17:04:28 +01:00
Klaas van Schelven
a54ec29433 Reraise rather than assert-for-nonexception
this expresses more clearly what the intention is, and the result is more clear too
(one less level of exception-chaining)
2025-01-17 17:04:20 +01:00
Klaas van Schelven
8cf7b006ed Phonehome comments updated: the reasons have changed
detecting production-use is no longer a reason since that's fine
2025-01-15 14:21:46 +01:00
Klaas van Schelven
1b1ac8b5fc 'nagging' about production-use is not needed anymore
since that's part of the freemium (shield license) model
2025-01-15 14:21:46 +01:00
Klaas van Schelven
d50838b9ff Change license to PolyForm Shield License
See #22
2025-01-15 14:20:33 +01:00
Klaas van Schelven
4f05cd0ced Don't pass request as an argument in template.render
(No direct bug-fix; but I'm being extra safe here.)

Prompted by the "shower thought" that made me wonder "why are the
ContextProcessors called for 500s / 400s _at all_? i.e. why is
getattr(request, "user", ...) like in 5907e49ce8 needed?

In fact, there was no explicit RequestContext in my code, but what
there was does seem to behave identically. And we don't actually need
`request` there, so better get rid of it.

Still, this doesn't mean we can turn the context-processors back into
their former unsafe (request.user) selves, because e.g. the 404 view
still passes through it.
2024-12-22 22:10:07 +01:00
Klaas van Schelven
a5bc27032a Visualize trimmed data ('x items trimmed')
Fix #18

Similar to [the request for the same feature in Sentry](https://github.com/getsentry/sentry/issues/68426)

SDK-side complaints:

* https://github.com/getsentry/sentry-python/issues/377
* https://github.com/getsentry/sentry-python/issues/805
* https://github.com/getsentry/sentry-python/issues/1041
* https://github.com/getsentry/sentry-python/issues/1105
* https://github.com/getsentry/sentry-python/issues/2121
* https://github.com/getsentry/sentry-python/issues/2682
* https://github.com/getsentry/sentry-python/issues/3209
* https://github.com/getsentry/sentry-python/issues/3634
* https://github.com/getsentry/sentry-python/issues/3740
2024-12-18 17:05:26 +01:00
Klaas van Schelven
c3d6fdce1c Better favicon
like 509b1ef2be (but we actually have 2 locations for this file)
2024-12-18 09:20:50 +01:00
Klaas van Schelven
b78e8438f5 Clarify when CustomWSGIRequest is used (hint: always) 2024-12-17 22:00:04 +01:00
Klaas van Schelven
8341d24b1d Comments and naming of CustomWSGIRequest 2024-12-17 21:51:25 +01:00
Klaas van Schelven
7303e6f978 Be explicit about what ALLOWED_HOSTS are when the error triggers
See https://github.com/bugsink/bugsink/issues/17#issuecomment-2549395508 for a log that would
be better after the present commit; in fact, it would probably take the question away
2024-12-17 21:23:47 +01:00
Klaas van Schelven
6497f482ae Correctly order Turningpoints (as per comment) 2024-12-16 22:04:03 +01:00
Klaas van Schelven
2739422968 Generic SDK: link to 'list of issues' 2024-12-16 21:50:19 +01:00
Klaas van Schelven
1d6854014b Warning message textual 2024-12-16 21:42:37 +01:00
Klaas van Schelven
bd5554a439 Merge branch 'attempt-at-bettter-guess-filename' 2024-12-16 21:34:29 +01:00
Klaas van Schelven
5810c1c580 choose_lexer_for_pattern: choose DjangoLexer explicitly when platform is Python
Other than fixing syntax higlighting for my favorite language, this has
the advantage of actually being a _deterministic_ solution (the previous
solution would do first-match) which makes the extra complexity worth-while.
2024-12-16 21:32:21 +01:00
Klaas van Schelven
454a90ba55 Comment about the uselessness of analyse_text in one more location
There isn't really a pygments issue for this, except perhaps
https://github.com/pygments/pygments/pull/2005
2024-12-16 13:29:50 +01:00
Klaas van Schelven
b961e6a943 Attempt at better guess_lexer_for_filename
the idea: guess on filename first, and on code second.
prompted by: getting a Django Template Parser to work.

however, this won't fly, because lexer.analyse_text is basically useless
(the parts that are implemented __at all__ are often based on some initial
bytes in the file, which is useless in our context of code snippets)
2024-12-16 13:26:44 +01:00
Klaas van Schelven
76bb6ace2b Typo in comment 2024-12-16 13:23:31 +01:00
Klaas van Schelven
509b1ef2be Better favicon (taken from the Bugsink website) 2024-12-16 12:37:30 +01:00
Klaas van Schelven
c1a74542f2 Breadcrumbs can be w/o values too (see 2 prev. commits) 2024-12-16 11:24:20 +01:00
Klaas van Schelven
ed9ffa248d jsonschema check: allow for .values to be missing
see #16
2024-12-16 11:23:55 +01:00
Klaas van Schelven
b597d91af7 Become robust for lack of .values key in exception
Fix #16
2024-12-16 11:22:32 +01:00
Klaas van Schelven
5907e49ce8 In context_processors, default to AnonymousUser for request.user
i.e. use a Null Object Pattern for it.
Because None.is_superuser won't work
Observed to go wrong when handling ALLOWED_HOSTS failures.
Fix #17
2024-12-16 09:26:59 +01:00
Klaas van Schelven
fce40f0581 Add some cleanup of objects to make_consistent command 2024-12-13 16:07:01 +01:00
Klaas van Schelven
15126018e6 Set (modern equivalent of) TEMPLATE_DEBUG=True 2024-12-12 13:53:53 +01:00
Klaas van Schelven
2f62c02c92 Deal with nones-in-arrays in pre/post-context
Fix #15
2024-12-09 09:56:30 +01:00
Klaas van Schelven
77a4fd321d LICENSE: point to terms on website 2024-12-04 11:55:44 +01:00
Klaas van Schelven
8ea88064dc LICENSE: clarify Docker installs 3rd party packages too 2024-12-04 11:23:28 +01:00
Klaas van Schelven
28314a2683 Language icons: add to SDK page 2024-12-03 09:14:29 +01:00