From 76f4f0aff86c1408955ceaf5b343bd54ff2ebee1 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Sun, 28 Apr 2024 07:03:50 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9D=20(svg=20tester)=20prepare=20f?= =?UTF-8?q?or=20move=20to=20foundation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/svg-compare-all-views.yml | 21 --------------------- .github/workflows/svg-compare.yml | 21 --------------------- devTools/svgTester/utils.ts | 8 ++------ 3 files changed, 2 insertions(+), 48 deletions(-) diff --git a/.github/workflows/svg-compare-all-views.yml b/.github/workflows/svg-compare-all-views.yml index 0eb786171e3..a03c6d3eeab 100644 --- a/.github/workflows/svg-compare-all-views.yml +++ b/.github/workflows/svg-compare-all-views.yml @@ -61,27 +61,6 @@ jobs: RM_ON_ERROR: ${{ env.ORIGINAL_BRANCH_NAME == 'master' && '' || '--rm-on-error' }} run: node --enable-source-maps itsJustJavascript/devTools/svgTester/verify-graphs.js -i owid-grapher-svgs/configs -o owid-grapher-svgs/all-views/svg -r owid-grapher-svgs/all-views/svg --ids-from-file owid-grapher-svgs/most-viewed-charts.txt --all-views $RM_ON_ERROR > compare-result - # If the last step failed we want to commit all changed svgs and push them to the new branch on the owid-grapher-svgs repo - - uses: stefanzweifel/git-auto-commit-action@v5 - if: ${{ steps.run-verify-graphs.outcome == 'failure' }} - with: - repository: ./owid-grapher-svgs/ - branch: ${{ env.PUSH_BRANCH_NAME }} - push_options: "--force" - commit_message: Automated commit with svg differences (all views) triggered by commit https://github.com/owid/owid-grapher/commit/${{github.sha}} - - # Merge differences into owid-grapher-svgs master if we are on master in owid-grapher - - name: Merge into owid-grapher-svgs master - if: ${{ steps.run-verify-graphs.outcome == 'failure' && env.ORIGINAL_BRANCH_NAME == 'master' }} - working-directory: owid-grapher-svgs - run: | - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git checkout master - git pull origin master - git merge -s ort -X theirs -m 'Automated merge commit with svg differences (all views) triggered by commit https://github.com/owid/owid-grapher/commit/${{github.sha}}' ${{ env.PUSH_BRANCH_NAME }} - git push --force origin master - # The action fails if there were any errors. - name: Fail with error message if we had errors if: ${{ steps.run-verify-graphs.outputs.num_errors > 0 }} diff --git a/.github/workflows/svg-compare.yml b/.github/workflows/svg-compare.yml index f0bce8672c2..6069434e6ce 100644 --- a/.github/workflows/svg-compare.yml +++ b/.github/workflows/svg-compare.yml @@ -60,27 +60,6 @@ jobs: RM_ON_ERROR: ${{ env.ORIGINAL_BRANCH_NAME == 'master' && '' || '--rm-on-error' }} run: node --enable-source-maps itsJustJavascript/devTools/svgTester/verify-graphs.js -i owid-grapher-svgs/configs -o owid-grapher-svgs/svg -r owid-grapher-svgs/svg $RM_ON_ERROR > compare-result - # If the last step failed we want to commit all changed svgs and push them to the new branch on the owid-grapher-svgs repo - - uses: stefanzweifel/git-auto-commit-action@v4 - if: ${{ steps.run-verify-graphs.outcome == 'failure' }} - with: - repository: ./owid-grapher-svgs/ - branch: ${{ env.PUSH_BRANCH_NAME }} - push_options: "--force" - commit_message: Automated commit with svg differences triggered by commit https://github.com/owid/owid-grapher/commit/${{github.sha}} - - # Merge differences into owid-grapher-svgs master if we are on master in owid-grapher - - name: Merge into owid-grapher-svgs master - if: ${{ steps.run-verify-graphs.outcome == 'failure' && env.ORIGINAL_BRANCH_NAME == 'master' }} - working-directory: owid-grapher-svgs - run: | - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git checkout master - git pull origin master - git merge -s ort -X theirs -m 'Automated merge commit with svg differences triggered by commit https://github.com/owid/owid-grapher/commit/${{github.sha}}' ${{ env.PUSH_BRANCH_NAME }} - git push --force origin master - # The action fails if there were any errors. - name: Fail with error message if we had errors if: ${{ steps.run-verify-graphs.outputs.num_errors > 0 }} diff --git a/devTools/svgTester/utils.ts b/devTools/svgTester/utils.ts index 3666550749c..26c43e473c7 100644 --- a/devTools/svgTester/utils.ts +++ b/devTools/svgTester/utils.ts @@ -18,10 +18,6 @@ import { getVariableData } from "../../db/model/Variable.js" import { GrapherInterface } from "@ourworldindata/types" import _ from "lodash" import util from "util" -import { - BAKED_GRAPHER_URL, - BAKED_BASE_URL, -} from "../../settings/serverSettings.js" import { getHeapStatistics } from "v8" import { queryStringsByChartType } from "./chart-configurations.js" import * as d3 from "d3" @@ -400,8 +396,8 @@ export async function renderSvg( const grapher = initGrapherForSvgExport( { ...configAndData.config, - adminBaseUrl: BAKED_BASE_URL, - bakedGrapherURL: BAKED_GRAPHER_URL, + adminBaseUrl: "https://ourworldindata.org", + bakedGrapherURL: "https://ourworldindata.org/grapher", }, queryStr ) From 6d427e2043424675c88eab54281fac53917092dd Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Tue, 30 Apr 2024 12:32:10 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9D=20trigger=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit