Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐝 (svg tester) prepare for move to foundation #3546

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/workflows/svg-compare-all-views.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/svg-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
8 changes: 2 additions & 6 deletions devTools/svgTester/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
)
Expand Down
Loading