Add release validator and regression tracking - #590
alisawavezen12 wants to merge 11 commits into
Conversation
Please add a PR description 🙂Respect the reviewers — a description helps others understand the changes and review them faster. Keep it short, clear, and to the point. It also serves as documentation for future reference. The PR was moved to Draft until a description is added. |
Please add a PR description 🙂Respect the reviewers — a description helps others understand the changes and review them faster. Keep it short, clear, and to the point. It also serves as documentation for future reference. The PR was moved to Draft until a description is added. |
Please add a PR description 🙂Respect the reviewers — a description helps others understand the changes and review them faster. Keep it short, clear, and to the point. It also serves as documentation for future reference. The PR was moved to Draft until a description is added. |
Please add a PR description 🙂Respect the reviewers — a description helps others understand the changes and review them faster. Keep it short, clear, and to the point. It also serves as documentation for future reference. The PR was moved to Draft until a description is added. |
Please add a PR description 🙂Respect the reviewers — a description helps others understand the changes and review them faster. Keep it short, clear, and to the point. It also serves as documentation for future reference. The PR was moved to Draft until a description is added. |
|
Thanks for adding a description — the PR is now marked as Ready for Review. |
| return this.saveRepetition(task.projectId, newRepetition); | ||
| }); | ||
|
|
||
| if (task.payload.release && existedEvent.resolvedInRelease) { |
There was a problem hiding this comment.
we need to check if task.payload.release is newer than existedEvent.resolvedInRelease
There was a problem hiding this comment.
we do this later in the markRegression function.
There was a problem hiding this comment.
then we need to rename markRegression to checkForRegression
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Release history compatibility, durable regression reconciliation, deployment wiring, and bounded database processing remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 3
Open (4)
What changed in this PR
Implements release-based event resolution and regression tracking across the validator and grouper workers.
Changes:
- Adds release validation logic and worker scaffolding.
- Records repetition releases and regression cycles.
- Adds supporting tests and updates shared types.
| File | Description |
|---|---|
| yarn.lock | Updates Hawk types dependency. |
| workers/release-validator/tests/validate-releases.test.ts | Tests release validation scenarios. |
| workers/release-validator/tests/utils/group-releases-by-project.test.ts | Tests release grouping. |
| workers/release-validator/tests/utils/build-event-release-map.test.ts | Tests event-release mapping. |
| workers/release-validator/tests/index.test.ts | Tests worker queue configuration. |
| workers/release-validator/src/validate-releases.ts | Implements release validation. |
| workers/release-validator/src/utils/group-releases-by-project.ts | Groups releases by project. |
| workers/release-validator/src/utils/build-event-release-map.ts | Maps events to releases. |
| workers/release-validator/src/index.ts | Defines the validator worker. |
| workers/release-validator/README.md | Documents worker behavior. |
| workers/release-validator/package.json | Declares worker metadata. |
| workers/grouper/tests/index.test.ts | Tests repetition and regression behavior. |
| workers/grouper/src/mark-regression.ts | Implements regression updates. |
| workers/grouper/src/index.ts | Records releases and invokes regression tracking. |
| package.json | Adds scripts and updates types. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
|
|
||
| /** | ||
| * Mark a resolved event as regressed in the resolved or a newer release. |
There was a problem hiding this comment.
| * Mark a resolved event as regressed in the resolved or a newer release. | |
| * Mark a resolved event as regressed if ... |
| @@ -0,0 +1,67 @@ | |||
| import { Db, ObjectID } from 'mongodb'; | |||
|
|
|||
| interface ReleaseRecord { | |||
There was a problem hiding this comment.
| interface ReleaseRecord { | |
| type ReleaseRecordPart = Pick<ReleaseDBScheme, '_id' | 'projectId' | 'release'> |
| const hasRegressionForCurrentCycle = previousRegressionRelease && | ||
| previousRegressionRelease._id.toHexString() >= resolvedReleaseId; | ||
|
|
||
| if (!isResolvedOrNewerRelease || hasRegressionForCurrentCycle) { |
| expect((await eventsCollection.findOne({})).regressionInRelease).toBe('release-c'); | ||
| }); | ||
|
|
||
| test('Should mark a resolved event as regressed in the resolved release', async () => { |
There was a problem hiding this comment.
| test('Should mark a resolved event as regressed in the resolved release', async () => { | |
| test('Should mark as regressed ff we later encounter this event with a release that is considered a resolving release.', async () => { |
| expect(savedRepetition.release).toBeUndefined(); | ||
| }); | ||
|
|
||
| test('Should mark a resolved event as regressed in a newer repetition release', async () => { |
There was a problem hiding this comment.
lets wrap them into describe('Regression marking, ...`
| releasesByName: Map<string, ReleaseDBScheme> | ||
| ): Promise<void> { | ||
| const eventGroupHashes = events.map(event => event.groupHash); | ||
| const repetitions = await repetitionsCollection.find({ |
There was a problem hiding this comment.
this seems to be deadly big. You're getting all millions of repetitions.
You need to retrieve only distinct "release" variations of each event.
| * For a regressed event, continue validation from the regression release | ||
| * instead of its original release. This enables repeated resolve cycles. |
There was a problem hiding this comment.
Docs seems unlcear to me. What is "repeated resolve cycles"?
| return projectRelease._id.toHexString() > releaseId && releasesWithEvent.has(projectRelease.release); | ||
| }); | ||
|
|
||
| if (!isNewerThanLastOccurrence || occurredInRelease || occurredInNewerRelease) { |
| continue; | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
describe the logic first, then technical notes


Summary
Introduce release-based detection of likely fixed events and track regressions when resolved events occur again.
Changes
release-validatorworker.resolvedInRelease.regressionInReleasefor occurrences in the resolved or newer releases.