-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add developer metrics jobs to CircleCI configuration
- Loading branch information
1 parent
d9583c3
commit bc5b6cf
Showing
1 changed file
with
98 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
version: 2.1 | ||
orbs: | ||
node: circleci/[email protected] | ||
utils: ethereum-optimism/[email protected] | ||
|
||
executors: | ||
node20: | ||
|
@@ -69,7 +70,7 @@ jobs: | |
name: Lint Markdown files | ||
command: pnpm lint | ||
|
||
build-and-run-lychee: | ||
links: | ||
executor: rust | ||
steps: | ||
- checkout: | ||
|
@@ -104,6 +105,74 @@ jobs: | |
cd docs | ||
lychee --config ./lychee.toml --quiet "./pages" | ||
developer-issue-metrics: | ||
description: Monthly Issue Metrics Report | ||
executor: ubuntu | ||
parameters: | ||
repo: | ||
type: string | ||
default: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME | ||
steps: | ||
- utils/get-github-access-token: | ||
private-key-str: GITHUB_APP_KEY | ||
app-id: GITHUB_APP_ID | ||
repo: << parameters.repo >> | ||
- run: | ||
name: Get Dates for Last Month | ||
command: | | ||
# Calculate the first day of the previous month | ||
first_day=$(date -d "last month" +%Y-%m-01) | ||
# Calculate the last day of the previous month | ||
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d) | ||
# Export the last_month variable for subsequent steps | ||
echo "export LAST_MONTH=${first_day}..${last_day}" >> $BASH_ENV | ||
- utils/generate-issue-metrics-file: | ||
SEARCH_QUERY: 'repo:ethereum-optimism/docs is:issue closed:${LAST_MONTH} -reason:\"not planned\" -label:monthly-report' | ||
file-path: "./issue_metrics.md" | ||
- utils/create-github-issue-from-file: | ||
repo: << parameters.repo >> | ||
file-path: "./issue_metrics.md" | ||
issue-title: "${LAST_MONTH} metrics report for closed issues" | ||
issue-labels: "monthly-report" | ||
assignees: "sbvegan" | ||
|
||
developer-pr-metrics: | ||
description: Monthly PR Metrics Report | ||
executor: ubuntu | ||
parameters: | ||
repo: | ||
type: string | ||
default: $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME | ||
steps: | ||
- utils/get-github-access-token: | ||
private-key-str: GITHUB_APP_KEY | ||
app-id: GITHUB_APP_ID | ||
repo: << parameters.repo >> | ||
- run: | ||
name: Get Dates for Last Month | ||
command: | | ||
# Calculate the first day of the previous month | ||
first_day=$(date -d "last month" +%Y-%m-01) | ||
# Calculate the last day of the previous month | ||
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d) | ||
# Export the last_month variable for subsequent steps | ||
echo "export LAST_MONTH=${first_day}..${last_day}" >> $BASH_ENV | ||
- utils/generate-issue-metrics-file: | ||
SEARCH_QUERY: "repo:ethereum-optimism/docs is:pr created:${LAST_MONTH}" | ||
file-path: "./issue_metrics.md" | ||
- utils/create-github-issue-from-file: | ||
repo: << parameters.repo >> | ||
file-path: "./issue_metrics.md" | ||
issue-title: "${LAST_MONTH} metrics report for opened prs" | ||
issue-labels: "monthly-report" | ||
assignees: "sbvegan" | ||
|
||
workflows: | ||
merge-workflow: | ||
jobs: | ||
|
@@ -115,19 +184,31 @@ workflows: | |
only: main | ||
pr-workflow: | ||
jobs: | ||
# - breadcrumbs: | ||
# name: Breadcrumb Check | ||
# filters: | ||
# branches: | ||
# only: | ||
# - main | ||
# - /pull\/\d+/ | ||
# - build-and-run-lychee: | ||
# filters: | ||
# branches: | ||
# only: | ||
# - main | ||
# - /pull\/\d+/ | ||
- breadcrumbs | ||
- build-and-run-lychee | ||
- lint | ||
- breadcrumbs: | ||
name: Breadcrumb Check | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
- /pull\/\d+/ | ||
- links: | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
- /pull\/\d+/ | ||
- lint: | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
- /pull\/\d+/ | ||
|
||
developer-issue-metrics-workflow: | ||
when: | ||
equal: [build_monthly, <<pipeline.schedule.name>>] | ||
jobs: | ||
- developer-issue-metrics: | ||
context: circleci-repo-docs | ||
- developer-pr-metrics: | ||
context: circleci-repo-docs |