Skip to content

Commit

Permalink
Use new label format (ethereum#5536)
Browse files Browse the repository at this point in the history
* Revamp Labels

* Update Waiting for CI Labels

* Update Stale Labels
  • Loading branch information
Pandapip1 authored Aug 26, 2022
1 parent 6bcc0ac commit 4f26904
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 51 deletions.
51 changes: 13 additions & 38 deletions .github/workflows/post-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ name: Post CI
jobs:
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Fetch PR Data
uses: dawidd6/action-download-artifact@6765a42d86407a3d532749069ac03705ad82ebc6
Expand All @@ -30,49 +29,25 @@ jobs:
- name: Add Comment
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
with:
recreate: true
message: |
The commit ${{ steps.save-pr-data.outputs.pr_sha }} (as a parent of ${{ steps.save-pr-data.outputs.merge_sha }}) contains errors.
Please inspect the [Run Summary](https://github.com/ethereum/EIPs/pull/${{ steps.save-pr-data.outputs.pr_number }}/files) for details.
- name: Get Job Data
uses: fjogeleit/http-request-action@v1
id: fetch-jobs
- name: Add Waiting Label
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
with:
method: GET
url: ${{ github.event.workflow_run.jobs_url }}
bearerToken: ${{ secrets.GITHUB_TOKEN }}
labels: w-ci
number: ${{ steps.save-pr-data.outputs.pr_number }}'
repo: ${{ github.repository }}

- name: Process Labels # TODO: Turn this into a fully-featured github action
uses: actions/github-script@v6
- name: Remove Waiting Label
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
if: ${{ github.event.workflow_run.conclusion != 'failure' }}
with:
script: |
const labels = JSON.parse(process.env.LABELS);
const data = JSON.parse(process.env.JOB_DATA);
for (let job in labels) {
if (data.find(jobData => jobData.name == job)?.conclusion != "success") {
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: process.env.NUMBER,
labels: [ labels[job] ]
}).catch(() => {});
} else {
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: process.env.NUMBER,
name: labels[job]
}).catch(() => {});
}
}
env:
NUMBER: ${{ steps.save-pr-data.outputs.pr_number }}
JOB_DATA: ${{ toJson(fromJson(steps.fetch-jobs.outputs.response).jobs) }}
LABELS: |
{
"HTMLProofer": "waiting: htmlproofer to pass",
"CodeSpell": "waiting: codespell to pass",
"EIP Walidator": "waiting: walidator to pass"
}
labels: w-ci
number: ${{ steps.save-pr-data.outputs.pr_number }}
repo: ${{ github.repository }}
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
days-before-issue-stale: 7
days-before-issue-close: 49 # 49 + 7 weeks = 3 months
exempt-issue-labels: discussions-to
stale-issue-label: "waiting: no recent activity"
stale-issue-label: w-stale
# PR config
stale-pr-message: There has been no activity on this pull request for 2 weeks. It will be closed after 3 months of inactivity. If you would like to move this PR forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review.
close-pr-message: This pull request was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment.
days-before-pr-stale: 14
days-before-pr-close: 42 # 42 + 14 weeks = 3 months
stale-pr-label: "waiting: no recent activity"
stale-pr-label: w-stale
40 changes: 29 additions & 11 deletions config/.jekyll-labels.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
"type: Core": this?.new?.category == "Core"
"type: Networking": this?.new?.category == "Networking"
"type: Interface": this?.new?.category == "Interface"
"type: ERC": this?.new?.category == "ERC"
"type: Informational": this?.new?.type == "Informational"
"type: Meta": this?.new?.type == "Meta"
"type: EIP1 (Process)": this?.old?.status == "Living" || this?.old?.eip == "<to be assigned>"
"waiting: EIP number": isNaN(this?.new?.eip) && this?.new?.eip
"classification: new EIP": this?.new?.eip && !this?.old?.eip
"classification: update EIP": this?.new?.eip && this?.old?.eip && this?.new?.status == this?.old?.status
"classification: EIP status change": this?.new?.eip && this?.old?.eip && this?.new?.status != this?.old?.status
#### EIP Type / Category ####

# Type
t-informational: this?.new?.type == "Informational" && this?.old?.status != "Living"
t-meta: this?.new?.type == "Meta" && this?.old?.status != "Living"

# Categories
t-core": this?.new?.category == "Core" && this?.old?.status != "Living"
t-networking": this?.new?.category == "Networking" && this?.old?.status != "Living"
t-interface": this?.new?.category == "Interface" && this?.old?.status != "Living"
t-erc": this?.new?.category == "ERC" && this?.old?.status != "Living"

# Living EIPs & EIP Template
t-process": this?.old?.status == "Living" || this?.old?.title == "<The EIP title is a few words, not a complete sentence>"

#### PR Classification ####

c-new: this?.new?.eip && !this?.old?.eip
c-update: this?.new?.eip && this?.old?.eip && this?.new?.status == this?.old?.status
c-status: this?.new?.eip && this?.old?.eip && this?.new?.status != this?.old?.status

#### Waiting Labels ###

# Generic

# EIP Author

# EIP Editor
e-number: isNaN(this?.new?.eip) && this?.new?.eip

0 comments on commit 4f26904

Please sign in to comment.