Skip to content

Add release validator and regression tracking - #590

Open
alisawavezen12 wants to merge 7 commits into
masterfrom
feat/release-validator-worker
Open

alisawavezen12 wants to merge 7 commits into
masterfrom
feat/release-validator-worker

Conversation

@alisawavezen12

@alisawavezen12 alisawavezen12 commented Sep 17, 2026

Copy link
Copy Markdown

Summary

Introduce release-based detection of likely fixed events and track regressions when resolved events occur again.

Changes

  • Add a scheduled release-validator worker.
  • Check unchecked releases between 24 hours and 30 days old.
  • Mark events with the first eligible resolvedInRelease.
  • Store release names directly on new repetitions.
  • Track regressionInRelease for occurrences in the resolved or newer releases.
  • Support repeated resolution and regression cycles.
  • Add tests for validation, grouping, release maps, and regression scenarios.

@codex-assistant

Copy link
Copy Markdown

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.

@codex-assistant

Copy link
Copy Markdown

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.

@codex-assistant

Copy link
Copy Markdown

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.

@codex-assistant

Copy link
Copy Markdown

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.

@alisawavezen12 alisawavezen12 changed the title Add release validator worker Add release validator and regression tracking Sep 18, 2026
@codex-assistant

Copy link
Copy Markdown

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.

@codex-assistant
codex-assistant Bot marked this pull request as ready for review September 18, 2026 15:25
@codex-assistant

Copy link
Copy Markdown

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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to check if task.payload.release is newer than existedEvent.resolvedInRelease

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do this later in the markRegression function.

import type { GroupedEventDBScheme, RepetitionDBScheme } from '@hawk.so/types';

/**
* Build a map of releases in which each event occurred.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Build a map of releases in which each event occurred.
* Build a map of releases in which each event occurred ordered from old to new

* @param projectId - project identifier
* @param releasesToCheck - ready releases ordered from oldest to newest
*/
async function validateProject(db: Db, projectId: string, releasesToCheck: ReleaseDBScheme[]): Promise<void> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add docs to main parts of algorythm

Comment on lines +53 to +62
const allProjectReleases = await releasesCollection
.find({
projectId,
release: {
$type: 'string',
$ne: '',
},
})
.sort({ _id: 1 })
.toArray();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already found all releases at validateReleases, looks like this query is redundant. And I'm not sure we need to groupReleasesByProject - can't we just iterate over fetched releases?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In validateReleases, we don't retrieve all releases, only that haven't been checked yet.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 1 Medium severity

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.

Comment thread package.json
Comment thread workers/grouper/src/index.ts
Comment thread workers/release-validator/src/utils/build-event-release-map.ts
Comment thread workers/release-validator/src/validate-releases.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants