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

Deployment #1789

Merged
merged 25 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
24f56ea
chore(deps-dev): bump eslint-plugin-react from 7.37.1 to 7.37.2
dependabot[bot] Oct 28, 2024
98b2f16
chore(deps-dev): bump @types/jest from 29.5.13 to 29.5.14
dependabot[bot] Oct 28, 2024
9a6cfc1
chore(deps-dev): bump msw from 2.4.11 to 2.5.2
dependabot[bot] Oct 28, 2024
553222b
chore(deps-dev): bump @ory/client from 1.15.4 to 1.15.7
dependabot[bot] Oct 28, 2024
dbc6af7
chore(deps-dev): bump uuid from 10.0.0 to 11.0.1 in /packages/server
dependabot[bot] Oct 28, 2024
0759ad4
Merge pull request #1784 from serlo/dependabot/npm_and_yarn/ory/clien…
hugotiburtino Oct 28, 2024
724ebf9
Merge pull request #1783 from serlo/dependabot/npm_and_yarn/msw-2.5.2
hugotiburtino Oct 28, 2024
8403d16
Merge pull request #1782 from serlo/dependabot/npm_and_yarn/types/jes…
hugotiburtino Oct 28, 2024
618a791
chore(deps-dev): bump @types/node from 18.19.50 to 22.8.1
dependabot[bot] Oct 28, 2024
c5bfc43
Merge pull request #1781 from serlo/dependabot/npm_and_yarn/types/nod…
hugotiburtino Oct 29, 2024
b91f13e
fix(metadata): filter community entities from en and es instances
hugotiburtino Oct 29, 2024
6995254
fix(metadata): fix entities with invalid licenses according to amb
hugotiburtino Oct 29, 2024
0be5253
fix(metadata): now filter french community entities for real
hugotiburtino Oct 29, 2024
bdcea80
fix(metadata): add missing subjects for `about` field
hugotiburtino Oct 29, 2024
3cbbbbd
doc(metadata): add instruction to use more complete test in another repo
hugotiburtino Oct 29, 2024
ff2e7ed
chore(js): update lock
hugotiburtino Oct 29, 2024
951a8a0
fix(user-add-role): fix deadloack by not creating role if it doesnt e…
hugotiburtino Oct 29, 2024
c55b49b
fix(user-add-role): fix deadloack by not creating role if it doesnt e…
hugotiburtino Oct 29, 2024
512c324
Merge pull request #1787 from serlo/fix-deadlock-add-role
hugotiburtino Oct 29, 2024
55cba72
Merge pull request #1780 from serlo/dependabot/npm_and_yarn/eslint-pl…
hugotiburtino Oct 29, 2024
175c8c0
Merge branch 'staging' into dependabot/npm_and_yarn/packages/server/u…
hugotiburtino Oct 29, 2024
174be19
Merge pull request #1785 from serlo/dependabot/npm_and_yarn/packages/…
hugotiburtino Oct 29, 2024
56c6af9
refactor(metadata): filter content from schlau-werkstatt and chancenwerk
hugotiburtino Oct 30, 2024
e169761
refactor(metadata): add warning in sentry in case of not mapped subject
hugotiburtino Oct 30, 2024
a5c6e2b
Merge pull request #1786 from serlo/metadata-filter-invalid
hugotiburtino Oct 30, 2024
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions __tests__/schema/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ test('endpoint `publisher` returns publisher', async () => {
})
})

/**
* For more complete and complex tests go to `serlo/metadata-exports` and run `pipenv run validate_local`. Remember to run `yarn mysql:import-anonymous-data` first.
*/
describe('endpoint "resources"', () => {
const query = new Client().prepareQuery({
query: gql`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@luckycatfactory/esbuild-graphql-loader": "^3.8.1",
"@tsconfig/node20": "^20.1.4",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.8",
"@types/node": "^22.8.1",
"@typescript-eslint/eslint-plugin": "^8.6.0",
"@typescript-eslint/parser": "^8.6.0",
"default-import": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/db-migrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@slack/web-api": "^7.4.0",
"@tsconfig/node20": "^20.1.4",
"@types/jest": "^29.5.12",
"@types/node": "^18.19.50",
"@types/node": "^22.8.1",
"@types/ramda": "^0.30.2",
"@types/semver": "^7.5.8",
"@types/uuid": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
"redlock": "^5.0.0-beta2",
"semver": "^7.6.3",
"ts-toolbelt": "^9.6.0",
"uuid": "^10.0.0"
"uuid": "^11.0.1"
}
}
24 changes: 21 additions & 3 deletions packages/server/src/schema/metadata/resolvers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as R from 'ramda'

import { captureErrorEvent } from '~/error-event'
import { UserInputError } from '~/errors'
import { createNamespace, decodeId } from '~/internals/graphql'
import { resolveConnection } from '~/schema/connection/utils'
Expand Down Expand Up @@ -112,8 +113,8 @@ export const resolvers: Resolvers = {
JOIN subject_mapping ON subject_mapping.taxonomy_id = child.parent_id
-- "Fächer im Aufbau" taxonomy is on the level of normal Serlo subjects, therefore we need a level below it.
-- "Partner" taxonomy is below the subject "Mathematik", but we only want the entities with the specific partner as the subject.
WHERE child.parent_id NOT IN (87993, 106081, 146728)
-- Exclude content under "Baustelle", "Community", "Zum Testen" and "Testbereich" taxonomies
-- Exclude content under "Baustelle", "Community" (from de, en and es instances), "Zum Testen" and "Testbereich" taxonomies
WHERE child.parent_id NOT IN (87993, 106081, 146728, 48537, 164234, 141588, 268835, 146870)
AND child.id NOT IN (75211, 105140, 107772, 135390, 25107, 106082)
)
SELECT
Expand Down Expand Up @@ -150,6 +151,7 @@ export const resolvers: Resolvers = {
AND type.name IN ("applet", "article", "course", "text-exercise",
"text-exercise-group", "video")
AND NOT subject_mapping.subject_id = 146728
AND license.url NOT LIKE "https://www.youtube.com/static?%"
GROUP BY entity.id
ORDER BY entity.id
LIMIT ?
Expand Down Expand Up @@ -419,7 +421,9 @@ function getRaWSubject(id: number): RawSubject[] {
case 18230:
return [{ id: '1002', scheme: Scheme.SchoolSubject }]
// Biologie (Schule)
// Forensik 195927
case 23362:
case 195927:
return [{ id: '1001', scheme: Scheme.SchoolSubject }]
// Englisch (Shule)
case 25979:
Expand All @@ -436,7 +440,6 @@ function getRaWSubject(id: number): RawSubject[] {
// Informatik (Schule)
case 47899:
return [{ id: '1013', scheme: Scheme.SchoolSubject }]

// Politik => Politik, Sachunterricht (Schule)
case 79159:
case 107556:
Expand All @@ -460,8 +463,10 @@ function getRaWSubject(id: number): RawSubject[] {
case 112723:
return [{ id: '1006', scheme: Scheme.SchoolSubject }]
// Geschichte (Schule)
// Estudios en Diásporas Africanas 242308
case 136362:
case 140528:
case 242308:
return [{ id: '1011', scheme: Scheme.SchoolSubject }]
// Wirtschaftskunde (Schule)
case 137757:
Expand Down Expand Up @@ -506,7 +511,20 @@ function getRaWSubject(id: number): RawSubject[] {
{ id: '1043', scheme: Scheme.SchoolSubject },
{ id: '1005', scheme: Scheme.SchoolSubject },
]
// Lerntipps, => Erziehungswissenschaft (Schule)
case 181883:
case 148619:
return [{ id: '1043', scheme: Scheme.SchoolSubject }]
default:
captureErrorEvent({
error: new Error(
'metadata: subject could not be mapped to field `about`',
),
errorContext: {
subjectId: id,
warning: 'It will break the export to Mein Bildungsraum',
},
})
return []
}
}
Expand Down
12 changes: 0 additions & 12 deletions packages/server/src/schema/uuid/user/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,18 +320,6 @@ export const resolvers: Resolvers = {
if (id == null) {
throw new UserInputError('no user with given username')
}
await database.mutate(
`
INSERT INTO role (name)
SELECT ?
WHERE NOT EXISTS (
SELECT 1
FROM role
WHERE name = ?
)
`,
[generateRole(role, instance), generateRole(role, instance)],
)

await database.mutate(
`
Expand Down
Loading