From 28d096cfd979ee497efbe734ea3132a684b150a5 Mon Sep 17 00:00:00 2001 From: Carl Cervone <42869436+ccerv1@users.noreply.github.com> Date: Thu, 23 May 2024 16:46:21 -0400 Subject: [PATCH 1/5] rf4: updates to eigentrust models (#1515) --- .../rf4_events_daily_to_project.sql | 5 +- .../marts/superchain/rf4_trusted_users.sql | 60 +++++++++++++++---- .../karma3/stg_karma3__globaltrust.sql | 13 +++- .../staging/karma3/stg_karma3__localtrust.sql | 20 ++++++- 4 files changed, 84 insertions(+), 14 deletions(-) diff --git a/warehouse/dbt/models/marts/superchain/rf4_events_daily_to_project.sql b/warehouse/dbt/models/marts/superchain/rf4_events_daily_to_project.sql index 7676c93fc..48887a4e4 100644 --- a/warehouse/dbt/models/marts/superchain/rf4_events_daily_to_project.sql +++ b/warehouse/dbt/models/marts/superchain/rf4_events_daily_to_project.sql @@ -40,7 +40,10 @@ select events.event_source, events.event_type, events.amount, - rf4_trusted_users.user_id as trusted_user_id + case + when rf4_trusted_users.is_trusted_user is true + then rf4_trusted_users.user_id + end as trusted_user_id from events left join {{ ref('artifacts_v1') }} as to_artifacts on events.to_artifact_id = to_artifacts.artifact_id diff --git a/warehouse/dbt/models/marts/superchain/rf4_trusted_users.sql b/warehouse/dbt/models/marts/superchain/rf4_trusted_users.sql index a1890934c..32638b538 100644 --- a/warehouse/dbt/models/marts/superchain/rf4_trusted_users.sql +++ b/warehouse/dbt/models/marts/superchain/rf4_trusted_users.sql @@ -1,14 +1,32 @@ with eigentrust_top_users as ( {# draft model for testing #} - select farcaster_id + select CAST(farcaster_id as string) as farcaster_id from {{ ref('stg_karma3__globaltrust') }} where - snapshot_time = '2024-05-01' + snapshot_time = '2024-05-21' and strategy_id = 1 order by eigentrust_rank desc limit 50000 ), +web_of_trust as ( + select CAST(fof_id as string) as farcaster_id + from ( + select + l2.peer_farcaster_id as fof_id, + COUNT(distinct l1.peer_farcaster_id) as edge_count + from {{ ref('stg_karma3__localtrust') }} as l1 + left join {{ ref('stg_karma3__localtrust') }} as l2 + on l1.peer_farcaster_id = l2.farcaster_id + where + l1.farcaster_id = 5650 + and l1.strategy_id = 1 + and l2.strategy_id = 1 + group by l2.peer_farcaster_id + ) + where edge_count > 1 +), + user_model as ( select artifacts_by_user.user_id, @@ -16,26 +34,48 @@ user_model as ( artifacts_by_user.user_source_id, artifacts_by_user.artifact_name, CAST( - eigentrust_top_users.farcaster_id - is not null as bool + artifacts_by_user.user_source_id < '20939' + as int64 + ) as farcaster_prepermissionless, + CAST( + eigentrust_top_users.farcaster_id is not null + as int64 ) as eigentrust_verification, CAST( - passport_scores.evidence_rawscore - >= passport_scores.evidence_threshold as bool + web_of_trust.farcaster_id is not null + as int64 + ) as vitalik_verification, + CAST( + COALESCE( + passport_scores.evidence_rawscore + >= passport_scores.evidence_threshold, + false + ) + as int64 ) as passport_verification from {{ ref('int_artifacts_by_user') }} as artifacts_by_user left join {{ ref('stg_passport__scores') }} as passport_scores on artifacts_by_user.artifact_name = passport_scores.passport_address left join eigentrust_top_users on artifacts_by_user.user_source_id = eigentrust_top_users.farcaster_id + left join web_of_trust + on artifacts_by_user.user_source_id = web_of_trust.farcaster_id ) select user_id, user_source, user_source_id, - artifact_name + artifact_name, + farcaster_prepermissionless, + eigentrust_verification, + vitalik_verification, + passport_verification, + ( + farcaster_prepermissionless + + eigentrust_verification + + vitalik_verification + + passport_verification + >= 1 + ) as is_trusted_user from user_model -where - passport_verification is true - or eigentrust_verification is true diff --git a/warehouse/dbt/models/staging/karma3/stg_karma3__globaltrust.sql b/warehouse/dbt/models/staging/karma3/stg_karma3__globaltrust.sql index 822538aa1..442f50bb0 100644 --- a/warehouse/dbt/models/staging/karma3/stg_karma3__globaltrust.sql +++ b/warehouse/dbt/models/staging/karma3/stg_karma3__globaltrust.sql @@ -3,9 +3,20 @@ for Farcaster IDs #} +{{ + config( + materialized='table', + partition_by={ + "field": "snapshot_time", + "data_type": "timestamp", + "granularity": "day" + } + ) +}} + select strategy_id, - CAST(i as string) as farcaster_id, + i as farcaster_id, CAST(v as numeric) as eigentrust_rank, CAST(date as timestamp) as snapshot_time from {{ source("karma3", "globaltrust") }} diff --git a/warehouse/dbt/models/staging/karma3/stg_karma3__localtrust.sql b/warehouse/dbt/models/staging/karma3/stg_karma3__localtrust.sql index 5f3c5aa6f..33900d1ee 100644 --- a/warehouse/dbt/models/staging/karma3/stg_karma3__localtrust.sql +++ b/warehouse/dbt/models/staging/karma3/stg_karma3__localtrust.sql @@ -1,11 +1,27 @@ {# Get all Karma3 EigenTrust scores - for Farcaster IDs + for Farcaster IDs - Local Trust #} +{{ + config( + materialized='table', + partition_by={ + "field": "farcaster_id", + "data_type": "int64", + "range": { + "start": 0, + "end": 1000000, + "interval": 25000 + } + } + ) +}} + select strategy_id, - CAST(i as string) as farcaster_id, + i as farcaster_id, + j as peer_farcaster_id, CAST(v as numeric) as eigentrust_rank, CAST(date as timestamp) as snapshot_time from {{ source("karma3", "localtrust") }} From 18534fce367a4ffd6f12756751f82942cbfd4e0a Mon Sep 17 00:00:00 2001 From: Raymond Cheng Date: Thu, 23 May 2024 16:37:59 -0700 Subject: [PATCH 2/5] feat: deploy docusaurus docs via GitHub Actions to Cloudflare (#1516) * Testing the GitHub actions workflow instead of Vercel --- .github/workflows/ci-default.yml | 10 ++-- .github/workflows/deploy-docusaurus-docs.yml | 56 ++++++++++++++++++++ pnpm-lock.yaml | 50 ++++++++--------- 3 files changed, 86 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/deploy-docusaurus-docs.yml diff --git a/.github/workflows/ci-default.yml b/.github/workflows/ci-default.yml index 52d8cb855..ea2969914 100644 --- a/.github/workflows/ci-default.yml +++ b/.github/workflows/ci-default.yml @@ -9,7 +9,7 @@ env: NODE_ENV: ${{ vars.NODE_ENV }} PLASMIC_PROJECT_ID: ${{ vars.PLASMIC_PROJECT_ID }} PLASMIC_PROJECT_API_TOKEN: ${{ vars.PLASMIC_PROJECT_API_TOKEN }} - NEXT_PUBLIC_DOMAIN: ${{ vars.NEXT_PUBLIC_DOMAIN }} + NEXT_PUBLIC_DOMAIN: "www.opensource.observer" NEXT_PUBLIC_DB_GRAPHQL_URL: ${{ vars.NEXT_PUBLIC_DB_GRAPHQL_URL }} OSO_API_KEY: ${{ secrets.OSO_API_KEY }} NEXT_PUBLIC_ALGOLIA_APPLICATION_ID: "test" @@ -108,9 +108,9 @@ jobs: version: nightly-87bc53fc6c874bd4c92d97ed180b949e3a36d78c - name: Authenticate to google with a test-dummy user - uses: 'google-github-actions/auth@v2' + uses: "google-github-actions/auth@v2" with: - credentials_json: '${{ env.GOOGLE_TEST_DUMMY_CREDENTIALS_JSON }}' + credentials_json: "${{ env.GOOGLE_TEST_DUMMY_CREDENTIALS_JSON }}" create_credentials_file: true - name: Setup dbt profile @@ -119,7 +119,7 @@ jobs: - name: Run supabase local run: | - bash .github/scripts/run-supabase-local.sh apps/frontend + bash .github/scripts/run-supabase-local.sh apps/frontend - name: Check if algolia is empty, set the variable to some dummy value if it is shell: bash @@ -139,7 +139,7 @@ jobs: - name: Lint run: | - pnpm lint + pnpm lint # Always run this step so that all linting errors can be seen at once. if: always() diff --git a/.github/workflows/deploy-docusaurus-docs.yml b/.github/workflows/deploy-docusaurus-docs.yml new file mode 100644 index 000000000..640e33015 --- /dev/null +++ b/.github/workflows/deploy-docusaurus-docs.yml @@ -0,0 +1,56 @@ +# NOTE: This name appears in GitHub's Checks API and in workflow's status badge. +name: deploy-docusaurus-docs +env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + DOCS_URL: ${{ vars.DOCS_URL }} + DOCS_ALGOLIA_APP_ID: ${{ vars.DOCS_ALGOLIA_APP_ID }} + DOCS_ALGOLIA_API_KEY: ${{ vars.DOCS_ALGOLIA_API_KEY }} + DOCS_ALGOLIA_INDEX: ${{ vars.DOCS_ALGOLIA_INDEX }} + DOCS_SEGMENT_WRITE_KEY: ${{ vars.DOCS_SEGMENT_WRITE_KEY }} + +# Trigger the workflow when: +on: + # A push occurs to one of the matched branches. + push: + branches: + - main + paths: + - apps/docs/** + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build-deploy: + # NOTE: This name appears in GitHub's Checks API. + name: build-deploy + environment: deploy + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Set up Node.js 20 + uses: actions/setup-node@v3 + with: + cache: "pnpm" + node-version: "20.x" + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 9 + run_install: | + - recursive: true + args: [--frozen-lockfile, --strict-peer-dependencies] + + - name: Build + run: pnpm build:docs + + - name: Publish + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + workingDirectory: "apps/docs" + command: pages deploy build --project-name=docs-opensource-observer diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ecd8d16e4..ee2c0fb06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,7 +31,7 @@ importers: version: 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/preset-classic': specifier: 3.1.1 - version: 3.1.1(@algolia/client-search@4.23.3)(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3) + version: 3.1.1(@algolia/client-search@4.23.3)(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3) '@docusaurus/theme-common': specifier: 3.1.1 version: 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) @@ -40,10 +40,10 @@ importers: version: 1.0.6 '@mdx-js/react': specifier: ^3.0.0 - version: 3.0.0(@types/react@18.2.79)(react@18.2.0) + version: 3.0.0(@types/react@18.3.3)(react@18.2.0) '@plasmicapp/react-web': specifier: ^0.2.337 - version: 0.2.337(@types/react@18.2.79)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + version: 0.2.337(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) clsx: specifier: ^2.1.0 version: 2.1.0 @@ -4337,8 +4337,8 @@ packages: '@types/react@18.2.64': resolution: {integrity: sha512-MlmPvHgjj2p3vZaxbQgFUQFvD8QiZwACfGqEdDSWou5yISWxDQ4/74nCAwsUiX7UFLKZz3BbVSPj+YxeoGGCfg==} - '@types/react@18.2.79': - resolution: {integrity: sha512-RwGAGXPl9kSXwdNTafkOEuFrTBD5SA2B3iEB96xi8+xu5ddUa/cpvyVCSNn+asgLCTHkb5ZxN8gbuibYJi4s1w==} + '@types/react@18.3.3': + resolution: {integrity: sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==} '@types/readable-stream@2.3.15': resolution: {integrity: sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==} @@ -13070,14 +13070,14 @@ snapshots: '@docsearch/css@3.5.2': {} - '@docsearch/react@3.5.2(@algolia/client-search@4.23.3)(@types/react@18.2.79)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)': + '@docsearch/react@3.5.2(@algolia/client-search@4.23.3)(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)': dependencies: '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.23.3)(algoliasearch@4.22.1)(search-insights@2.13.0) '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.23.3)(algoliasearch@4.22.1) '@docsearch/css': 3.5.2 algoliasearch: 4.22.1 optionalDependencies: - '@types/react': 18.2.79 + '@types/react': 18.3.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) search-insights: 2.13.0 @@ -13480,7 +13480,7 @@ snapshots: - vue-template-compiler - webpack-cli - '@docusaurus/preset-classic@3.1.1(@algolia/client-search@4.23.3)(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3)': + '@docusaurus/preset-classic@3.1.1(@algolia/client-search@4.23.3)(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3)': dependencies: '@docusaurus/core': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/plugin-content-blog': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) @@ -13491,9 +13491,9 @@ snapshots: '@docusaurus/plugin-google-gtag': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/plugin-google-tag-manager': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/plugin-sitemap': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) - '@docusaurus/theme-classic': 3.1.1(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) + '@docusaurus/theme-classic': 3.1.1(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/theme-common': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) - '@docusaurus/theme-search-algolia': 3.1.1(@algolia/client-search@4.23.3)(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3) + '@docusaurus/theme-search-algolia': 3.1.1(@algolia/client-search@4.23.3)(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3) '@docusaurus/types': 3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -13519,11 +13519,11 @@ snapshots: '@docusaurus/react-loadable@5.5.2(react@18.2.0)': dependencies: - '@types/react': 18.2.64 + '@types/react': 18.3.3 prop-types: 15.8.1 react: 18.2.0 - '@docusaurus/theme-classic@3.1.1(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3)': + '@docusaurus/theme-classic@3.1.1(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3)': dependencies: '@docusaurus/core': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/mdx-loader': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -13537,7 +13537,7 @@ snapshots: '@docusaurus/utils': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) '@docusaurus/utils-common': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) '@docusaurus/utils-validation': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) - '@mdx-js/react': 3.0.0(@types/react@18.2.79)(react@18.2.0) + '@mdx-js/react': 3.0.0(@types/react@18.3.3)(react@18.2.0) clsx: 2.1.0 copy-text-to-clipboard: 3.2.0 infima: 0.2.0-alpha.43 @@ -13607,9 +13607,9 @@ snapshots: - vue-template-compiler - webpack-cli - '@docusaurus/theme-search-algolia@3.1.1(@algolia/client-search@4.23.3)(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3)': + '@docusaurus/theme-search-algolia@3.1.1(@algolia/client-search@4.23.3)(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3)': dependencies: - '@docsearch/react': 3.5.2(@algolia/client-search@4.23.3)(@types/react@18.2.79)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0) + '@docsearch/react': 3.5.2(@algolia/client-search@4.23.3)(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0) '@docusaurus/core': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/logger': 3.1.1 '@docusaurus/plugin-content-docs': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) @@ -15004,10 +15004,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@mdx-js/react@3.0.0(@types/react@18.2.79)(react@18.2.0)': + '@mdx-js/react@3.0.0(@types/react@18.3.3)(react@18.2.0)': dependencies: '@types/mdx': 2.0.10 - '@types/react': 18.2.79 + '@types/react': 18.3.3 react: 18.2.0 '@metamask/eth-sig-util@4.0.1': @@ -15774,7 +15774,7 @@ snapshots: dependencies: react: 18.2.0 - '@plasmicapp/react-web@0.2.337(@types/react@18.2.79)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + '@plasmicapp/react-web@0.2.337(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@plasmicapp/auth-react': 0.0.21(react@18.2.0) '@plasmicapp/data-sources': 0.1.155(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -15808,7 +15808,7 @@ snapshots: fast-deep-equal: 3.1.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - valtio: 1.13.2(@types/react@18.2.79)(react@18.2.0) + valtio: 1.13.2(@types/react@18.3.3)(react@18.2.0) transitivePeerDependencies: - '@types/react' @@ -17514,7 +17514,7 @@ snapshots: '@types/scheduler': 0.16.8 csstype: 3.1.3 - '@types/react@18.2.79': + '@types/react@18.3.3': dependencies: '@types/prop-types': 15.7.12 csstype: 3.1.3 @@ -19351,9 +19351,9 @@ snapshots: dequal@2.0.3: {} - derive-valtio@0.1.0(valtio@1.13.2(@types/react@18.2.79)(react@18.2.0)): + derive-valtio@0.1.0(valtio@1.13.2(@types/react@18.3.3)(react@18.2.0)): dependencies: - valtio: 1.13.2(@types/react@18.2.79)(react@18.2.0) + valtio: 1.13.2(@types/react@18.3.3)(react@18.2.0) destroy@1.2.0: {} @@ -26059,13 +26059,13 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - valtio@1.13.2(@types/react@18.2.79)(react@18.2.0): + valtio@1.13.2(@types/react@18.3.3)(react@18.2.0): dependencies: - derive-valtio: 0.1.0(valtio@1.13.2(@types/react@18.2.79)(react@18.2.0)) + derive-valtio: 0.1.0(valtio@1.13.2(@types/react@18.3.3)(react@18.2.0)) proxy-compare: 2.6.0 use-sync-external-store: 1.2.0(react@18.2.0) optionalDependencies: - '@types/react': 18.2.79 + '@types/react': 18.3.3 react: 18.2.0 value-equal@1.0.1: {} From 19e22c75b5b133eaca6029118f7225055c92e630 Mon Sep 17 00:00:00 2001 From: Raymond Cheng Date: Thu, 23 May 2024 16:48:56 -0700 Subject: [PATCH 3/5] fix: install pnpm before node in deploy-docusaurus-docs (#1518) --- .github/workflows/deploy-docusaurus-docs.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-docusaurus-docs.yml b/.github/workflows/deploy-docusaurus-docs.yml index 640e33015..d0ac302cb 100644 --- a/.github/workflows/deploy-docusaurus-docs.yml +++ b/.github/workflows/deploy-docusaurus-docs.yml @@ -31,12 +31,6 @@ jobs: with: fetch-depth: 1 - - name: Set up Node.js 20 - uses: actions/setup-node@v3 - with: - cache: "pnpm" - node-version: "20.x" - - name: Setup pnpm uses: pnpm/action-setup@v2 with: @@ -45,6 +39,12 @@ jobs: - recursive: true args: [--frozen-lockfile, --strict-peer-dependencies] + - name: Set up Node.js 20 + uses: actions/setup-node@v3 + with: + cache: "pnpm" + node-version: "20.x" + - name: Build run: pnpm build:docs From b6e9d228251cb34b650b72f8789e8de9a3c9fc4d Mon Sep 17 00:00:00 2001 From: Raymond Cheng Date: Thu, 23 May 2024 19:05:38 -0700 Subject: [PATCH 4/5] feat: deploy job for dbt generated docs (#1519) --- .github/workflows/deploy-dbt-docs.yml | 77 +++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/deploy-dbt-docs.yml diff --git a/.github/workflows/deploy-dbt-docs.yml b/.github/workflows/deploy-dbt-docs.yml new file mode 100644 index 000000000..18008eef0 --- /dev/null +++ b/.github/workflows/deploy-dbt-docs.yml @@ -0,0 +1,77 @@ +# NOTE: This name appears in GitHub's Checks API and in workflow's status badge. +name: deploy-dbt-docs +env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + # Google variables + GOOGLE_PROJECT_ID: "opensource-observer" + GOOGLE_TEST_DUMMY_CREDENTIALS_JSON: ${{ vars.GOOGLE_TEST_DUMMY_CREDENTIALS_JSON }} + +# Trigger the workflow when: +on: + # A push occurs to one of the matched branches. + push: + branches: + - main + paths: + - warehouse/dbt/** + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build-deploy: + # NOTE: This name appears in GitHub's Checks API. + name: build-deploy + environment: deploy + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Load public vars + run: | + bash .github/scripts/load-public-vars.sh $GITHUB_ENV \ + NODE_ENV \ + GOOGLE_PROJECT_ID \ + GOOGLE_TEST_DUMMY_CREDENTIALS_JSON \ + PUBLIC_VARS_TEST + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 9 + run_install: | + - recursive: true + args: [--frozen-lockfile, --strict-peer-dependencies] + + - name: Set up Node.js 20 + uses: actions/setup-node@v3 + with: + cache: "pnpm" + node-version: "20.x" + + - name: "Setup Python, Poetry and Dependencies" + uses: packetcoders/action-setup-cache-python-poetry@main + with: + python-version: 3.12 + poetry-version: 1.7.1 + + - name: Authenticate to google with a test-dummy user + uses: "google-github-actions/auth@v2" + with: + credentials_json: "${{ env.GOOGLE_TEST_DUMMY_CREDENTIALS_JSON }}" + create_credentials_file: true + + - name: Setup dbt profile + run: | + bash .github/scripts/create-dbt-profile.sh ${GOOGLE_APPLICATION_CREDENTIALS} + + - name: Build + run: pnpm build:dbt:docs + + - name: Publish + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + command: pages deploy target --project-name=models-opensource-observer From 578f0ae2ec8487001d12255583378050ae9fbba3 Mon Sep 17 00:00:00 2001 From: Raymond Cheng Date: Thu, 23 May 2024 19:24:02 -0700 Subject: [PATCH 5/5] fix: use real BQ credentials in deploy-dbt-docs (#1520) --- .github/workflows/deploy-dbt-docs.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy-dbt-docs.yml b/.github/workflows/deploy-dbt-docs.yml index 18008eef0..280bbe3ef 100644 --- a/.github/workflows/deploy-dbt-docs.yml +++ b/.github/workflows/deploy-dbt-docs.yml @@ -4,7 +4,6 @@ env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} # Google variables GOOGLE_PROJECT_ID: "opensource-observer" - GOOGLE_TEST_DUMMY_CREDENTIALS_JSON: ${{ vars.GOOGLE_TEST_DUMMY_CREDENTIALS_JSON }} # Trigger the workflow when: on: @@ -29,14 +28,6 @@ jobs: with: fetch-depth: 1 - - name: Load public vars - run: | - bash .github/scripts/load-public-vars.sh $GITHUB_ENV \ - NODE_ENV \ - GOOGLE_PROJECT_ID \ - GOOGLE_TEST_DUMMY_CREDENTIALS_JSON \ - PUBLIC_VARS_TEST - - name: Setup pnpm uses: pnpm/action-setup@v2 with: @@ -57,10 +48,10 @@ jobs: python-version: 3.12 poetry-version: 1.7.1 - - name: Authenticate to google with a test-dummy user + - name: Login to google uses: "google-github-actions/auth@v2" with: - credentials_json: "${{ env.GOOGLE_TEST_DUMMY_CREDENTIALS_JSON }}" + credentials_json: "${{ secrets.GOOGLE_BQ_ADMIN_CREDENTIALS_JSON }}" create_credentials_file: true - name: Setup dbt profile