Skip to content

Commit e5e13b9

Browse files
feat(Timeline): add SS reported leaf, classify GitHub actor as bot, drop stray Issues draft row
1 parent 1135a78 commit e5e13b9

5 files changed

Lines changed: 30 additions & 39 deletions

File tree

packages/react/src/Timeline/Timeline.issues.features.stories.tsx

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
GitCommitIcon,
1515
GitPullRequestIcon,
1616
IssueClosedIcon,
17-
IssueDraftIcon,
1817
IssueOpenedIcon,
1918
IssueReopenedIcon,
2019
IssueTrackedByIcon,
@@ -385,23 +384,6 @@ export const EventState = () => (
385384
</Timeline.Item>
386385
</Timeline>
387386
</VariantSection>
388-
389-
{/* Converted from draft */}
390-
<VariantSection label="Converted from draft">
391-
<Timeline aria-label="Issue timeline">
392-
{/* Untagged: a metadata/auditOnly event that ISSUE_TAXONOMY does not yet enumerate as a distinct leaf (candidate leaf to add in a follow-up, not a defect). Emitting a data-event-type without a real catalog leaf would break the taxonomy single source of truth. */}
393-
<Timeline.Item>
394-
<Timeline.Badge>
395-
<Octicon icon={IssueDraftIcon} />
396-
</Timeline.Badge>
397-
<Timeline.Body>
398-
<UserActor href="#" muted />
399-
{'converted this from a draft issue '}
400-
<MutedTime date={new Date('2022-07-21T08:30:00Z')} href="#" />
401-
</Timeline.Body>
402-
</Timeline.Item>
403-
</Timeline>
404-
</VariantSection>
405387
</Examples>
406388
)
407389

@@ -574,7 +556,7 @@ export const EventDuplicates = () => (
574556
{/* Marked <canonical> as a duplicate of this issue — no right controls. */}
575557
<VariantSection label="Marked as canonical">
576558
<Timeline aria-label="Issue timeline">
577-
{/* Untagged: a metadata/auditOnly event that ISSUE_TAXONOMY does not yet enumerate as a distinct leaf (the catalog has only 'marked_as_duplicate'); candidate leaf to add in a follow-up, not a defect. */}
559+
{/* Untagged: verified against the redesign prototype (github/prototyping janmaarten-a11y/timeline-redesign-v1) as an intentional exclusion, this variant is not modeled as a distinct catalog leaf (the catalog has only 'marked_as_duplicate'); no leaf -> no data-* tag. */}
578560
<Timeline.Item>
579561
<Timeline.Badge>
580562
<Octicon icon={DuplicateIcon} />
@@ -597,7 +579,7 @@ export const EventDuplicates = () => (
597579
{/* Unmarked this as a duplicate of <canonical>. */}
598580
<VariantSection label="Unmarked as duplicate">
599581
<Timeline aria-label="Issue timeline">
600-
{/* Untagged: a metadata/auditOnly event that ISSUE_TAXONOMY does not yet enumerate as a distinct leaf (the catalog has only 'marked_as_duplicate'); candidate leaf to add in a follow-up, not a defect. */}
582+
{/* Untagged: verified against the redesign prototype (github/prototyping janmaarten-a11y/timeline-redesign-v1) as an intentional exclusion, this variant is not modeled as a distinct catalog leaf (the catalog has only 'marked_as_duplicate'); no leaf -> no data-* tag. */}
601583
<Timeline.Item>
602584
<Timeline.Badge>
603585
<Octicon icon={DuplicateIcon} />
@@ -619,7 +601,7 @@ export const EventDuplicates = () => (
619601
{/* Unmarked <canonical> as a duplicate of this issue. */}
620602
<VariantSection label="Unmarked as canonical">
621603
<Timeline aria-label="Issue timeline">
622-
{/* Untagged: a metadata/auditOnly event that ISSUE_TAXONOMY does not yet enumerate as a distinct leaf (the catalog has only 'marked_as_duplicate'); candidate leaf to add in a follow-up, not a defect. */}
604+
{/* Untagged: verified against the redesign prototype (github/prototyping janmaarten-a11y/timeline-redesign-v1) as an intentional exclusion, this variant is not modeled as a distinct catalog leaf (the catalog has only 'marked_as_duplicate'); no leaf -> no data-* tag. */}
623605
<Timeline.Item>
624606
<Timeline.Badge>
625607
<Octicon icon={DuplicateIcon} />
@@ -1860,7 +1842,7 @@ export const EventLabels = () => (
18601842
with "and" between them. */}
18611843
<VariantSection label="Labels added and removed">
18621844
<Timeline aria-label="Issue timeline">
1863-
{/* Untagged: a metadata/auditOnly rolled-up event (labeled + unlabeled in one row) that ISSUE_TAXONOMY does not yet enumerate as a distinct leaf; candidate leaf to add in a follow-up, not a defect. */}
1845+
{/* Untagged: a rolled-up event (labeled + unlabeled in one row) verified against the redesign prototype (github/prototyping janmaarten-a11y/timeline-redesign-v1) as an intentional exclusion, not modeled as a distinct catalog leaf; no leaf -> no data-* tag. */}
18641846
<Timeline.Item>
18651847
<Timeline.Badge>
18661848
<Octicon icon={TagIcon} />

packages/react/src/Timeline/Timeline.secret-scanning.features.stories.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,8 @@ export const EventCreated = () => (
154154
<VariantSection label="Created">
155155
<Timeline aria-label="Secret scanning alert timeline">
156156
{/* `detected` leaf. Renders the GitHub SYSTEM-IDENTITY actor
157-
(`<UserActor login="GitHub" …>`); GitHub is not in the bot set, so
158-
actorTypeForLogin('GitHub') classifies it as 'user' -> data-actor-type='user'.
159-
FLAGGED: whether a system identity should classify as user vs bot is
160-
worth confirming (see report). */}
157+
(`<UserActor login="GitHub" …>`); `github` is in the bot set, so
158+
actorTypeForLogin('GitHub') classifies it as 'bot' -> data-actor-type='bot'. */}
161159
<Timeline.Item {...eventDataAttributesFor('secret-scanning', 'detected', 'GitHub')}>
162160
<Timeline.Badge variant="success">
163161
<Octicon icon={ShieldIcon} />
@@ -389,7 +387,9 @@ export const EventBypass = () => (
389387
<Timeline aria-label="Secret scanning alert timeline">
390388
{/* UNTAGGED: the delegated-BYPASS request/approve flow has no catalog
391389
leaf. The catalog's dismissal_requested / dismissal_reviewed cover the
392-
delegated-CLOSURE flow, a different thing. No leaf -> no data-* tag. */}
390+
delegated-CLOSURE flow, a different thing. Verified against the redesign
391+
prototype (github/prototyping janmaarten-a11y/timeline-redesign-v1) as an
392+
intentional exclusion. No leaf -> no data-* tag. */}
393393
<Timeline.Item>
394394
<Timeline.Badge>
395395
<Octicon icon={CommentIcon} />
@@ -407,7 +407,8 @@ export const EventBypass = () => (
407407
<VariantSection label="Bypass approved (delegated bypass enabled)">
408408
<Timeline aria-label="Secret scanning alert timeline">
409409
{/* UNTAGGED: delegated-BYPASS flow, no catalog leaf (see the request
410-
variant above). No leaf -> no data-* tag. */}
410+
variant above), verified against the redesign prototype as an
411+
intentional exclusion. No leaf -> no data-* tag. */}
411412
<Timeline.Item>
412413
<Timeline.Badge>
413414
<Octicon icon={CheckCircleIcon} />
@@ -440,7 +441,7 @@ export const EventValidityChange = () => (
440441
{/* Active — automated (GitHub), AlertIcon on danger (red) */}
441442
<VariantSection label="Validity: active (automated)">
442443
<Timeline aria-label="Secret scanning alert timeline">
443-
{/* `validity_changed` leaf; automated -> GitHub system actor -> 'user'. */}
444+
{/* `validity_changed` leaf; automated -> GitHub system actor -> 'bot'. */}
444445
<Timeline.Item {...eventDataAttributesFor('secret-scanning', 'validity_changed', 'GitHub')}>
445446
<Timeline.Badge variant="danger">
446447
<Octicon icon={AlertIcon} />
@@ -474,7 +475,7 @@ export const EventValidityChange = () => (
474475
{/* Inactive — automated (GitHub), SkipIcon on default (gray) */}
475476
<VariantSection label="Validity: inactive (automated)">
476477
<Timeline aria-label="Secret scanning alert timeline">
477-
{/* `validity_changed` leaf; automated -> GitHub system actor -> 'user'. */}
478+
{/* `validity_changed` leaf; automated -> GitHub system actor -> 'bot'. */}
478479
<Timeline.Item {...eventDataAttributesFor('secret-scanning', 'validity_changed', 'GitHub')}>
479480
<Timeline.Badge>
480481
<Octicon icon={SkipIcon} />
@@ -508,7 +509,7 @@ export const EventValidityChange = () => (
508509
{/* Unknown — automated (GitHub), AlertIcon on attention (amber) */}
509510
<VariantSection label="Validity: unknown (automated)">
510511
<Timeline aria-label="Secret scanning alert timeline">
511-
{/* `validity_changed` leaf; automated -> GitHub system actor -> 'user'. */}
512+
{/* `validity_changed` leaf; automated -> GitHub system actor -> 'bot'. */}
512513
<Timeline.Item {...eventDataAttributesFor('secret-scanning', 'validity_changed', 'GitHub')}>
513514
<Timeline.Badge variant="attention">
514515
<Octicon icon={AlertIcon} />
@@ -554,11 +555,10 @@ export const EventReport = () => (
554555
{/* Reported — ShieldCheckIcon, default (gray) badge, user actor */}
555556
<VariantSection label="Reported">
556557
<Timeline aria-label="Secret scanning alert timeline">
557-
{/* UNTAGGED: the catalog maps Report -> validity_changed, but
558-
github/primer#6888 lists that mapping as UNCONFIRMED (open item #2).
559-
Emitting an unconfirmed value would bake in a guess, so leave untagged
560-
until the docs confirm the leaf. */}
561-
<Timeline.Item>
558+
{/* `reported` leaf (findings). Live AlertTimeline.tsx `TimelineEventType.Report`
559+
does NOT pass `isGitHubActor`, so the actor is the USER — resolves to
560+
data-actor-type='user'. */}
561+
<Timeline.Item {...eventDataAttributesFor('secret-scanning', 'reported', 'monalisa')}>
562562
<Timeline.Badge>
563563
<Octicon icon={ShieldCheckIcon} />
564564
</Timeline.Badge>
@@ -745,7 +745,9 @@ export const EventClosureRequest = () => (
745745
<VariantSection label="Dismissal request cancelled">
746746
<Timeline aria-label="Secret scanning alert timeline">
747747
{/* UNTAGGED: Secret Scanning has NO dismissal_cancelled leaf (unlike
748-
Dependabot). No leaf -> no data-* tag. */}
748+
Dependabot); verified against the redesign prototype
749+
(github/prototyping janmaarten-a11y/timeline-redesign-v1) as an
750+
intentional exclusion. No leaf -> no data-* tag. */}
749751
<Timeline.Item>
750752
<Timeline.Badge>
751753
<Octicon icon={SkipIcon} />

packages/react/src/Timeline/taxonomy/actorType.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const BOT_LOGINS: ReadonlySet<string> = new Set([
2424
'dependabot-preview',
2525
'github-actions',
2626
'github-license-compliance',
27+
// `github` is the platform system identity (e.g. Secret Scanning's automated
28+
// detection/validity events). Classified as a bot so automated-vs-human
29+
// filtering treats system activity like other automation; a distinct
30+
// 'system' actor type is a possible future refinement.
31+
'github',
2732
'copilot',
2833
'hubot',
2934
])

packages/react/src/Timeline/taxonomy/eventTaxonomy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ describe('actorTypeForLogin', () => {
270270
})
271271

272272
it('classifies known first-party automation logins as bots', () => {
273-
for (const login of ['dependabot', 'github-actions', 'github-license-compliance', 'copilot', 'hubot']) {
273+
for (const login of ['dependabot', 'github-actions', 'github-license-compliance', 'github', 'copilot', 'hubot']) {
274274
expect(actorTypeForLogin(login)).toBe('bot')
275275
expect(actorTypeForLogin(login.toUpperCase())).toBe('bot')
276276
}

packages/react/src/Timeline/taxonomy/eventTaxonomy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export const LICENSE_COMPLIANCE_TAXONOMY: Record<LicenseComplianceEventType, Eve
151151
export type SecretScanningEventType =
152152
| 'detected'
153153
| 'validity_changed'
154+
| 'reported'
154155
| 'bypassed'
155156
| 'dismissal_requested'
156157
| 'dismissal_reviewed'
@@ -159,7 +160,8 @@ export type SecretScanningEventType =
159160

160161
export const SECRET_SCANNING_TAXONOMY: Record<SecretScanningEventType, EventTaxonomyEntry> = {
161162
detected: {category: 'findings', hasActor: true}, // `Creation`; system GitHub actor (isGitHubActor), rendered
162-
validity_changed: {category: 'findings', hasActor: true}, // `Report` path; user actor
163+
validity_changed: {category: 'findings', hasActor: true}, // `ValidityChange` (token verification status); system 'GitHub' actor when automated, user when manual
164+
reported: {category: 'findings', hasActor: true}, // live AlertTimeline.tsx `TimelineEventType.Report`: "reported this secret"; user actor
163165
bypassed: {category: 'status', hasActor: true},
164166
dismissal_requested: {category: 'reviews', hasActor: true}, // `DelegatedClosureRequestOpened`
165167
dismissal_reviewed: {category: 'reviews', hasActor: true},

0 commit comments

Comments
 (0)