Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/pinact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ files:
- pattern: workflows/*.yaml

rules:
# dtolnay publishes toolchain-specific commits without matching Git tags,
# so pinact cannot verify the toolchain version as an action release tag.
# The Vitest invariant still requires a full SHA and explanatory comment.
- ignore: true
conditions:
- expr: ActionName == "dtolnay/rust-toolchain"

# gh-aw owns generated lockfile annotations. Preserve its major-version
# comments while the Vitest invariant still enforces a full SHA and comment.
- ignore: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ jobs:
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@2d81d658c8c4093152107cdb91c1e9545a9f992c # 1.94.1
uses: dtolnay/rust-toolchain@2d81d658c8c4093152107cdb91c1e9545a9f992c # toolchain: 1.94.1
with:
toolchain: 1.94.1
components: rustfmt, clippy
Expand Down Expand Up @@ -703,7 +703,7 @@ jobs:
run: pnpm install --frozen-lockfile --ignore-scripts

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@2d81d658c8c4093152107cdb91c1e9545a9f992c # 1.94.1
uses: dtolnay/rust-toolchain@2d81d658c8c4093152107cdb91c1e9545a9f992c # toolchain: 1.94.1
with:
toolchain: 1.94.1

Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/contribution-data.yml

This file was deleted.

1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Todd Anglin <647319+toddanglin@users.noreply.github.com> Todd Anglin <Todd.Anglin@microsoft.com>
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ unblock a PR.

Thank the contributor and link any follow-up work. Once merged, the author appears in the
"Thank you" section of the [Contribute page](https://microsoft.github.io/scope/community/contribute/#thank-you)
and on the landing page after the merge-triggered contribution-data workflow completes. The PR
owner checks the post-merge result and coordinates a fix or revert if needed.
and on the landing page after GitHub refreshes the repository contributor statistics. The PR owner
checks the post-merge result and coordinates a fix or revert if needed.

If a contribution is not a fit, explain why and close it promptly. When a PR is waiting on the
contributor after a clear request for information or changes, send a reminder after **two weeks
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe("GitHub Action pinning", () => {
it.each([
`uses: actions/checkout@${sha} # v4.4.0`,
`uses: "actions/checkout@${sha}" # v4.4.0`,
`uses: dtolnay/rust-toolchain@${sha} # 1.94.1`,
`uses: dtolnay/rust-toolchain@${sha} # toolchain: 1.94.1`,
"uses: ./path/to/local-action",
"uses: docker://alpine:3.22",
])("accepts immutable, local or container reference: %s", (line) => {
Expand Down
40 changes: 20 additions & 20 deletions website/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,35 +221,35 @@ player or its scripts.
### Contributors

The landing page (an avatar wall) and the **Community → Contributors**
page (a card grid) thank every author of a merged pull request,
community and Microsoft alike:

- The publisher writes `contributors.jsonl` to `website-data`. It
counts merged PRs whose author is a user, not a bot (`[bot]` suffix).
Team members count too; don't filter on `authorAssociation`.
- [`.github/workflows/contribution-data.yml`](../.github/workflows/contribution-data.yml)
runs after pushes to `main` (including merged pull requests) and on
demand. It updates the orphan data branch only when the deterministic
file changes.
- One line per person, `{"login":"…","prs":N}`, with sorted keys and
sorted by lowercase login. No avatar URLs or timestamps; avatars come
from `https://github.com/<login>.png`, and a failed image shows the
login's initial.
- The browser sorts by merged PRs, then login. The wall shows up to
page (a card grid) thank everyone with commits attributed on the
repository's default branch (`main`), community and Microsoft alike:

- The browser calls GitHub's repository contributors endpoint directly,
follows its pagination links, and uses `contributions` as the number of
commits attributed on the default branch. It excludes bots and anonymous
entries. GitHub may cache these statistics for a few hours.
- No token is shipped to the browser. The public endpoint's unauthenticated
rate limit applies; an error keeps the fallback link to GitHub's contributor
graph visible. In local development only, a failed request uses
[`contributors.sample.json`](src/data/contributors.sample.json).
- No avatar URLs or timestamps are stored; avatars come from
`https://github.com/<login>.png`, and a failed image shows the login's
initial.
- The browser sorts by default-branch commits, then login. The wall shows up to
`limit` items; the last slot becomes a "+N" bubble that links to
the full grid. The grid shows `limit` cards (30 on the Contributors
page) and a "Show all N contributors" button, unless only one card
would stay hidden. Each person links to their merged PRs.
would stay hidden. Each person still links to their merged PRs; copy
must not imply that this destination explains the displayed commit
count.
- Wall tooltips get a `--tip-shift` so they stay inside the wall (a
hidden tip on an edge avatar would otherwise make narrow pages scroll
sideways). The intro and count are hidden in the empty and error
states. Check 0, 1, a few, and more contributors than fit the width,
on desktop and mobile, when changing the layout.
- Set `PUBLIC_CONTRIBUTORS_URL` to point at another file
([`contributors.ts`](src/scripts/contributors.ts)). In
`pnpm run dev` a failed fetch falls back to
[`contributors.sample.jsonl`](src/data/contributors.sample.jsonl),
which lists real contributors only.
([`contributors.ts`](src/scripts/contributors.ts)) that returns GitHub's
contributor-array shape.
- Logins are user data: render them with `textContent` or attributes
only.
### Style
Expand Down
8 changes: 4 additions & 4 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ table of contents, code examples, and previous/next navigation.
example, and the contributor avatars (pop-in, hover tooltips), with
pause controls and reduced-motion support. The logo and documentation
chrome remain still.
- **Contribution:** a landing-page wall and full grid thank merged-PR
contributors, refreshed after merges from a data branch without a
redeploy. The publisher is `.github/workflows/contribution-data.yml`;
see "Contributors" in `AGENTS.md`.
- **Contribution:** a landing-page wall and full grid thank contributors with
commits attributed on the default branch (`main`), loaded from GitHub's
repository contributor statistics. Contributor links still open merged
pull requests; see "Contributors" in `AGENTS.md`.

### Showreel

Expand Down
4 changes: 2 additions & 2 deletions website/src/components/contribute/ContributeTeaser.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const allHref = `${import.meta.env.BASE_URL.replace(/\/$/, '')}/community/contri
</div>
<p class="contrib-count" data-count-pill>
<span class="contrib-count__pulse" aria-hidden="true"></span>
<span aria-hidden="true"><span class="contrib-count__value" data-count>0</span> <span data-count-label>contributors</span> · <span data-prs>0 merged PRs</span></span>
<span aria-hidden="true"><span class="contrib-count__value" data-count>0</span> <span data-count-label>contributors</span> · <span data-commits>0 commits on main</span></span>
<span class="sr-only" data-count-text></span>
</p>
</div>
<p class="thanks-intro" data-reveal>Everyone below got a pull request merged into Scope. Hover an avatar to see how many.</p>
<p class="thanks-intro" data-reveal>Everyone below has commits attributed on Scope's main branch. Hover an avatar to see how many; select it to view merged pull requests.</p>
</Contributors>
<a class="scope-text-link scope-contrib__all" href={allHref}>See all contributors <span aria-hidden="true">&rarr;</span></a>
</section>
5 changes: 2 additions & 3 deletions website/src/components/contribute/Contributors.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
// Licensed under the MIT License.

// Thanks contributors: everyone (bots aside) who got a pull request merged.
// The contribution-data workflow publishes the list to the website-data
// branch, and the browser fetches it. See website/AGENTS.md.
// The browser fetches GitHub's contributor statistics. See website/AGENTS.md.
import '../../styles/contributions.css';
import '../../styles/contributors.css';
import { CONTRIBUTORS_DATA_URL, CONTRIBUTORS_GRAPH_URL } from '../../scripts/contributors';
Expand Down Expand Up @@ -46,7 +45,7 @@ const listId = `thanks-list-${variant}`;
)
}
<p class="contrib-message thanks-message--empty">
No pull request contributors are available yet.
No contributors with commits on main are available yet.
</p>
<p class="contrib-message thanks-message--error">
We couldn't load the list. See
Expand Down
10 changes: 6 additions & 4 deletions website/src/content/docs/community/contribute.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
title: Contributors
description: Thanking everyone whose pull requests have been merged into Scope.
description: Thanking everyone with commits attributed on Scope's main branch.
---

import Contributors from '../../../components/contribute/Contributors.astro';

Thank you to everyone who got a pull request merged, from the community
and the Scope team alike. Select a name to see their merged pull requests. This list also
refreshes automatically after pull requests merge.
Thank you to everyone with commits attributed on Scope's main branch, from the
community and the Scope team alike. Counts come from GitHub's repository
contributor statistics for the default branch. Select a name to see that
person's merged pull requests. The list refreshes automatically after changes
land on main.

<Contributors variant="grid" limit={30} />
11 changes: 11 additions & 0 deletions website/src/data/contributors.sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{"contributions":515,"login":"cedricvidal","type":"User"},
{"contributions":9,"login":"chanezon","type":"User"},
{"contributions":2,"login":"cmaneu","type":"User"},
{"contributions":58,"login":"duffney","type":"User"},
{"contributions":1,"login":"Gile987","type":"User"},
{"contributions":2,"login":"idhanth","type":"User"},
{"contributions":1,"login":"itsmeasadali","type":"User"},
{"contributions":46,"login":"manekinekko","type":"User"},
{"contributions":2,"login":"mnkj0021","type":"User"}
]
9 changes: 0 additions & 9 deletions website/src/data/contributors.sample.jsonl

This file was deleted.

24 changes: 12 additions & 12 deletions website/src/scripts/contributors-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import {
CONTRIBUTORS_DATA_URL,
avatarUrl,
commitsLabel,
contributorsLabel,
fetchContributors,
firstPage,
parseContributors,
prsLabel,
prsUrl,
showAllLabel,
sortForDisplay,
tipShift,
totalPrs,
totalCommits,
visible,
type Contributor,
type ContributorsResult,
Expand All @@ -28,7 +28,7 @@ const LIFT_SCALE = 1.14;
const MAX_STAGGER_STEPS = 24;

/**
* Thanks contributors: authors of merged pull requests, bots aside. Renders
* Thanks default-branch commit contributors, bots aside. Renders
* an avatar wall (landing) or a card grid (Contribute page). Without
* JavaScript a link to the GitHub contributors graph stays visible. Motion
* is skipped entirely when the visitor prefers reduced motion.
Expand Down Expand Up @@ -85,16 +85,16 @@ class ScopeContributors extends HTMLElement {
// Development fallback only; production builds omit the sample.
if (import.meta.env.DEV) {
console.info('[contributors] Live list unavailable; using the dev sample.', error);
const { default: text } = await import('../data/contributors.sample.jsonl?raw');
result = parseContributors(text);
const { default: text } = await import('../data/contributors.sample.json?raw');
result = parseContributors(JSON.parse(text));
sample = true;
} else {
console.warn('[contributors] Could not load the live list.', error);
this.setState('error');
return;
}
}
if (result.skipped.length) console.warn(`[contributors] Skipped invalid lines: ${result.skipped.join(', ')}`);
if (result.skipped.length) console.warn(`[contributors] Skipped invalid entries: ${result.skipped.join(', ')}`);
this.querySelectorAll<HTMLElement>('[data-sample-tag]').forEach((tag) => { tag.hidden = !sample; });
await this.render(result.contributors);
}
Expand All @@ -119,10 +119,10 @@ class ScopeContributors extends HTMLElement {
this.updateShowAll(grid ? hidden : 0);

const people = this.contributors.length;
const prs = totalPrs(this.contributors);
const commits = totalCommits(this.contributors);
this.querySelectorAll('[data-count-label]').forEach((label) => { label.textContent = contributorsLabel(people); });
this.querySelectorAll('[data-prs]').forEach((element) => { element.textContent = prsLabel(prs); });
this.querySelectorAll('[data-count-text]').forEach((text) => { text.textContent = `${people} ${contributorsLabel(people)}, ${prsLabel(prs)}`; });
this.querySelectorAll('[data-commits]').forEach((element) => { element.textContent = commitsLabel(commits); });
this.querySelectorAll('[data-count-text]').forEach((text) => { text.textContent = `${people} ${contributorsLabel(people)}, ${commitsLabel(commits)}`; });
this.loaded = true;
this.setState(people ? 'ready' : 'empty');
this.reveal();
Expand Down Expand Up @@ -252,14 +252,14 @@ class ScopeContributors extends HTMLElement {
}, { signal, passive: true });
}

// Logins come from published data, so every value is set as text or attribute.
// Logins come from GitHub data, so every value is set as text or attribute.
private avatar(contributor: Contributor): HTMLLIElement {
const item = this.item();
const link = this.link(item, 'thanks-avatar', prsUrl(contributor.login));
link.append(this.image(contributor, 56));
const tip = this.span(link, 'thanks-tip');
this.span(tip, 'thanks-tip__login', `@${contributor.login}`);
this.span(tip, 'thanks-tip__prs', prsLabel(contributor.prs));
this.span(tip, 'thanks-tip__commits', commitsLabel(contributor.commits));
this.span(link, 'sr-only', ' (opens in a new tab)');
return item;
}
Expand All @@ -270,7 +270,7 @@ class ScopeContributors extends HTMLElement {
link.append(this.image(contributor, 96));
const body = this.span(link, 'thanks-card__body');
this.span(body, 'thanks-card__login', `@${contributor.login}`).title = `@${contributor.login}`;
this.span(body, 'thanks-card__prs', prsLabel(contributor.prs));
this.span(body, 'thanks-card__commits', commitsLabel(contributor.commits));
this.span(link, 'contrib-card__arrow thanks-card__arrow', '↗').setAttribute('aria-hidden', 'true');
this.span(link, 'sr-only', ' (opens in a new tab)');
return item;
Expand Down
Loading
Loading