Skip to content

Commit

Permalink
Merge branch 'main' into toggle-switch-a11y-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerJDev authored Nov 15, 2024
2 parents 0d4a49f + 346ad0c commit e4060ce
Show file tree
Hide file tree
Showing 721 changed files with 18,752 additions and 6,589 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-cheetahs-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move Select component from team to staff flag
5 changes: 5 additions & 0 deletions .changeset/calm-meals-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move CounterLabel CSS module feature flag from staff to ga
5 changes: 5 additions & 0 deletions .changeset/chilled-goats-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move Spinner component from team to staff flag
5 changes: 0 additions & 5 deletions .changeset/clean-mails-accept.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/curly-bikes-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move Radio component from team to staff flag
5 changes: 5 additions & 0 deletions .changeset/dry-seals-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Convert TextInput to CSS module behind feature flag
5 changes: 5 additions & 0 deletions .changeset/fair-wolves-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Convert Breadcrumbs to css module behind feature flag
5 changes: 5 additions & 0 deletions .changeset/fast-hats-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move Pagehead component from team to staff flag
5 changes: 5 additions & 0 deletions .changeset/gentle-yaks-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Update `TreeView` component to use CSS Modules
5 changes: 0 additions & 5 deletions .changeset/gold-items-shave.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/grumpy-cherries-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move Details component from team to staff flag
5 changes: 5 additions & 0 deletions .changeset/honest-plums-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move Header component from team to staff flag
5 changes: 0 additions & 5 deletions .changeset/itchy-paws-bake.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/lovely-stingrays-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Convert CheckBoxOrRadioGroup to CSS modules behind feature flag
5 changes: 5 additions & 0 deletions .changeset/odd-seas-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move BranchName component from team to staff flag
5 changes: 5 additions & 0 deletions .changeset/old-weeks-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move Skeleton component from team to staff flag
5 changes: 5 additions & 0 deletions .changeset/polite-ligers-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

chore(ButtonGroup): Move ButtonGroup CSS module feature flag from staff to ga
5 changes: 5 additions & 0 deletions .changeset/real-fans-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Convert TextInput to use data attributes
5 changes: 0 additions & 5 deletions .changeset/six-colts-admire.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/twelve-kings-confess.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wild-maps-grow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wise-llamas-exist.md

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/check-for-integration-result-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Check for integration result comment

on:
issue_comment:
types: [created, edited]

jobs:
# note: this workflow always passes, it does not fail when integration tests are failing
check-for-integration-result-comment:
if: github.event.issue.pull_request
runs-on: ubuntu-latest
steps:
- name: Get integration result comment
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const INTEGRATION_LABEL_NAMES = {
// synced with https://github.com/primer/react/labels?q=integration-tests
skipped: 'integration-tests: skipped manually',
recommended: 'integration-tests: recommended',
failing: 'integration-tests: failing',
passing: 'integration-tests: passing'
};
const issue = {
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
};
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue(issue);
const existingIntegrationLabels = currentLabels
.map(label => label.name)
.filter(label => label.startsWith('integration-tests:'));
if (existingIntegrationLabels.includes(INTEGRATION_LABEL_NAMES.skipped)) return;
const result = await github.rest.issues.listComments(issue);
const integrationComments = result.data.filter(
comment =>
comment.user.login == 'primer-integration[bot]' &&
comment.body.includes('<!-- test-result')
);
if (integrationComments.length === 0) {
console.log('Integration comment with test-result not found');
return; // CI should pass if there's nothing to do
}
const latestComment = integrationComments.pop();
console.log(latestComment.body);
// based on comment message in github/github: https://github.com/github/github/blob/fe7fe9072fd913ec04255ce7403ae764e6c33d5f/.github/workflows/github-ci.yml#L664-L692
const pass = latestComment.body.includes('🟢');
console.log({ pass });
const newIntegrationLabel = pass ? INTEGRATION_LABEL_NAMES.passing : INTEGRATION_LABEL_NAMES.failing;
console.log({existingIntegrationLabels, newIntegrationLabel})
Object.values(INTEGRATION_LABEL_NAMES).map(async (name) => {
if (name === newIntegrationLabel) {
if (existingIntegrationLabels.includes(name)); // already added, nothing to do here
else await github.rest.issues.addLabels({...issue, labels: [newIntegrationLabel]});
} else if (existingIntegrationLabels.includes(name)) {
// remove outdated labels
await github.rest.issues.removeLabel({ ...issue, name });
}
});
55 changes: 26 additions & 29 deletions .github/workflows/recommend-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,46 +29,43 @@ jobs:
- name: Has diff?
run: echo ${{ steps.source-files.outputs.diff != '' }}

- name: Get or Create Comment
- name: Add label and comment
if: ${{ steps.source-files.outputs.diff != '' }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const result = await github.paginate(github.rest.issues.listComments, {
const INTEGRATION_LABEL_NAMES = {
// synced with https://github.com/primer/react/labels?q=integration-tests
skipped: 'integration-tests: skipped manually',
recommended: 'integration-tests: recommended',
failing: 'integration-tests: failing',
passing: 'integration-tests: passing'
}
const issue = {
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
});
}
const labels = await github.paginate(github.rest.issues.listLabelsOnIssue, issue);
const integrationLabels = labels.filter(label => label.name.startsWith('integration-tests'))
const hasPassingLabel = integrationLabels.find(label => label.name === INTEGRATION_LABEL_NAMES.passing)
const previousComment = result.filter(c => c.user.login == 'github-actions[bot]' && c.body.startsWith('<!-- recommend-integration-tests.yml -->'))
if (!previousComment.length) {
if (integrationLabels.length === 0) {
// recommend integration tests
await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.recommended]})
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
...issue,
body: '<!-- recommend-integration-tests.yml -->\n\n :wave: Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the [integration workflow](https://gh.io/testing_primer_at_dotcom). Thanks!'
})
}
- name: Add label
if: ${{ steps.source-files.outputs.diff != '' }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const result = await github.rest.issues.listLabelsOnIssue({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
})
const integrationLabels = result.data.filter(label => label.name.startsWith('integration-tests'))
if (!integrationLabels.length) {
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['integration-tests: recommended'],
} else if (hasPassingLabel) {
// recommend running integration tests again as there are new commits that might change the status
// note: we don't remove 'integration-tests: passing' label because this is only a suggestion/nudge
await github.rest.issues.addLabels({...issue, labels: [INTEGRATION_LABEL_NAMES.recommended]})
await github.rest.issues.createComment({
...issue,
body: '<!-- recommend-integration-tests.yml -->\n\n :wave: Hi, there are new commits since the last successful integration test. We recommend running the [integration workflow](https://gh.io/testing_primer_at_dotcom) once more, unless you are sure the new changes do not affect github/github. Thanks!'
})
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e4060ce

Please sign in to comment.