Skip to content

Timeline: add Secret Scanning metadata timeline events#8148

Draft
janmaarten-a11y wants to merge 1 commit into
mainfrom
janmaarten-a11y-timeline-ss-metadata-events
Draft

Timeline: add Secret Scanning metadata timeline events#8148
janmaarten-a11y wants to merge 1 commit into
mainfrom
janmaarten-a11y-timeline-ss-metadata-events

Conversation

@janmaarten-a11y

Copy link
Copy Markdown
Contributor

This adds the two Secret Scanning alert timeline events that landed upstream after the original Phase 2 audit (github/primer#6663): MetadataCreated and MetadataRemoved. Both were missing from our merged Secret Scanning story file because they did not yet exist in the live switch when the audit was taken.

The change adds one new exported Storybook story, EventMetadata, to Timeline.secret-scanning.features.stories.tsx. It contains two VariantSections that recreate the live events using the shared story helpers already in the file:

  • Extended metadata found (MetadataCreated): FileAddedIcon on the default (gray) badge, GitHub system actor, copy "found extended metadata about this secret".
  • Extended metadata removed (MetadataRemoved): FileRemovedIcon on the default (gray) badge, GitHub system actor, copy "removed extended metadata after it expired".

Both events pass isGitHubActor in the live code, so the actor renders as the GitHub system actor (MarkGithubIcon + bold "GitHub", no avatar), matching the existing EventCreated story. 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, package packages/secret-scanning-alerts/. The dispatch lives in components/show/AlertTimeline.tsx (switch (event.type)), verified against origin/main:

  • case TimelineEventType.MetadataCreated renders <FileAddedIcon /> + "found extended metadata about this secret" with isGitHubActor.
  • case TimelineEventType.MetadataRemoved renders <FileRemovedIcon /> + "removed extended metadata after it expired" with isGitHubActor.

The enum in types/alert-types.ts defines MetadataCreated: 'METADATA_CREATED' and MetadataRemoved: 'METADATA_REMOVED'.

Changelog

New

  • EventMetadata Storybook story under Components/Timeline/Events/Secret Scanning, covering the MetadataCreated and MetadataRemoved events.

Changed

  • Updated the Secret Scanning story file header comment so it stays accurate now that the metadata events are included.

Removed

  • N/A

Rollout strategy

  • None; this is a Storybook-only change. It adds example stories and does not touch any published component code, so it has no consumer-facing impact.

Testing & Reviewing

This is Storybook-only by design. It is intentionally NOT wired into Timeline.docs.json or build.ts, and it deliberately omits data-* filtering attributes (deferred to Phase 3).

  • prettier, eslint, and type-check pass with zero new errors. Stylelint is not applicable (this file has no CSS module).
  • Rendered the new EventMetadata story 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.

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 02b8ad7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: Timeline integration-tests: skipped manually Changes in this PR do not require an integration test skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants