Timeline: add Secret Scanning metadata timeline events#8148
Timeline: add Secret Scanning metadata timeline events#8148janmaarten-a11y wants to merge 1 commit into
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Secret Scanning Timeline Storybook feature stories to include the two upstream timeline event types that were added after the original Phase 2 audit: MetadataCreated and MetadataRemoved.
Changes:
- Updated the file header comment to no longer claim the story set is the complete/finished set from the live
switch, and to explicitly mention the later-added metadata events. - Added a new exported Storybook story,
EventMetadata, with two variants (“Extended metadata found” and “Extended metadata removed”) matching the live copy and icons. - Added the required octicon imports (
FileAddedIcon,FileRemovedIcon) used by the new story.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/Timeline/Timeline.secret-scanning.features.stories.tsx | Adds EventMetadata story (created/removed variants) and updates documentation comment to keep the story inventory aligned with upstream Secret Scanning timeline behavior. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Low
This adds the two Secret Scanning alert timeline events that landed upstream after the original Phase 2 audit (github/primer#6663):
MetadataCreatedandMetadataRemoved. Both were missing from our merged Secret Scanning story file because they did not yet exist in the liveswitchwhen the audit was taken.The change adds one new exported Storybook story,
EventMetadata, toTimeline.secret-scanning.features.stories.tsx. It contains twoVariantSections that recreate the live events using the shared story helpers already in the file:MetadataCreated):FileAddedIconon the default (gray) badge, GitHub system actor, copy "found extended metadata about this secret".MetadataRemoved):FileRemovedIconon the default (gray) badge, GitHub system actor, copy "removed extended metadata after it expired".Both events pass
isGitHubActorin the live code, so the actor renders as the GitHub system actor (MarkGithubIcon+ bold "GitHub", no avatar), matching the existingEventCreatedstory. The file header comment is updated so it no longer claims the built set is the full set of live cases.Source of truth
github/github-ui, packagepackages/secret-scanning-alerts/. The dispatch lives incomponents/show/AlertTimeline.tsx(switch (event.type)), verified againstorigin/main:case TimelineEventType.MetadataCreatedrenders<FileAddedIcon />+ "found extended metadata about this secret" withisGitHubActor.case TimelineEventType.MetadataRemovedrenders<FileRemovedIcon />+ "removed extended metadata after it expired" withisGitHubActor.The enum in
types/alert-types.tsdefinesMetadataCreated: 'METADATA_CREATED'andMetadataRemoved: 'METADATA_REMOVED'.Changelog
New
EventMetadataStorybook story underComponents/Timeline/Events/Secret Scanning, covering theMetadataCreatedandMetadataRemovedevents.Changed
Removed
Rollout strategy
Testing & Reviewing
This is Storybook-only by design. It is intentionally NOT wired into
Timeline.docs.jsonorbuild.ts, and it deliberately omitsdata-*filtering attributes (deferred to Phase 3).EventMetadatastory headlessly in Chromium. Both rows render with the GitHub system actor (MarkGithubIcon+ bold "GitHub", no avatar) and the correct file icons (octicon-file-added/octicon-file-removed), with zero component or React console errors.To review: open Storybook and navigate to
Components/Timeline/Events/Secret Scanning->EventMetadata.