Commit Graph

1467 Commits

Author SHA1 Message Date
Klaas van Schelven
54ff368cf2 Don't crash on illegal values for platform
See #143, #145
2025-07-14 10:25:12 +02:00
Klaas van Schelven
10889871d2 Support 'crystal' platform
Fix #145
2025-07-14 10:24:45 +02:00
Klaas van Schelven
92c95e66ea accept 'powershell' value for 'platform' (even if it's not in the spec)
See #143
2025-07-11 10:19:11 +02:00
Klaas van Schelven
1c93154a7e 1.7.1 CHANGELOG 1.7.1 2025-07-10 11:14:40 +02:00
Klaas van Schelven
d7f58879a7 Fix: unclosed link on dark/light logo breaks user-related forms
introduced in 1abc30a7
2025-07-10 11:11:58 +02:00
Klaas van Schelven
6ec220b3d2 1.7.0 CHANGELOG 1.7.0 2025-07-09 08:41:02 +02:00
Klaas van Schelven
30df9e7008 Remove FREE_VERSION_WARNING dead code
became unused when polyform license was introduced
2025-07-08 21:51:45 +02:00
Klaas van Schelven
91f482f856 Remove superfluous remark
this comment was from before the polyform shield licence days
2025-07-08 21:48:08 +02:00
Klaas van Schelven
aa255978b7 Snappea: refuse to start in TASK_ALWAYS_EAGER mode 2025-07-08 20:57:26 +02:00
Klaas van Schelven
4ca770da28 Skip ALLOWED_HOSTS validation for /health/ endpoints
Health checks are often done directly against an IP address rather than using a
full hostname. This is annoying to set up if the IP address can be one from a
large range.

The things that ALLOWED_HOSTS defend against don't really apply for health
endpoints, so better not have the check.

Fix #140
2025-07-08 17:36:21 +02:00
Klaas van Schelven
9a6d453443 Fix 2 bare_base/barest_base mistakes re dark mode
* in 1abc30a760 the hardcoding of ="dark" (during development)
  was accidentally checked in; it never should have been.

* in e14b3eaaa6 I mixed up the bare*base templates. It's actually
  bare_base.html that's for 404/500 etc; barest_base is more bare
  visually (it's the box-based layout for login etc), but it doesn't
  need to be so careful not to use variables.

See #40
2025-07-08 17:04:38 +02:00
Klaas van Schelven
27af846de9 Merge pull request #142 from bugsink/issue-tag-cleanup-as-vacuum
In the light of the discussion on #134, this implements the "clean up later"
solution: a vacuum task that deletes IssueTags no longer referenced by any
EventTag on the same Issue. 

In the same sweep TagValues are pruned.

Performance-wise, this is a relatively safe path forward; it can run off-hours
or not at all, depending on preferences.

Semantically it's the least clear: whether an Issue appears to be tagged may
now depend on whether vacuum has run, and `IssueTag.count` (representing total
observed) is left in a "weird place" in the sense that it may disappear from
the total more or less at random (i.e. depending on calling a command, and
depending on the current state of not-yet-evicted Events).
2025-07-08 16:57:16 +02:00
Klaas van Schelven
1965b0f8c2 vacuum_eventless_issuetags: tune batch-size
See #134
2025-07-08 16:16:54 +02:00
Klaas van Schelven
674d84909f TagValue pruning (for vacuum_eventless_issuetags) 2025-07-08 15:59:55 +02:00
Klaas van Schelven
9741844821 vacuum_eventless_issuetags: tests (and minor fix)
See #134
2025-07-08 15:32:43 +02:00
Klaas van Schelven
4dd525d0d0 Missing import 2025-07-08 15:29:14 +02:00
Klaas van Schelven
d62e53fdf8 store_tags: support 'very many' (~500) tags 2025-07-08 15:21:26 +02:00
Klaas van Schelven
a247528baa TagKey __str__ 2025-07-08 15:06:46 +02:00
Klaas van Schelven
dc25e044f0 Add store_tags test for 2 separate Issues
(there were some doubts whether this works; this test takes
those doubts away)
2025-07-08 15:06:20 +02:00
Klaas van Schelven
7f416ac920 vacuum_eventless_issuetags command
In the light of the discussion on #134, this implements the "clean up later"
solution: a vacuum task that deletes IssueTags no longer referenced by any
EventTag on the same Issue.

This doesn't prevent stale IssueTags from being created but ensures they are
eventually removed, enabling follow-up cleanup (e.g. of TagValues).

Performance-wise, this is a relatively safe path forward; it can run off-hours
or not at all, depending on preferences. Semantically it's the least clear:
whether an Issue appears to be tagged may now depend on whether vacuum has run.

No tests yet; no immediate TagValue cleanup.
2025-07-08 13:21:57 +02:00
Klaas van Schelven
a91fdcd656 Sentry-SDK requirement, unpin minor version
My thinking:

* Avoid Dependabot spam for harmless version bumps. (sentry-SDK
  has the most upgrades by an order of magnitude)

* In princple, there should be no breakage, b/c they do semver and
  "minor version when you add functionality in a backward compatible manner"

* This is dev tooling; it shouldn’t be a source of friction.

* As it stands: I'm not thoroughly reviewing these anyway (b/c of the spammyness)

The alternative would have been to "just freeze" it; if we ever run into
problems because of the unpinning I certainly will.
2025-07-08 10:55:38 +02:00
Klaas van Schelven
7419c924c1 make_consistent: handling of Issue/Project .is_deleted
as an 'enqueue again', per the comment

See #50
2025-07-07 16:43:47 +02:00
Klaas van Schelven
4e83a42f39 Dark mode: 'yellow' bar less ugly
my chatbot tells me it felt ugly because

>  bg-yellow-900 [..] is a very saturated, reddish mustard — almost
>  brown-orange. That’s why it feels so jarring in dark mode: it's too warm,
>  too saturated, and clashes with a cool-dark UI. [..] Try bg-amber-800
>  instead. Tailwind's amber palette is warmer and more muted than yellow,
>  designed to fit better in dark UIs.

No idea if the reasoning is sound, but it "looks good" so I'm pushing ahead.
2025-07-07 16:41:07 +02:00
Klaas van Schelven
3baedcaab9 Project-delete: show success-message after delete 2025-07-07 12:48:35 +02:00
Klaas van Schelven
182866f19a Dark theme: little triangles in history-view fixed
Fix #40
2025-07-07 12:23:04 +02:00
Klaas van Schelven
1abc30a760 Dark mode: faucet visible in logo
not my best work ever, but at least a visible faucet this way...
2025-07-07 12:09:21 +02:00
Klaas van Schelven
f21d9f989b Fix recently added UI elements to have dark mode too
the elements were added after the work on #125 was done but in a
branch w/o dark-mode, so they needed to still be fixed
2025-07-07 11:39:27 +02:00
Klaas van Schelven
e14b3eaaa6 barest_base: don't assume user is set.
its purpose is to "not break" for e.g. 404/500, so I want as little logic in
there as possible.
2025-07-07 11:36:36 +02:00
Klaas van Schelven
8178861422 Merge pull request #125 from d1ceward/feature/add_dark_theme
Add dark mode (a few tiny fixes will follow in a follow-up commit)
2025-07-07 11:19:16 +02:00
Klaas van Schelven
d99f946665 Merge branch 'main' into feature/add_dark_theme 2025-07-07 11:08:00 +02:00
Klaas van Schelven
c2bc2e4174 'get_system_warnings as a callable
to avoid querying the DB(s) unnecessarily
(ran into this when seeing >0 queries on 404 requests)
2025-07-07 10:33:46 +02:00
Klaas van Schelven
91ae7992e3 Comment on possible refactoring 2025-07-07 10:27:38 +02:00
Klaas van Schelven
7b340fd8ff Hide in-progress deletions of Project & Issue from the UI
I've done a full grep on Issue.objects, Project.objects and get_object_or_404
equivelents, and applying some common sense. The goal: avoid having
confusing/half-broken pages in the UI.

On index-usage: I've decided not to update the indexes. The assumption is:
`is_deleted` items will be a tiny minority of items in general, making the
cost/benefit analysis not turn out favorably (just scanning them out as a final
step is more efficient).  Also: sqlite is able to use the correct index without
adding a special one, proof:

```
EXPLAIN QUERY PLAN SELECT [..] WHERE ("issues_issue"."project_id" = 1 AND "issues_issue"."is_muted" = (0) AND "issues_issue"."is_resolved" = (0)) ORDER BY "issues_issue"."last_seen" DESC LIMIT 250;
QUERY PLAN
`--SEARCH issues_issue USING INDEX issue_list_open (project_id=? AND is_resolved=? AND is_muted=?)

EXPLAIN QUERY PLAN SELECT [..] WHERE ("issues_issue"."project_id" = 1 AND "issues_issue"."is_muted" = (0) AND "issues_issue"."is_resolved" = (0) AND "issues_issue"."is_deleted" = 0) ORDER BY "issues_issue"."last_seen" DESC LIMIT 250;
QUERY PLAN
`--SEARCH issues_issue USING INDEX issue_list_open (project_id=? AND is_resolved=? AND is_muted=?)
```

See #139 for the 0/1 notation in the above.

(Project-indexes: not an issue, the scale is "below relevance for indexes")
2025-07-07 10:27:36 +02:00
Klaas van Schelven
308034aadd Issue-delete from the UI (in the list-view)
See #50
2025-07-04 21:25:57 +02:00
Animesh Agrawal
72479fe982 add button for project-delete in UI
Implement delete functionality with confirmation modals for projects.

cherry picked (by Klaas) from commit 6764fbf343fb; but:

* projects only
* `delete_deferred`
* flake8

See #84 for the original PR
2025-07-04 17:33:02 +02:00
Klaas van Schelven
cb3168133e Fix Event-deletion from the admin
b/c of the introduction of on_delete=DO_NOTHING, this was broken.
this is the quick & dirty fix (no tests)
2025-07-04 17:33:02 +02:00
Klaas van Schelven
3e2bc290fd Fix typo in 'breadcrumbs' first/last urls.py 2025-07-04 17:33:02 +02:00
Klaas van Schelven
e861280c1f Merge pull request #137 from bugsink/project-delete
Project delete
2025-07-04 10:11:39 +02:00
Klaas van Schelven
4900f0447e Project-deletion: slight optimization
Removes the following 2 redundant queries from the deletion process:

```
SELECT "tags_tagkey"."id" FROM "tags_tagkey" WHERE "tags_tagkey"."project_id" IN (1) ORDER BY "tags_tagkey"."project_id" ASC, "tags_tagkey"."id" ASC LIMIT 498
UPDATE "projects_project" SET "stored_event_count" = ("projects_project"."stored_event_count" - 1) WHERE "projects_project"."id" = 1
```
2025-07-03 22:04:51 +02:00
Klaas van Schelven
28b2ce0eaf Various models: .project SET_NULL => DO_NOTHING
Like e45c61d6f0, but for .project.

I originally thought `SET_NULL` would be a good way to "do stuff later", but
that's only so the degree that [1] updates are cheaper than deletes and [2]
2nd-order effects (further deletes in the dep-tree) are avoided.

Now that we have explicit Project-deletion (deps-first, delayed, properly batched)
the SET_NULL behavior is always a no-op (but with cost in queries).

As a result, in the test for project deletion (which has deletes for many
of the altered models), the following 12 queries are no longer done:

```
SELECT "projects_project"."id", [..many fields..] FROM "projects_project" WHERE "projects_project"."id" = 1
DELETE FROM "projects_projectmembership" WHERE "projects_projectmembership"."project_id" IN (1)
DELETE FROM "alerts_messagingserviceconfig" WHERE "alerts_messagingserviceconfig"."project_id" IN (1)
UPDATE "releases_release" SET "project_id" = NULL WHERE "releases_release"."project_id" IN (1)
UPDATE "issues_issue" SET "project_id" = NULL WHERE "issues_issue"."project_id" IN (1)
UPDATE "issues_grouping" SET "project_id" = NULL WHERE "issues_grouping"."project_id" IN (1)
UPDATE "events_event" SET "project_id" = NULL WHERE "events_event"."project_id" IN (1)
UPDATE "tags_tagkey" SET "project_id" = NULL WHERE "tags_tagkey"."project_id" IN (1)
UPDATE "tags_tagvalue" SET "project_id" = NULL WHERE "tags_tagvalue"."project_id" IN (1)
UPDATE "tags_eventtag" SET "project_id" = NULL WHERE "tags_eventtag"."project_id" IN (1)
UPDATE "tags_issuetag" SET "project_id" = NULL WHERE "tags_issuetag"."project_id" IN (1)
```
2025-07-03 21:49:49 +02:00
Klaas van Schelven
6b9e4d8011 Project.delete_deferred(): first version (WIP)
Implemented using a batch-wise dependency-scanner in delayed
(snappea) style.

* no real point-of-entry in the (regular, non-admin) UI yet.
* no hiding of Projects which are delete-in-progress from the UI

* lack of DRY
* some unnessary work (needed in the Issue-context, but not here)
  is still being done.

See #50
2025-07-03 21:01:28 +02:00
Klaas van Schelven
76dc2ede16 Merge pull request #136 from bugsink/issue-delete
Issue delete (with cleanup async)
2025-07-03 14:52:48 +02:00
Klaas van Schelven
99f71b8a47 Fix the tests (query-counting across DBs) 2025-07-03 14:48:51 +02:00
Klaas van Schelven
eb5e2d2a48 Fix 'delay_on_commit' calls for project-id passing-around 2025-07-03 13:46:40 +02:00
Klaas van Schelven
6a75216c8f Document issue-deletion batch size budget 2025-07-03 13:46:16 +02:00
Klaas van Schelven
5637e04cec Assert no automatic cascades happen in our manual dep-deletion 2025-07-03 13:23:08 +02:00
Klaas van Schelven
2baa4446fd Issue deletion: event pre-deletes (storage, project-counts) 2025-07-03 13:18:28 +02:00
Klaas van Schelven
ad2aa08e0a Rename local var. for understanding 2025-07-03 11:44:01 +02:00
Klaas van Schelven
3b3ce782c5 Fix the tests for prev. commit
tests were broken b/c not respecting constraints / not properly using the factories.
2025-07-03 11:33:58 +02:00
Klaas van Schelven
e45c61d6f0 Various models: .issue and .grouping; SET_NULL => DO_NOTHING
I originally thought `SET_NULL` would be a good way to "do stuff later", but
that's only so the degree that [1] updates are cheaper than deletes and [2]
2nd-order effects (further deletes in the dep-tree) are avoided.

Now that we have explicit Issue-deletion (deps-first, delayed, properly batched)
the SET_NULL behavior is always a no-op (but with cost in queries).

As a result, in the test for issue deletion (which has deletes for many
of the altered models), the following 8 queries are no longer done:

```
SELECT "issues_grouping"."id", [..many fields..] FROM "issues_grouping" WHERE "issues_grouping"."id" IN (1)
UPDATE "events_event" SET "grouping_id" = NULL WHERE "events_event"."grouping_id" IN (1)

[.. a few moments later..]

SELECT "issues_issue"."id", [..many fields..] FROM "issues_issue" WHERE "issues_issue"."id" = 'uuid'
UPDATE "issues_grouping" SET "issue_id" = NULL WHERE "issues_grouping"."issue_id" IN ('uuid')
UPDATE "issues_turningpoint" SET "issue_id" = NULL WHERE "issues_turningpoint"."issue_id" IN ('uuid')
UPDATE "events_event" SET "issue_id" = NULL WHERE "events_event"."issue_id" IN ('uuid')
UPDATE "tags_eventtag" SET "issue_id" = NULL WHERE "tags_eventtag"."issue_id" IN ('uuid')
UPDATE "tags_issuetag" SET "issue_id" = NULL WHERE "tags_issuetag"."issue_id" IN ('uuid')
```

(breaks the tests b/c of constraints and not always using factories; will fix next)
2025-07-03 11:33:58 +02:00