Repository navigation
Conversation
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
✅ Deploy Preview for endearing-brigadeiros-63f9d0 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1795 +/- ##
==========================================
+ Coverage 87.00% 87.91% +0.91%
==========================================
Files 113 121 +8
Lines 6463 6809 +346
Branches 1253 1289 +36
==========================================
+ Hits 5623 5986 +363
+ Misses 536 514 -22
- Partials 304 309 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
jescalada
left a comment
There was a problem hiding this comment.
Looks good so far, just wondering if we could simplify the PR description/title a bit to make it easier to follow.
Since we're technically fixing the audit problem but also doing the push count recalculation stuff, it might even be better to have separate PRs for each 🤔
| commitFrom: 1, | ||
| commitTo: 1, | ||
| error: 1, | ||
| errorMessage: 1, |
There was a problem hiding this comment.
Are all the newly added fields here in pushListProjection actually being used? I'm wondering about the errorMessage for instance, since that might contain processor output that may or may not be relevant to the user.
I noticed there's also a few extra ones like protocol, message and author.
| return index.snapshot(); | ||
| }; | ||
|
|
||
| export const getRepoPushRollupsByCanonicalUrl = |
There was a problem hiding this comment.
It seems that when loading any of the following dashboard tabs...
- Repositories (
/dashboard/repo) - Activity (
/dashboard/push) - Push Details (
/dashboard/push/:id) - User Profile (
/dashboard/user/:id)
...we're triggering getRepoPushRollupsByCanonicalUrl, which ends up doing the whole dirty entry updating.
I'm wondering if this isn't accidentally affecting performance, what would happen if multiple users were to access the same pages? If we recalculate the rollups for multiple repos at the same time, wouldn't conflicts arise on dirty detection too?
| return { pushes, summaries }; | ||
| }; | ||
|
|
||
| const backfillActivity = async (): Promise<void> => { |
There was a problem hiding this comment.
I noticed that backfillActivity is running on getRepos on the first proxy startup. Wouldn't a cleaner solution be to run this on a migration so that it doesn't block any operations while the proxy is already up and running?
| let initialization = initialized.get(database); | ||
| if (!initialization) { | ||
| initialization = Promise.all([ | ||
| pushes.createIndex({ id: 1 }, { unique: true }), |
There was a problem hiding this comment.
Was the unique check on push IDs previously enforced? If not, would that cause any clashes on calling getRepos?
| throw new Error(`Push ${id} changed repeatedly during deletion; retry the request`); | ||
| }; | ||
|
|
||
| export const rebuildRepoPushRollups = async (): Promise<RepoPushRollupsByCanonicalUrl> => { |
|
|
||
| const att = push.attestation; | ||
| const ts = DateTime.fromMillis(Number(att.timestamp)); | ||
| const numericTimestamp = Number(att.timestamp); |
There was a problem hiding this comment.
We're doing the same conversion on RejectionInfo.tsx right below - might want to extract into a helper.
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
Signed-off-by: Denis Ćorić <denis85@gmail.com>
|
|
||
| type StoredPush = Action & { _lastStepIndex?: number; _activity?: unknown }; | ||
|
|
||
| export const compactPush = (action: Action) => { |
There was a problem hiding this comment.
Adding a verbal description of what this is doing in a comment would be use full here and on restorePush
There was a problem hiding this comment.
I see it in the architecture doc, but it'd be good to have the same description inline in the code

Description
Large pushes store the diff repeatedly in processor logs and content, and the final step is duplicated in
lastStep. Store each diff once and replace an identical final step with an internal reference in the file, MongoDB, and PostgreSQL sinks. Detail reads restore the complete API response; existing records remain readable.Push lists and profile activity use the same metadata allowlist across all three sinks. Unused top-level author, message, protocol, and errorMessage fields are excluded. Commit/tag metadata needed by the UI is preserved; full diffs and processor results remain available on the detail endpoint.
Related Issue
Storage portion of #1691 and PostgreSQL parity in #1794, following the merge of #1687. Repository activity summaries and the related UI refresh fixes are now in #1801. Both PRs are needed to complete the agreed scope. The Action.diff refactor in #1693 and #1701 remains separate.
Validation
A constructed push whose final step held a 2 MiB diff serialized to 8,389,308 bytes before compaction and 2,097,722 bytes afterward. Historical records are preserved rather than rewritten.
Checklist
No configuration schema changes.