Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into add-metadata-types-endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingvord committed Sep 30, 2024
2 parents cd6c358 + 3ac7673 commit 734ac73
Show file tree
Hide file tree
Showing 32 changed files with 1,266 additions and 309 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release-and-publish-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: swagger-schema
name: swagger-schema-${{ github.sha }}
path: ./swagger-schema.json

generate-upload-sdk:
Expand All @@ -139,7 +139,7 @@ jobs:

- uses: actions/download-artifact@v4
with:
name: swagger-schema
name: swagger-schema-${{ github.sha }}
path: .

- name: Generate Client
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-sdk-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: swagger-schema
name: swagger-schema-${{ github.sha }}
path: ./swagger-schema.json

generate-and-upload-sdk:
Expand All @@ -56,7 +56,7 @@ jobs:

- uses: actions/download-artifact@v4
with:
name: swagger-schema
name: swagger-schema-${{ github.sha }}
path: .

- name: Generate Client
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

[![Test](https://github.com/SciCatProject/scicat-backend-next/actions/workflows/test.yml/badge.svg)](https://github.com/SciCatProject/scicat-backend-next/actions/workflows/test.yml)
[![Deploy](https://github.com/SciCatProject/scicat-backend-next/actions/workflows/deploy.yml/badge.svg)](https://github.com/SciCatProject/scicat-backend-next/actions/workflows/deploy.yml)
[![Generate and upload latest SDK artifacts](https://github.com/SciCatProject/scicat-backend-next/actions/workflows/upload-sdk-artifact.yml/badge.svg?branch=master)](https://github.com/SciCatProject/scicat-backend-next/actions/workflows/upload-sdk-artifact.yml)
[![DeepScan grade](https://deepscan.io/api/teams/8394/projects/19251/branches/494247/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=8394&pid=19251&bid=494247)
[![Known Vulnerabilities](https://snyk.io/test/github/SciCatProject/scicat-backend-next/master/badge.svg?targetFile=package.json)](https://snyk.io/test/github/SciCatProject/scicat-backend-next/master?targetFile=package.json)

Expand Down
47 changes: 47 additions & 0 deletions migrations/20240920111733-dataset-unified-schema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module.exports = {
async up(db, client) {
// TODO write your migration here.
// See https://github.com/seppevs/migrate-mongo/#creating-a-new-migration-script
// Example:
// await db.collection('albums').updateOne({artist: 'The Beatles'}, {$set: {blacklisted: true}});
await db.collection("Dataset").updateMany({}, [
{
$set: {
proposalIds: ["$proposalId"],
instrumentIds: ["$instrumentId"],
sampleIds: ["$sampleId"],
},
},
]);
await db.collection("Dataset").updateMany({ type: "derived" }, [
{
$set: {
principalInvestigator: "$investigator",
},
},
]);
},

async down(db, client) {
// TODO write the statements to rollback your migration (if possible)
// Example:
// await db.collection('albums').updateOne({artist: 'The Beatles'}, {$set: {blacklisted: false}});

await db.collection("Dataset").updateMany({}, [
{
$set: {
proposalId: "$proposalIds[0]",
instrumentId: "$instrumentId[0]",
sampleId: "$sampleId[0]",
},
},
]);
await db.collection("Dataset").updateMany({ type: "derived" }, [
{
$set: {
investigator: "$principalInvestigator",
},
},
]);
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:api": "npm run test:api:jest --maxWorkers=50% && concurrently -k -s first \"wait-on http://localhost:3000/explorer/ && npm run test:api:mocha\" \"npm run start\"",
"test:api:jest": "jest --config ./test/config/jest-e2e.json --maxWorkers=50%",
"test:api:mocha": "mocha --config ./test/config/.mocharc.json -r chai/register-should.js ",
"test:api:mocha": "mocha --config ./test/config/.mocharc.json -r chai/register-should.js",
"prepare:local": "docker-compose -f CI/E2E/docker-compose-local.yaml --env-file CI/E2E/.env.elastic-search up -d && cp functionalAccounts.json.test functionalAccounts.json"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/config/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const configuration = () => {

const config = {
versions: {
api: "v3",
api: "3",
},
swaggerPath: process.env.SWAGGER_PATH || "explorer",
loggerConfigs: jsonConfigMap.loggers || [defaultLogger],
Expand Down
Loading

0 comments on commit 734ac73

Please sign in to comment.