Skip to content

Conversation

@JPeer264
Copy link
Member

@JPeer264 JPeer264 commented Jan 16, 2026

The CF_VERSION_METADATA only has one reason - to add the release id.

Since we already set the release when SENTRY_RELEASE is enabled automatically, we can do the same for CF_VERSION_METADATA. The docs will then also be updated to state how the release id can be set in different ways: getsentry/sentry-docs#16006

Closes #18856 (added automatically)
Closes JS-1489

@linear
Copy link

linear bot commented Jan 16, 2026

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

const result = getFinalOptions(userOptions, env);

expect(result).toEqual({ dsn: 'test-dsn', release: undefined });
});
Copy link

Choose a reason for hiding this comment

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

Missing integration or E2E test for new feature

Low Severity · Bugbot Rules

This feat PR adds support for CF_VERSION_METADATA as a release source but only includes unit tests. The user-specified review rules require that feat PRs include at least one integration or E2E test. While the unit tests thoroughly cover the getFinalOptions logic, an integration test validating the feature works correctly in an actual Cloudflare environment would strengthen confidence in the change.

Fix in Cursor Fix in Web


it('ignores CF_VERSION_METADATA when id is not a string', () => {
const userOptions = { dsn: 'test-dsn' };
const env = { CF_VERSION_METADATA: { id: 123 } };
Copy link
Member

Choose a reason for hiding this comment

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

l: can this happen/is it common to provide a non-string id? If so, we could stringify the release. Though only worth doing if this is actually a thing

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not defined what the version ID can be. Right now the id is always a UUID, so a string. But I'm not sure if this is always the case.

@github-actions
Copy link
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,294 - 8,810 +5%
GET With Sentry 1,715 18% 1,680 +2%
GET With Sentry (error only) 6,162 66% 6,010 +3%
POST Baseline 1,214 - 1,167 +4%
POST With Sentry 603 50% 595 +1%
POST With Sentry (error only) 1,076 89% 1,047 +3%
MYSQL Baseline 3,365 - 3,218 +5%
MYSQL With Sentry 465 14% 452 +3%
MYSQL With Sentry (error only) 2,738 81% 2,621 +4%

View base workflow run

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.

feat(cloudflare): Automatically set the release id when CF_VERSION_METADATA is enabled

4 participants