Skip to content

Expose event release lifecycle metadata - #688

Open
alisawavezen12 wants to merge 8 commits into
masterfrom
feat/event-release-metadata
Open

alisawavezen12 wants to merge 8 commits into
masterfrom
feat/event-release-metadata

Conversation

@alisawavezen12

@alisawavezen12 alisawavezen12 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Adding "Resolved", "New", "Regression" label to events. Related codex-team/hawk.workers#590

Summary

  • Add nullable firstSeenInRelease, resolvedInRelease, and regressionInRelease fields to GraphQL Event.
  • Preserve the original event's release when viewing a repetition.

Include unchecked releases without events and ignore empty or
placeholder release names.

@neSpecc neSpecc left a comment

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.

A few notes on the release metadata. The most important one is the unguarded event.payload access in _composeEventWithRepetition; the rest are about consistency of release names and the cost/semantics of latestRelease.

Comment thread src/models/eventsFactory.js Resolved
Comment thread src/models/releasesFactory.ts Resolved
Comment thread src/models/releasesFactory.ts Resolved
Comment thread src/resolvers/project.js Resolved
Comment thread src/models/releasesFactory.ts Resolved
Comment thread src/models/releasesFactory.ts Resolved
Comment thread src/models/releasesFactory.ts Resolved
Comment thread src/resolvers/event.js Resolved
Comment thread src/resolvers/event.js Resolved

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.

🟡 Changes recommended

The newest-release lookup uses an index that cannot satisfy the _id sort, forcing each new request to scan the project's full release history.

1 open issue
What changed in this PR

Exposes event release lifecycle metadata through GraphQL to support New, Resolved, and Regression labels while preserving the original event’s release when viewing repetitions.

Changes:

  • Adds nullable lifecycle release fields and an isNew flag based on the newest registered project release.
  • Normalizes release identifiers and preserves original metadata across event composition paths.
  • Adds utility, factory, and GraphQL tests; bumps the package version to 1.7.0.
File Description
test/​utils/​releaseName.test.ts Tests release identifier normalization.
test/​resolvers/​event-release-metadata.test.ts Tests GraphQL metadata, isNew, and request caching.
test/​models/​releasesFactory-is-new.test.ts Tests latest-release comparisons, caching, and Mongo query behavior.
test/​models/​eventsFactory-release-metadata.test.ts Tests metadata preservation across originals and repetitions.
src/​utils/​releaseName.ts Adds shared release-name normalization.
src/​typeDefs/​event.ts Declares lifecycle release fields and isNew.
src/​resolvers/​event.js Resolves normalized metadata and release-based newness.
src/​models/​releasesFactory.ts Adds a cached latest-registered-release lookup.
src/​models/​eventsFactory.js Preserves original lifecycle metadata during composition.
package.json Bumps the version to 1.7.0.

Review effort: Balanced

Comment thread src/models/releasesFactory.ts Resolved
Comment thread src/models/releasesFactory.ts Resolved
Comment thread src/models/releasesFactory.ts Resolved
Use a cursor to find the newest valid registered release, sharing
in-flight lookups through request context rather than factory state.
Handle
lookup failures safely and update resolver documentation and tests.
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