Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry: Add precedingUpgrade data to dev/build/error events #20136

Merged
merged 3 commits into from
Dec 7, 2022

Conversation

shilman
Copy link
Member

@shilman shilman commented Dec 7, 2022

Issue:

What I did

If it's the first dev/build/error run after an upgrade, record a reference to that upgrade. This will allow us to track failures more easily and improve our upgrade heuristics.

This PR is a replacement for #20084 and #20099. In addition to improving the logic to avoid double-counting, it also adds a mutex around the cache saving.

The mutex code needs tests in a second iteration. But the error showed up in CI before, so for now we're going to use that as a sanity check.

How to test

In a test project, where sb is aliased to your local version:

STORYBOOK_TELEMETRY_DEBUG=true sb upgrade --prerelease
STORYBOOK_TELEMETRY_DEBUG=true sb dev    
STORYBOOK_TELEMETRY_DEBUG=true sb dev

The first dev event should contain extra data like

    "precedingUpgrade": {
      "timestamp": 1670159585083,
      "eventType": "upgrade",
      "eventId": "Y54r_tWjm9BFrYKGRHQt8",
      "sessionId": "U9A7qs-aiuDQt6tO4z_rv"
    },

The second should have none

To test an error, add one to your .storybook/main.js

@shilman shilman added maintenance User-facing maintenance tasks telemetry labels Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks telemetry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants