From 5c230e37fdf14f78104a7483b32a709f7b527d8c Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 13:45:23 +0100 Subject: [PATCH 01/42] add CircleCI configuration for linting job --- .circleci/config.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..168faca9e --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,30 @@ +version: 2.1 + +jobs: + lint: + docker: + - image: cimg/node:23.4.0 + steps: + - checkout + - run: + name: Install pnpm + command: npm install -g pnpm + - run: + name: Install dependencies + command: pnpm install + # - run: + # name: Create and upload index + # command: pnpm index:docs + # environment: + # ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID + # ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY + # ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME + +workflows: + main: + jobs: + - lint: + context: algolia-search + filters: + branches: + only: main From 6e42d0d17991561f350db91f893cdaef334a1bc8 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 13:46:06 +0100 Subject: [PATCH 02/42] add lint job to CircleCI configuration --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 168faca9e..1ae53af94 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,3 +28,6 @@ workflows: filters: branches: only: main + test: + jobs: + - lint From 2e5a37508b22e78f04077a492b57860b0fa7ea55 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 13:47:00 +0100 Subject: [PATCH 03/42] rename lint job to publish-algolia-search in CircleCI configuration --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ae53af94..04f8e397d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 jobs: - lint: + publish-algolia-search: docker: - image: cimg/node:23.4.0 steps: @@ -23,11 +23,11 @@ jobs: workflows: main: jobs: - - lint: + - publish-algolia-search: context: algolia-search filters: branches: only: main test: jobs: - - lint + - publish-algolia-search From c56cb25d1c30c3e5474e6fbac18796c1e835c52b Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 14:47:22 +0100 Subject: [PATCH 04/42] update CircleCI configuration to use Ubuntu 22.04 and Node.js 16.13 for the publish-algolia-search job --- .circleci/config.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 04f8e397d..abc93b72b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,17 +1,22 @@ version: 2.1 +node: circleci/node@7.0.0 jobs: publish-algolia-search: docker: - - image: cimg/node:23.4.0 + - image: ubuntu-2204:current steps: - checkout - - run: - name: Install pnpm - command: npm install -g pnpm - - run: - name: Install dependencies - command: pnpm install + - node/install: + install-yarn: true + node-version: "16.13" + - run: node --version + # - run: + # name: Install pnpm + # command: npm install -g pnpm + # - run: + # name: Install dependencies + # command: pnpm install # - run: # name: Create and upload index # command: pnpm index:docs From f3e6fc4765f4e0f177b876636d2d73efe51e0c66 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 14:52:28 +0100 Subject: [PATCH 05/42] refactor CircleCI configuration to use machine executor and pnpm for package management in publish-algolia-search job --- .circleci/config.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index abc93b72b..a404d43e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,20 +3,15 @@ node: circleci/node@7.0.0 jobs: publish-algolia-search: - docker: - - image: ubuntu-2204:current + machine: + image: ubuntu-2204:current steps: - checkout - - node/install: - install-yarn: true - node-version: "16.13" - - run: node --version - # - run: - # name: Install pnpm - # command: npm install -g pnpm - # - run: - # name: Install dependencies - # command: pnpm install + - node/install-packages: + pkg-manager: pnpm + - run: + name: Install dependencies + command: pnpm install # - run: # name: Create and upload index # command: pnpm index:docs From b58f99011179a6036e0e69c0e67b92ddbd365b31 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 14:54:26 +0100 Subject: [PATCH 06/42] add Node.js orb to CircleCI configuration --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a404d43e3..f2c441c71 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,6 @@ version: 2.1 -node: circleci/node@7.0.0 +orbs: + node: circleci/node@7.0.0 jobs: publish-algolia-search: From 3b957e041285e68dceb76348fe6995a87f308d3b Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 14:58:28 +0100 Subject: [PATCH 07/42] update CircleCI configuration to install packages using npm and run tests --- .circleci/config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f2c441c71..445da86c8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,11 +8,9 @@ jobs: image: ubuntu-2204:current steps: - checkout - - node/install-packages: - pkg-manager: pnpm + - node/install-packages - run: - name: Install dependencies - command: pnpm install + command: npm run test # - run: # name: Create and upload index # command: pnpm index:docs From bdd0bec160e2787bf2ddf700d61a07c0b3525580 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:04:18 +0100 Subject: [PATCH 08/42] update CircleCI configuration to use pnpm for package management in the job steps --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 445da86c8..97084cc70 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,9 +8,8 @@ jobs: image: ubuntu-2204:current steps: - checkout - - node/install-packages - - run: - command: npm run test + - node/install-packages: + pkg-manager: pnpm # - run: # name: Create and upload index # command: pnpm index:docs From 8521612b177adeaab6a9360ad039a356a8f3baee Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:09:20 +0100 Subject: [PATCH 09/42] update CircleCI configuration to install Node.js 20.x and pnpm, and manage dependencies with pnpm caching --- .circleci/config.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 97084cc70..55ece9757 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,8 +8,24 @@ jobs: image: ubuntu-2204:current steps: - checkout - - node/install-packages: - pkg-manager: pnpm + - run: + name: Install Node.js (20.x) and pnpm + command: | + curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - + sudo apt-get install -y nodejs + npm install -g pnpm + pnpm --version + - restore_cache: + keys: + - v1-pnpm-cache-{{ checksum "pnpm-lock.yaml" }} + - run: + name: Install dependencies + command: npm install -g pnpm && pnpm install + - save_cache: + key: v1-pnpm-cache-{{ checksum "pnpm-lock.yaml" }} + paths: + - ~/.pnpm-store + # - run: # name: Create and upload index # command: pnpm index:docs From 14ed9fbb31c8b32cb8b933f688c48cc3b99f51b6 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:12:39 +0100 Subject: [PATCH 10/42] refactor CircleCI configuration to use a dedicated Node.js 20.x executor and streamline job steps --- .circleci/config.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55ece9757..a69240f36 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,19 +2,20 @@ version: 2.1 orbs: node: circleci/node@7.0.0 -jobs: - publish-algolia-search: +executors: + node20: + docker: + - image: cimg/node:20.11.1 # Prebuilt CircleCI image for Node.js 20.x + resource_class: medium # Adjust resource allocation as needed + ubuntu: machine: image: ubuntu-2204:current + +jobs: + publish-algolia-search: + executor: node20 steps: - checkout - - run: - name: Install Node.js (20.x) and pnpm - command: | - curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - - sudo apt-get install -y nodejs - npm install -g pnpm - pnpm --version - restore_cache: keys: - v1-pnpm-cache-{{ checksum "pnpm-lock.yaml" }} From eed1de7a00ed91cd347bd779b2c631fbbaf2f9d5 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:15:15 +0100 Subject: [PATCH 11/42] simplify dependency installation in CircleCI configuration by removing npm command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a69240f36..10cd4490d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,7 @@ jobs: - v1-pnpm-cache-{{ checksum "pnpm-lock.yaml" }} - run: name: Install dependencies - command: npm install -g pnpm && pnpm install + command: pnpm install - save_cache: key: v1-pnpm-cache-{{ checksum "pnpm-lock.yaml" }} paths: From b84d490a29b81bbd567a2ff19f2083a5020c7fb9 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:16:47 +0100 Subject: [PATCH 12/42] enable index documentation creation and upload in CircleCI configuration --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 10cd4490d..f2dfd0050 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,9 +27,9 @@ jobs: paths: - ~/.pnpm-store - # - run: - # name: Create and upload index - # command: pnpm index:docs + - run: + name: Create and upload index + command: pnpm index:docs # environment: # ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID # ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY From d1e09ab39db8996ee0c6f3d84ba60824b9ffa4b6 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:18:23 +0100 Subject: [PATCH 13/42] update CircleCI configuration to use Ubuntu executor and install Node.js 20.x with pnpm --- .circleci/config.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f2dfd0050..266628aaa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,15 +13,22 @@ executors: jobs: publish-algolia-search: - executor: node20 + executor: ubuntu steps: - checkout + - run: + name: Install Node.js (20.x) and pnpm + command: | + curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - + sudo apt-get install -y nodejs + npm install -g pnpm + pnpm --version - restore_cache: keys: - v1-pnpm-cache-{{ checksum "pnpm-lock.yaml" }} - run: name: Install dependencies - command: pnpm install + command: npm install -g pnpm && pnpm install - save_cache: key: v1-pnpm-cache-{{ checksum "pnpm-lock.yaml" }} paths: From cb3cbe2e3b7a5dc27bda34cc99b156068f3e263d Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:21:06 +0100 Subject: [PATCH 14/42] remove commented-out environment variables from CircleCI configuration --- .circleci/config.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 266628aaa..33bafa6f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,10 +37,10 @@ jobs: - run: name: Create and upload index command: pnpm index:docs - # environment: - # ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID - # ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY - # ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME + # environment: + # ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID + # ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY + # ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME workflows: main: @@ -50,6 +50,3 @@ workflows: filters: branches: only: main - test: - jobs: - - publish-algolia-search From d7d7e7acd4d36fa85c747597f040912e85542207 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:21:45 +0100 Subject: [PATCH 15/42] restore environment variables for index documentation creation in CircleCI configuration --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 33bafa6f3..90726abce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,10 +37,10 @@ jobs: - run: name: Create and upload index command: pnpm index:docs - # environment: - # ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID - # ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY - # ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME + environment: + ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID + ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY + ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME workflows: main: From d3dc09c78f070189ccce383dcbdf9d55b407b7bd Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:25:03 +0100 Subject: [PATCH 16/42] refactor CircleCI configuration to create and upload Algolia search index in separate command --- .circleci/config.yml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 90726abce..45fad8338 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,11 +11,18 @@ executors: machine: image: ubuntu-2204:current -jobs: - publish-algolia-search: - executor: ubuntu +commands: + publish-algolia-search-index: + steps: + - run: + name: Create index + command: pnpm run index:docs + environment: + ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID + ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY + ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME + setup-node: steps: - - checkout - run: name: Install Node.js (20.x) and pnpm command: | @@ -34,13 +41,13 @@ jobs: paths: - ~/.pnpm-store - - run: - name: Create and upload index - command: pnpm index:docs - environment: - ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID - ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY - ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME +jobs: + publish-algolia-search: + executor: ubuntu + steps: + - checkout + - setup-node + - publish-algolia-search-index workflows: main: From 451550a70a1a4fd46b989a974d34b5be2373fb65 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:31:53 +0100 Subject: [PATCH 17/42] refactor CircleCI configuration to add breadcrumbs job and update Algolia index job --- .circleci/config.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 45fad8338..ae30aa1e2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,18 +42,36 @@ commands: - ~/.pnpm-store jobs: - publish-algolia-search: + algolia: + description: Create and upload Algolia search index executor: ubuntu steps: - checkout - setup-node - publish-algolia-search-index + breadcrumbs: + description: Check breadcrumbs in documentation + executor: ubuntu + steps: + - checkout + - setup-node + - run: + name: Run breadcrumb check + command: pnpm check-breadcrumbs workflows: main: jobs: - - publish-algolia-search: + - algolia: + name: Algolia Index Update context: algolia-search filters: branches: only: main + - breadcrumbs: + name: Breadcrumb Check + # filters: + # branches: + # only: + # - main + # - /pull\/\d+/ From 73390e6b6af7c4d3f12b77235da447689f9ac027 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:35:40 +0100 Subject: [PATCH 18/42] update CircleCI configuration to enable filters for breadcrumbs job on specific branches --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ae30aa1e2..5197c9dc3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,8 +70,8 @@ workflows: only: main - breadcrumbs: name: Breadcrumb Check - # filters: - # branches: - # only: - # - main - # - /pull\/\d+/ + filters: + branches: + only: + - main + - /pull\/\d+/ From 48b0b605dfc11c07da075e8b08ffde0f786143d4 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:36:22 +0100 Subject: [PATCH 19/42] refactor CircleCI configuration to inline Algolia index creation command --- .circleci/config.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5197c9dc3..b60956cbf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,15 +12,6 @@ executors: image: ubuntu-2204:current commands: - publish-algolia-search-index: - steps: - - run: - name: Create index - command: pnpm run index:docs - environment: - ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID - ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY - ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME setup-node: steps: - run: @@ -48,7 +39,13 @@ jobs: steps: - checkout - setup-node - - publish-algolia-search-index + - run: + name: Create index + command: pnpm run index:docs + environment: + ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID + ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY + ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME breadcrumbs: description: Check breadcrumbs in documentation executor: ubuntu From e07f703f8a9e8474a198b804ac58c8142a4e1f9a Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 15:45:46 +0100 Subject: [PATCH 20/42] add CircleCI job to build and run Lychee link checker --- .circleci/config.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b60956cbf..63214fd7f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,10 @@ executors: ubuntu: machine: image: ubuntu-2204:current + rust: + docker: + - image: cimg/rust:1.75.0 # CircleCI's Rust Docker image + working_directory: ~/project commands: setup-node: @@ -55,6 +59,43 @@ jobs: - run: name: Run breadcrumb check command: pnpm check-breadcrumbs + build-and-run-lychee: + executor: rust + steps: + - checkout: + path: docs + - run: + name: Checkout lycheeverse/lychee + command: | + git clone https://github.com/lycheeverse/lychee.git lychee + + - restore_cache: + keys: + - v1-rust-cache-{{ checksum "lychee/Cargo.lock" }} + - v1-rust-cache- + + - run: + name: Build Lychee + command: | + cd lychee + cargo build --release + + - save_cache: + key: v1-rust-cache-{{ checksum "lychee/Cargo.lock" }} + paths: + - ~/.cargo/registry + - ~/.cargo/git + - lychee/target + + - run: + name: Add Lychee to PATH + command: echo "$HOME/project/lychee/target/release" >> $BASH_ENV + + - run: + name: Run Lychee link checker + command: | + cd docs + lychee --config ./lychee.toml --quiet "./pages" workflows: main: @@ -72,3 +113,10 @@ workflows: only: - main - /pull\/\d+/ + - build-and-run-lychee + # - build-and-run-lychee: + # filters: + # branches: + # only: + # - main + # - /pull\/.*/ # Include pull requests From c45b557c98a09ba2a3ce3785303425c23a82fa45 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 16:00:51 +0100 Subject: [PATCH 21/42] refactor CircleCI configuration to set Lychee path in the run command --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 63214fd7f..047939b28 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,13 +87,10 @@ jobs: - ~/.cargo/git - lychee/target - - run: - name: Add Lychee to PATH - command: echo "$HOME/project/lychee/target/release" >> $BASH_ENV - - run: name: Run Lychee link checker command: | + export PATH=$PATH:$HOME/project/lychee/target/release cd docs lychee --config ./lychee.toml --quiet "./pages" From 01d53bb6c3d72dcaad558dfe654ce700646a9688 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 16:08:03 +0100 Subject: [PATCH 22/42] refactor CircleCI configuration to create separate workflows for Algolia, breadcrumbs, and Lychee jobs --- .circleci/config.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 047939b28..7315fe23b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,7 +95,7 @@ jobs: lychee --config ./lychee.toml --quiet "./pages" workflows: - main: + algolia-workflow: jobs: - algolia: name: Algolia Index Update @@ -103,6 +103,8 @@ workflows: filters: branches: only: main + breadcrumbs-workflow: + jobs: - breadcrumbs: name: Breadcrumb Check filters: @@ -110,10 +112,11 @@ workflows: only: - main - /pull\/\d+/ - - build-and-run-lychee - # - build-and-run-lychee: - # filters: - # branches: - # only: - # - main - # - /pull\/.*/ # Include pull requests + lychee-workflow: + jobs: + - build-and-run-lychee: + filters: + branches: + only: + - main + - /pull\/.*/ # Include pull requests From 801f058014f7b49a0b9ab743826814aadc238480 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 16:14:49 +0100 Subject: [PATCH 23/42] refactor CircleCI configuration to rename workflows for clarity --- .circleci/config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7315fe23b..ab65e1fd5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,7 +95,7 @@ jobs: lychee --config ./lychee.toml --quiet "./pages" workflows: - algolia-workflow: + merge-workflow: jobs: - algolia: name: Algolia Index Update @@ -103,7 +103,7 @@ workflows: filters: branches: only: main - breadcrumbs-workflow: + pr-workflow: jobs: - breadcrumbs: name: Breadcrumb Check @@ -112,8 +112,6 @@ workflows: only: - main - /pull\/\d+/ - lychee-workflow: - jobs: - build-and-run-lychee: filters: branches: From da804b7cb8b5bf1447d1c73974cd370c37edf010 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 16:17:48 +0100 Subject: [PATCH 24/42] refactor CircleCI configuration to simplify workflow job definitions --- .circleci/config.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ab65e1fd5..470ed3d51 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,16 +105,18 @@ 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\/.*/ # Include pull requests + # - 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 From 0f74e6f4bfe09edf828494adf488316b66c26dea Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 16:23:17 +0100 Subject: [PATCH 25/42] add CircleCI job to lint Markdown files --- .circleci/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 470ed3d51..fa33d58b4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,6 +59,15 @@ jobs: - run: name: Run breadcrumb check command: pnpm check-breadcrumbs + lint: + description: Lint Markdown files + executor: ubuntu + steps: + - checkout + - run: + name: Lint Markdown files + command: pnpm lint + build-and-run-lychee: executor: rust steps: @@ -120,3 +129,4 @@ workflows: # - /pull\/\d+/ - breadcrumbs - build-and-run-lychee + - lint From d9583c3803697566d4e9721a8e031866e505d51c Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 16:24:22 +0100 Subject: [PATCH 26/42] add setup-node step to CircleCI job for linting Markdown files --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa33d58b4..4793035b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,6 +64,7 @@ jobs: executor: ubuntu steps: - checkout + - setup-node - run: name: Lint Markdown files command: pnpm lint From bc5b6cfbd94838ec849254ee0b25cb1947fe4642 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Thu, 19 Dec 2024 19:55:56 +0100 Subject: [PATCH 27/42] add developer metrics jobs to CircleCI configuration --- .circleci/config.yml | 115 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 98 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4793035b1..7c991259f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,7 @@ version: 2.1 orbs: node: circleci/node@7.0.0 + utils: ethereum-optimism/circleci-utils@0.0.6 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, <>] + jobs: + - developer-issue-metrics: + context: circleci-repo-docs + - developer-pr-metrics: + context: circleci-repo-docs From 4b05cf54a4a577714876a4391d377fec1e2510d5 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 10:13:59 +0100 Subject: [PATCH 28/42] add Slack notifications for job failures and new tutorial workflows in CircleCI configuration --- .circleci/config.yml | 87 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c991259f..32f6c2cfa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,6 +2,7 @@ version: 2.1 orbs: node: circleci/node@7.0.0 utils: ethereum-optimism/circleci-utils@0.0.6 + slack: circleci/slack@4.12.5 executors: node20: @@ -17,6 +18,39 @@ executors: working_directory: ~/project commands: + notify_slack_on_failure: + steps: + - slack/notify: + event: fail + channel: ${SLACK_DEFAULT_CHANNEL} + template: BASIC_FAIL_1 + custom: | + { + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": "❌ Job Failed: ${CIRCLE_JOB}", + "emoji": true + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Workflow:* ${CIRCLE_WORKFLOW_ID}\n*Job:* ${CIRCLE_JOB}\n*Branch:* ${CIRCLE_BRANCH}" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "<${CIRCLE_BUILD_URL}|View Job Details>" + } + } + ] + } setup-node: steps: - run: @@ -173,6 +207,42 @@ jobs: issue-labels: "monthly-report" assignees: "sbvegan" + cross-dom-bridge-eth: + executor: ubuntu + steps: + - checkout + - setup-node + - run: + name: Run tutorial + command: node ./public/tutorials/cross-dom-bridge-eth.js + environment: + TUTORIAL_PRIVATE_KEY: ${TUTORIAL_PRIVATE_KEY} + - notify_slack_on_failure + + send-tx-from-eth: + executor: ubuntu + steps: + - checkout + - setup-node + - run: + name: Run tutorial + command: node ./public/tutorials/send-tx-from-eth.js + environment: + TUTORIAL_PRIVATE_KEY: ${TUTORIAL_PRIVATE_KEY} + - notify_slack_on_failure + + sdk-estimate-costs: + executor: ubuntu + steps: + - checkout + - setup-node + - run: + name: Run tutorial + command: node ./public/tutorials/sdk-estimate-costs.js + environment: + TUTORIAL_PRIVATE_KEY: ${TUTORIAL_PRIVATE_KEY} + - notify_slack_on_failure + workflows: merge-workflow: jobs: @@ -204,7 +274,7 @@ workflows: - main - /pull\/\d+/ - developer-issue-metrics-workflow: + monthly-workflow: when: equal: [build_monthly, <>] jobs: @@ -212,3 +282,18 @@ workflows: context: circleci-repo-docs - developer-pr-metrics: context: circleci-repo-docs + + nightly-workflow: + when: + equal: [build_nightly, <>] + jobs: + - cross-dom-bridge-eth: + context: [tutorial-keys, slack] + - send-tx-from-eth: + context: [tutorial-keys, slack] + requires: + - cross-dom-bridge-eth + - sdk-estimate-costs: + context: [tutorial-keys, slack] + requires: + - send-tx-from-eth From 5a77383e5ed274a1f961e88e412d2ecaa6cd2aed Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 16:48:11 +0100 Subject: [PATCH 29/42] remove commented-out Algolia job configuration from CircleCI --- .circleci/config.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 32f6c2cfa..d93ab5021 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -247,11 +247,14 @@ workflows: merge-workflow: jobs: - algolia: - name: Algolia Index Update context: algolia-search - filters: - branches: - only: main + + # - algolia: + # name: Algolia Index Update + # context: algolia-search + # filters: + # branches: + # only: main pr-workflow: jobs: - breadcrumbs: From 5695cbfbd31fa3ffa27fd322148394fd9e41758c Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 17:32:57 +0100 Subject: [PATCH 30/42] update job name to reflect index creation and upload in CircleCI configuration --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d93ab5021..eb49d4672 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,7 +79,7 @@ jobs: - checkout - setup-node - run: - name: Create index + name: Create and upload index command: pnpm run index:docs environment: ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID From 671985aff0f919bf43271c8a5f16a96386fe4ce7 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 17:39:51 +0100 Subject: [PATCH 31/42] refactor CircleCI configuration to use environment variable names directly for Algolia settings --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eb49d4672..57f427994 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,9 +82,9 @@ jobs: name: Create and upload index command: pnpm run index:docs environment: - ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID - ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY - ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME + ALGOLIA_APPLICATION_ID: ALGOLIA_APPLICATION_ID + ALGOLIA_WRITE_API_KEY: ALGOLIA_WRITE_API_KEY + ALGOLIA_INDEX_NAME: ALGOLIA_INDEX_NAME breadcrumbs: description: Check breadcrumbs in documentation executor: ubuntu From 48726a733b59109806e9d800fd219d7a9ffcd60f Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 18:09:29 +0100 Subject: [PATCH 32/42] add debug step to CircleCI configuration and use environment variables for Algolia settings --- .circleci/config.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 57f427994..f80ac35eb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,13 +78,18 @@ jobs: steps: - checkout - setup-node + - run: + name: Debug + command: | + echo $ALGOLIA_INDEX_NAME + echo $ALGOLIA_INDEX_NAME | base64 - run: name: Create and upload index command: pnpm run index:docs environment: - ALGOLIA_APPLICATION_ID: ALGOLIA_APPLICATION_ID - ALGOLIA_WRITE_API_KEY: ALGOLIA_WRITE_API_KEY - ALGOLIA_INDEX_NAME: ALGOLIA_INDEX_NAME + ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID + ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY + ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME breadcrumbs: description: Check breadcrumbs in documentation executor: ubuntu From 348b513d0cacdae68da358e89a0089ee3d0b7ab0 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 18:13:55 +0100 Subject: [PATCH 33/42] add environment variable for ALGOLIA_INDEX_NAME in CircleCI job --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f80ac35eb..657e2f4c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,9 +83,12 @@ jobs: command: | echo $ALGOLIA_INDEX_NAME echo $ALGOLIA_INDEX_NAME | base64 + environment: + ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME - run: name: Create and upload index - command: pnpm run index:docs + command: | + pnpm run index:docs environment: ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY From 0881cee0aaa31cf7dc615f99b77d64595dff48c1 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 18:16:57 +0100 Subject: [PATCH 34/42] remove debug step and unnecessary environment variables from CircleCI configuration --- .circleci/config.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 657e2f4c9..6b1b3060e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,21 +78,15 @@ jobs: steps: - checkout - setup-node - - run: - name: Debug - command: | - echo $ALGOLIA_INDEX_NAME - echo $ALGOLIA_INDEX_NAME | base64 - environment: - ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME - run: name: Create and upload index command: | + # index:docs requires the following environment variables, coming from the algolia-search context + # ALGOLIA_APPLICATION_ID + # ALGOLIA_WRITE_API_KEY + # ALGOLIA_INDEX_NAME pnpm run index:docs - environment: - ALGOLIA_APPLICATION_ID: $ALGOLIA_APPLICATION_ID - ALGOLIA_WRITE_API_KEY: $ALGOLIA_WRITE_API_KEY - ALGOLIA_INDEX_NAME: $ALGOLIA_INDEX_NAME + breadcrumbs: description: Check breadcrumbs in documentation executor: ubuntu From d84ca0a0fbd92fab108d9b22861a7a79320a8160 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 18:27:21 +0100 Subject: [PATCH 35/42] update job name for Algolia index update in CircleCI configuration --- .circleci/config.yml | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b1b3060e..bdc7db39b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -249,36 +249,16 @@ workflows: merge-workflow: jobs: - algolia: + name: Algolia Index Update context: algolia-search - - # - algolia: - # name: Algolia Index Update - # context: algolia-search - # filters: - # branches: - # only: main - pr-workflow: - jobs: - - breadcrumbs: - name: Breadcrumb Check - filters: - branches: - only: - - main - - /pull\/\d+/ - - links: filters: branches: - only: - - main - - /pull\/\d+/ - - lint: - filters: - branches: - only: - - main - - /pull\/\d+/ - + only: main + pr-workflow: + jobs: + - breadcrumbs + - links + - lint monthly-workflow: when: equal: [build_monthly, <>] From 18f8209dfab1edec6e1849ed660b27ef30f67fcf Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 18:51:13 +0100 Subject: [PATCH 36/42] remove unused GitHub workflows for Algolia index update, breadcrumbs, links, and linting --- .circleci/config.yml | 4 +-- .github/workflows/algolia.yml | 31 -------------------- .github/workflows/breadcrumbs.yml | 32 --------------------- .github/workflows/links.yml | 48 ------------------------------- .github/workflows/lint.yml | 29 ------------------- 5 files changed, 2 insertions(+), 142 deletions(-) delete mode 100644 .github/workflows/algolia.yml delete mode 100644 .github/workflows/breadcrumbs.yml delete mode 100644 .github/workflows/links.yml delete mode 100644 .github/workflows/lint.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index bdc7db39b..d42113687 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -260,8 +260,8 @@ workflows: - links - lint monthly-workflow: - when: - equal: [build_monthly, <>] + # when: + # equal: [build_monthly, <>] jobs: - developer-issue-metrics: context: circleci-repo-docs diff --git a/.github/workflows/algolia.yml b/.github/workflows/algolia.yml deleted file mode 100644 index 252b78306..000000000 --- a/.github/workflows/algolia.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Algolia Index Update - -on: - push: - branches: [main] - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: "20.x" - - - name: Install pnpm - run: npm install -g pnpm - - - name: Install dependencies - run: pnpm install - - - name: Create and upload index - env: - ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APPLICATION_ID }} - ALGOLIA_WRITE_API_KEY: ${{ secrets.ALGOLIA_WRITE_API_KEY }} - ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }} - run: pnpm index:docs diff --git a/.github/workflows/breadcrumbs.yml b/.github/workflows/breadcrumbs.yml deleted file mode 100644 index a077cf137..000000000 --- a/.github/workflows/breadcrumbs.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Check Breadcrumbs - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - paths: - - 'pages/**/*.mdx' - - 'pages/**/*.md' - -jobs: - check-breadcrumbs: - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20.x' - - - name: Install pnpm - run: npm install -g pnpm - - - name: Install dependencies - run: pnpm install - - - name: Run breadcrumb check - run: pnpm check-breadcrumbs \ No newline at end of file diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml deleted file mode 100644 index 4461adada..000000000 --- a/.github/workflows/links.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Check Links - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build-and-run-lychee: - runs-on: ubuntu-latest - - steps: - - name: Checkout ethereum-optimism/docs - uses: actions/checkout@v2 - with: - repository: 'ethereum-optimism/docs' - path: 'docs' - - - name: Checkout lycheeverse/lychee - uses: actions/checkout@v2 - with: - repository: 'lycheeverse/lychee' - path: 'lychee' - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - - name: Cache Rust dependencies - uses: Swatinem/rust-cache@v2 - with: - save-if: ${{ github.ref == 'refs/heads/main' }} - - - name: Build Lychee - run: | - cd lychee - cargo build --release - - - name: Add Lychee to PATH - run: echo "$GITHUB_WORKSPACE/lychee/target/release" >> $GITHUB_PATH - - - name: Run Lychee - run: | - cd docs - lychee --config ./lychee.toml --quiet "./pages" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index f25f60081..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Lint Markdown - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20.x' - - - name: Install pnpm - run: npm install -g pnpm - - - name: Install dependencies - run: pnpm install - - - name: Run lint - run: pnpm lint From 5e0852de993750666d107923e50ea899d8e4302b Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 18:54:44 +0100 Subject: [PATCH 37/42] rename developer-issue-metrics job to developer-metrics and remove developer-pr-metrics job from CircleCI configuration --- .circleci/config.yml | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d42113687..c9b4ab716 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -141,8 +141,8 @@ jobs: cd docs lychee --config ./lychee.toml --quiet "./pages" - developer-issue-metrics: - description: Monthly Issue Metrics Report + developer-metrics: + description: Monthly Metrics Report executor: ubuntu parameters: repo: @@ -174,31 +174,6 @@ jobs: 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" @@ -263,9 +238,7 @@ workflows: # when: # equal: [build_monthly, <>] jobs: - - developer-issue-metrics: - context: circleci-repo-docs - - developer-pr-metrics: + - developer-metrics: context: circleci-repo-docs nightly-workflow: From fc63b705fc67f98476643cd47f16fc215e724912 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 19:01:41 +0100 Subject: [PATCH 38/42] rename developer-metrics job to developer-issue-metrics and add developer-pr-metrics job in CircleCI configuration --- .circleci/config.yml | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c9b4ab716..34f2a5cf1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: node: circleci/node@7.0.0 - utils: ethereum-optimism/circleci-utils@0.0.6 + utils: ethereum-optimism/circleci-utils@dev:first slack: circleci/slack@4.12.5 executors: @@ -141,8 +141,8 @@ jobs: cd docs lychee --config ./lychee.toml --quiet "./pages" - developer-metrics: - description: Monthly Metrics Report + developer-issue-metrics: + description: Monthly Issue Metrics Report executor: ubuntu parameters: repo: @@ -184,6 +184,40 @@ jobs: 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" + cross-dom-bridge-eth: executor: ubuntu steps: @@ -238,7 +272,9 @@ workflows: # when: # equal: [build_monthly, <>] jobs: - - developer-metrics: + - developer-issue-metrics: + context: circleci-repo-docs + - developer-pr-metrics: context: circleci-repo-docs nightly-workflow: From 214be7510b82ab756ced421548564240ae6fec7c Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 19:04:58 +0100 Subject: [PATCH 39/42] rename developer-issue-metrics job to developer-metrics and remove developer-pr-metrics job from CircleCI configuration --- .circleci/config.yml | 43 +++---------------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34f2a5cf1..bb1e3ec8c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -141,8 +141,8 @@ jobs: cd docs lychee --config ./lychee.toml --quiet "./pages" - developer-issue-metrics: - description: Monthly Issue Metrics Report + developer-metrics: + description: Monthly Metrics Report executor: ubuntu parameters: repo: @@ -184,40 +184,6 @@ jobs: 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" - cross-dom-bridge-eth: executor: ubuntu steps: @@ -272,11 +238,8 @@ workflows: # when: # equal: [build_monthly, <>] jobs: - - developer-issue-metrics: + - developer-metrics: context: circleci-repo-docs - - developer-pr-metrics: - context: circleci-repo-docs - nightly-workflow: when: equal: [build_nightly, <>] From 61961edc7071b2fba32693914450df57352abaff Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 19:09:25 +0100 Subject: [PATCH 40/42] update file paths for issue and PR metrics in CircleCI configuration --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bb1e3ec8c..35fc5e78b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -167,19 +167,19 @@ jobs: 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" + file-path: "./closed_issue_metrics.md" - utils/create-github-issue-from-file: repo: << parameters.repo >> - file-path: "./issue_metrics.md" + file-path: "./closed_issue_metrics.md" issue-title: "${LAST_MONTH} metrics report for closed issues" issue-labels: "monthly-report" assignees: "sbvegan" - utils/generate-issue-metrics-file: SEARCH_QUERY: "repo:ethereum-optimism/docs is:pr created:${LAST_MONTH}" - file-path: "./issue_metrics.md" + file-path: "./pr_issue_metrics.md" - utils/create-github-issue-from-file: repo: << parameters.repo >> - file-path: "./issue_metrics.md" + file-path: "./pr_issue_metrics.md" issue-title: "${LAST_MONTH} metrics report for opened prs" issue-labels: "monthly-report" assignees: "sbvegan" From cf471eff5ed23c9211d10467432ef79e83ac9e2e Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 19:15:33 +0100 Subject: [PATCH 41/42] update CircleCI utils orb version to 0.0.7 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 35fc5e78b..da5ca05bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: node: circleci/node@7.0.0 - utils: ethereum-optimism/circleci-utils@dev:first + utils: ethereum-optimism/circleci-utils@0.0.7 slack: circleci/slack@4.12.5 executors: From 70740176ce616a8b40ac558e512973bd77be56f1 Mon Sep 17 00:00:00 2001 From: raffaele-oplabs Date: Fri, 20 Dec 2024 22:52:54 +0100 Subject: [PATCH 42/42] refactor CircleCI configuration: remove unused jobs and notifications, update workflows --- .circleci/config.yml | 89 +------------- .github/workflows/monthly-issue-metircs.yml | 60 ---------- .github/workflows/monthly-pr-metrics.yml | 60 ---------- .github/workflows/tutorials.yml | 124 -------------------- 4 files changed, 2 insertions(+), 331 deletions(-) delete mode 100644 .github/workflows/monthly-issue-metircs.yml delete mode 100644 .github/workflows/monthly-pr-metrics.yml delete mode 100644 .github/workflows/tutorials.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index da5ca05bf..a2187600b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,6 @@ version: 2.1 orbs: - node: circleci/node@7.0.0 utils: ethereum-optimism/circleci-utils@0.0.7 - slack: circleci/slack@4.12.5 executors: node20: @@ -18,39 +16,6 @@ executors: working_directory: ~/project commands: - notify_slack_on_failure: - steps: - - slack/notify: - event: fail - channel: ${SLACK_DEFAULT_CHANNEL} - template: BASIC_FAIL_1 - custom: | - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": "❌ Job Failed: ${CIRCLE_JOB}", - "emoji": true - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*Workflow:* ${CIRCLE_WORKFLOW_ID}\n*Job:* ${CIRCLE_JOB}\n*Branch:* ${CIRCLE_BRANCH}" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "<${CIRCLE_BUILD_URL}|View Job Details>" - } - } - ] - } setup-node: steps: - run: @@ -184,42 +149,6 @@ jobs: issue-labels: "monthly-report" assignees: "sbvegan" - cross-dom-bridge-eth: - executor: ubuntu - steps: - - checkout - - setup-node - - run: - name: Run tutorial - command: node ./public/tutorials/cross-dom-bridge-eth.js - environment: - TUTORIAL_PRIVATE_KEY: ${TUTORIAL_PRIVATE_KEY} - - notify_slack_on_failure - - send-tx-from-eth: - executor: ubuntu - steps: - - checkout - - setup-node - - run: - name: Run tutorial - command: node ./public/tutorials/send-tx-from-eth.js - environment: - TUTORIAL_PRIVATE_KEY: ${TUTORIAL_PRIVATE_KEY} - - notify_slack_on_failure - - sdk-estimate-costs: - executor: ubuntu - steps: - - checkout - - setup-node - - run: - name: Run tutorial - command: node ./public/tutorials/sdk-estimate-costs.js - environment: - TUTORIAL_PRIVATE_KEY: ${TUTORIAL_PRIVATE_KEY} - - notify_slack_on_failure - workflows: merge-workflow: jobs: @@ -235,22 +164,8 @@ workflows: - links - lint monthly-workflow: - # when: - # equal: [build_monthly, <>] + when: + equal: [build_monthly, <>] jobs: - developer-metrics: context: circleci-repo-docs - nightly-workflow: - when: - equal: [build_nightly, <>] - jobs: - - cross-dom-bridge-eth: - context: [tutorial-keys, slack] - - send-tx-from-eth: - context: [tutorial-keys, slack] - requires: - - cross-dom-bridge-eth - - sdk-estimate-costs: - context: [tutorial-keys, slack] - requires: - - send-tx-from-eth diff --git a/.github/workflows/monthly-issue-metircs.yml b/.github/workflows/monthly-issue-metircs.yml deleted file mode 100644 index 97b6ed183..000000000 --- a/.github/workflows/monthly-issue-metircs.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Monthly Issue Metrics Report -on: - workflow_dispatch: - schedule: - - cron: '0 0 1 * *' - -permissions: - issues: write - pull-requests: read - -jobs: - build: - name: docs issue metrics - runs-on: ubuntu-latest - - steps: - - - name: Get dates for last month - shell: bash - run: | - # 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) - - #Set an environment variable with the date range - echo "$first_day..$last_day" - echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV" - - - name: Run issue-metrics tool for issues last month - uses: github/issue-metrics@v2 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SEARCH_QUERY: 'repo:ethereum-optimism/docs is:issue created:${{ env.last_month }} -reason:"not planned" -label:monthly-report' - - - name: Create issue for opened issues - uses: peter-evans/create-issue-from-file@v4 - with: - title: ${{ env.last_month }} metrics report for opened issues - token: ${{ secrets.GITHUB_TOKEN }} - content-filepath: ./issue_metrics.md - assignees: sbvegan - labels: | - monthly-report - - - name: Run issue-metrics tool for issues last month - uses: github/issue-metrics@v2 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SEARCH_QUERY: 'repo:ethereum-optimism/docs is:issue closed:${{ env.last_month }} -reason:"not planned" -label:monthly-report' - - - name: Create issue for closed issues - uses: peter-evans/create-issue-from-file@v4 - with: - title: ${{ env.last_month }} metrics report for closed issues - content-filepath: ./issue_metrics.md - assignees: sbvegan - labels: | - monthly-report diff --git a/.github/workflows/monthly-pr-metrics.yml b/.github/workflows/monthly-pr-metrics.yml deleted file mode 100644 index efeb11c95..000000000 --- a/.github/workflows/monthly-pr-metrics.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Monthly PR Metrics Report -on: - workflow_dispatch: - schedule: - - cron: '0 0 1 * *' - -permissions: - issues: write - pull-requests: read - -jobs: - build: - name: developer pr metrics - runs-on: ubuntu-latest - - steps: - - - name: Get dates for last month - shell: bash - run: | - # 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) - - #Set an environment variable with the date range - echo "$first_day..$last_day" - echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV" - - - name: Run issue-metrics tool for prs last month - uses: github/issue-metrics@v2 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SEARCH_QUERY: 'repo:ethereum-optimism/docs is:pr created:${{ env.last_month }}' - - - name: Create issue for opened prs - uses: peter-evans/create-issue-from-file@v4 - with: - title: ${{ env.last_month }} metrics report for opened prs - token: ${{ secrets.GITHUB_TOKEN }} - content-filepath: ./issue_metrics.md - assignees: sbvegan - labels: | - monthly-report - - - name: Run issue-metrics tool for prs closed last month - uses: github/issue-metrics@v2 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SEARCH_QUERY: 'repo:ethereum-optimism/docs is:pr closed:${{ env.last_month }}' - - - name: Create issue for closed prs last month - uses: peter-evans/create-issue-from-file@v4 - with: - title: ${{ env.last_month }} metrics report for closed prs - content-filepath: ./issue_metrics.md - assignees: sbvegan - labels: | - monthly-report \ No newline at end of file diff --git a/.github/workflows/tutorials.yml b/.github/workflows/tutorials.yml deleted file mode 100644 index 7018045f1..000000000 --- a/.github/workflows/tutorials.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: Check Tutorials - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' # Runs at 00:00 UTC every day - -concurrency: - group: shared-tutorial-key - cancel-in-progress: false - -jobs: - cross-dom-bridge-eth: - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20.x' - - - name: Install pnpm - run: npm install -g pnpm - - - name: Install dependencies - run: pnpm install - - - name: Run tutorial - env: - TUTORIAL_PRIVATE_KEY: ${{ secrets.TUTORIAL_PRIVATE_KEY }} - run: - node ./public/tutorials/cross-dom-bridge-eth.js - - - name: Notify Slack on failure - uses: ravsamhq/notify-slack-action@v2 - if: always() - with: - status: ${{ job.status }} - notify_when: "failure" - notification_title: "{workflow} has {status_message} (<{run_url}|view errors>)" - message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" - footer: "<{run_url}|View Run>" - mention_users_when: "failure,warnings" - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - send-tx-from-eth: - needs: cross-dom-bridge-eth - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20.x' - - - name: Install pnpm - run: npm install -g pnpm - - - name: Install dependencies - run: pnpm install - - - name: Run tutorial - env: - TUTORIAL_PRIVATE_KEY: ${{ secrets.TUTORIAL_PRIVATE_KEY }} - run: - node ./public/tutorials/send-tx-from-eth.js - - - name: Notify Slack on failure - uses: ravsamhq/notify-slack-action@v2 - if: always() - with: - status: ${{ job.status }} - notify_when: "failure" - notification_title: "{workflow} has {status_message} (<{run_url}|view errors>)" - message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" - footer: "<{run_url}|View Run>" - mention_users_when: "failure,warnings" - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - sdk-estimate-costs: - needs: send-tx-from-eth - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: '20.x' - - - name: Install pnpm - run: npm install -g pnpm - - - name: Install dependencies - run: pnpm install - - - name: Run tutorial - env: - TUTORIAL_PRIVATE_KEY: ${{ secrets.TUTORIAL_PRIVATE_KEY }} - run: - node ./public/tutorials/sdk-estimate-costs.js - - - name: Notify Slack on failure - uses: ravsamhq/notify-slack-action@v2 - if: always() - with: - status: ${{ job.status }} - notify_when: "failure" - notification_title: "{workflow} has {status_message} (<{run_url}|view errors>)" - message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>" - footer: "<{run_url}|View Run>" - mention_users_when: "failure,warnings" - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}