-
Notifications
You must be signed in to change notification settings - Fork 34
web-features bot improvements for interop 2027 #1318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
873d908
7616379
85bb6e4
491d426
87b1ff8
cf75461
ab9bbfd
1b06476
10e65e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,86 @@ | ||
| # This GitHub Actions workflow identifies web features in new and edited issues. | ||
| # Identified features are posted as a comment on the issue. | ||
| name: Identify Web Features in Issues | ||
| # This GitHub Actions workflow identifies web-features in new and edited focus-area-proposal issues. | ||
| # Identified web-features are listed as a comment on the issue. | ||
| name: Identify web-features in focus area proposals | ||
|
|
||
| on: | ||
| # Trigger the workflow either when a single issue is opened, edited, reopened, or labeled. | ||
| # The labeled trigger only applies when the label is 'focus-area-proposal'. | ||
| issues: | ||
| types: [opened, edited] | ||
| types: [opened, edited, labeled, reopened] | ||
| # Trigger the workflow when we update the package.json file (web-features dependency). | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - scripts/package.json | ||
| - scripts/package-lock.json | ||
| # Lets us trigger the job manually. | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write | ||
|
|
||
| jobs: | ||
| run-script: | ||
|
|
||
| # The process-issue job runs when a single issue is opened, edited, reopened or labeled. | ||
| process-issue: | ||
| if: >- | ||
| github.event_name == 'issues' && | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fine, but one could also use a condition like |
||
| ( | ||
| github.event.action == 'opened' || | ||
| github.event.action == 'edited' || | ||
| github.event.action == 'reopened' || | ||
| (github.event.action == 'labeled' && github.event.label.name == 'focus-area-proposal') | ||
| ) | ||
| runs-on: ubuntu-latest | ||
| # Concurrency is used to ensure that only one job per issue runs at a time, with newer | ||
| # jobs canceling older ones. | ||
| concurrency: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How many jobs might this trigger if we close issues en masse or add a lot of labels? GitHub Actions should just queue everything to eventually run, but if we know it'll be hundreds of jobs at the same time, that seems like it might break?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is really here to avoid the case where the same issue is updated multiple times while a job for that issue is already running. With this concurrency block, the next jobs will be queued instead of running in parallel. If I'm editing the opening comment of an issue twice in less time than it takes the job to run, then I don't run the 2 jobs at the same time, potentially ending up with the wrong content if the second ran faster than the first. That said, I'm realizing that As for a batch editing of hundreds of issues, I'm not seeing an issue here. We'll let GitHub queue up all the jobs. |
||
| group: identify-web-features-issue-${{ github.event.issue.number }} | ||
| cancel-in-progress: true | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| cache: npm | ||
| cache-dependency-path: scripts/package-lock.json | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| working-directory: scripts | ||
| - name: Refresh issue | ||
| run: node identify-web-features.js --number ${{ github.event.issue.number }} --repo ${{ github.repository }} | ||
| working-directory: scripts | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| # The process-all-open-proposals job runs when the package.json file is changed, and updates all issues. | ||
| # This is used to refresh all open proposals when the web-features dependency is updated. | ||
| # The job can also be triggered manually. | ||
| process-all-open-proposals: | ||
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | ||
| runs-on: ubuntu-latest | ||
| # Concurrency is used to ensure that only one job per repository runs at a time, with newer | ||
| # jobs canceling older ones. | ||
| concurrency: | ||
| group: identify-web-features-all-open-proposals | ||
| cancel-in-progress: true | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v2 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| - name: Run identification script | ||
| run: | | ||
| cd scripts | ||
| npm install | ||
| node identify-web-features.js -n ${{ github.event.issue.number }} -r ${{ github.repository }} | ||
| cache: npm | ||
| cache-dependency-path: scripts/package-lock.json | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| working-directory: scripts | ||
| - name: Refresh all open proposals | ||
| run: node identify-web-features.js --all-open-proposals --repo ${{ github.repository }} | ||
| working-directory: scripts | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
Uh oh!
There was an error while loading. Please reload this page.