Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b4e9c3d
fix: provide datasets to all actions (#2253)
sbliven Oct 6, 2025
56cd0ea
build(deps-dev): bump @nestjs/schematics in the nestjs group
dependabot[bot] Oct 6, 2025
965cca3
build(deps-dev): bump @nestjs/schematics from 11.0.7 to 11.0.8 in the…
github-actions[bot] Oct 6, 2025
983b5b0
build(deps-dev): bump @types/node from 24.5.2 to 24.7.0
dependabot[bot] Oct 6, 2025
1c7eabe
build(deps-dev): bump @types/node from 24.5.2 to 24.7.0 (#2257)
github-actions[bot] Oct 6, 2025
4ce864d
build(deps-dev): bump @types/nodemailer from 7.0.1 to 7.0.2
dependabot[bot] Oct 6, 2025
6708882
build(deps-dev): bump @types/nodemailer from 7.0.1 to 7.0.2 (#2260)
github-actions[bot] Oct 6, 2025
1a602c0
build(deps): bump mathjs from 14.8.1 to 14.8.2
dependabot[bot] Oct 6, 2025
86bc83f
build(deps): bump mathjs from 14.8.1 to 14.8.2 (#2262)
github-actions[bot] Oct 6, 2025
c3a232a
build(deps-dev): bump @eslint/js from 9.36.0 to 9.37.0
dependabot[bot] Oct 6, 2025
65a1c99
build(deps-dev): bump @eslint/js from 9.36.0 to 9.37.0 (#2265)
github-actions[bot] Oct 6, 2025
a56b41e
build(deps): bump dotenv from 17.2.2 to 17.2.3
dependabot[bot] Oct 6, 2025
75ce1b3
build(deps): bump dotenv from 17.2.2 to 17.2.3 (#2261)
github-actions[bot] Oct 6, 2025
8fe0dcf
build(deps-dev): bump mocha from 11.7.2 to 11.7.4
dependabot[bot] Oct 6, 2025
94acd58
build(deps-dev): bump mocha from 11.7.2 to 11.7.4 (#2264)
github-actions[bot] Oct 6, 2025
bb1b16e
build(deps-dev): bump eslint from 9.36.0 to 9.37.0
dependabot[bot] Oct 6, 2025
689e981
build(deps-dev): bump eslint from 9.36.0 to 9.37.0 (#2259)
github-actions[bot] Oct 6, 2025
9507eb1
build(deps-dev): bump typescript from 5.9.2 to 5.9.3
dependabot[bot] Oct 6, 2025
2b323c3
build(deps-dev): bump typescript from 5.9.2 to 5.9.3 (#2258)
github-actions[bot] Oct 6, 2025
336bad4
build(deps): downgrade uuid from 13.0.0 to 11.1.0 (#2266)
Junjiequan Oct 8, 2025
80ab0a1
build(deps): bump mongoose from 8.18.2 to 8.19.0
dependabot[bot] Oct 8, 2025
2e1dfc6
build(deps): bump mongoose from 8.18.2 to 8.19.0 (#2263)
github-actions[bot] Oct 8, 2025
32fe42c
fix: pass URL directly to include qwargs (#2268)
minottic Oct 8, 2025
a1d7def
docs: add note explaining duplicated V4 in SDK methods (#2267)
abdimo101 Oct 9, 2025
acecc76
feat(config): add the numberOfDatasets in defaultProposalsListSetting…
abdimo101 Oct 13, 2025
c979ae8
build(deps-dev): bump @typescript-eslint/parser from 8.45.0 to 8.46.0
dependabot[bot] Oct 13, 2025
5aa5bf3
build(deps-dev): bump @typescript-eslint/parser from 8.45.0 to 8.46.0…
github-actions[bot] Oct 13, 2025
7a27f81
build(deps-dev): bump @types/node from 24.7.0 to 24.7.2
dependabot[bot] Oct 13, 2025
b88d328
build(deps-dev): bump @types/node from 24.7.0 to 24.7.2 (#2276)
github-actions[bot] Oct 13, 2025
4302dc0
build(deps-dev): bump ts-jest from 29.4.4 to 29.4.5
dependabot[bot] Oct 13, 2025
055df49
build(deps-dev): bump ts-jest from 29.4.4 to 29.4.5 (#2279)
github-actions[bot] Oct 13, 2025
44315f5
build(deps-dev): bump @typescript-eslint/eslint-plugin
dependabot[bot] Oct 13, 2025
5ffca66
build(deps-dev): bump @typescript-eslint/eslint-plugin from 8.45.0 to…
github-actions[bot] Oct 13, 2025
4151734
feat: allow url actions to ignore errors from remote calls (#2271)
sbliven Oct 13, 2025
1952d6b
fix: change hardcoded admin to ADMIN_GROUPS (#2272)
minottic Oct 14, 2025
6d27903
fix(dataset): ensure that fields required for the lookups are include…
abdimo101 Oct 15, 2025
993c33f
fix: respect the `PublishedData.status` when creating with /api/v3 (#…
fpotier Oct 15, 2025
624d42c
feat: add backwards compatible history to v3/datasets response (#2282)
omkar-ethz Oct 16, 2025
d57621b
feat: add migration script to/from legacy history to generic history …
omkar-ethz Oct 16, 2025
e1c024a
fix: convert all object fields from obsolete to generic history (#2288)
omkar-ethz Oct 16, 2025
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
9 changes: 1 addition & 8 deletions migrate-mongo-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@ if (!MONGODB_URI) {
throw new Error("Environment variable MONGODB_URI not set");
}

const lastSlashIndex = MONGODB_URI.lastIndexOf("/");
// NOTE: Get the database url and name from the MONGODB_URI and use them instead of defining new variables.
const DATABASE_URL = MONGODB_URI.substring(0, lastSlashIndex);
const DATABASE_NAME = MONGODB_URI.substring(lastSlashIndex + 1);

const config = {
mongodb: {
url: DATABASE_URL,

databaseName: DATABASE_NAME,
url: MONGODB_URI,

options: {
useNewUrlParser: true, // removes a deprecation warning when connecting
Expand Down
65 changes: 65 additions & 0 deletions migrations/20251014092142-legacy-history-to-generic-history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* eslint-disable @typescript-eslint/no-require-imports */
const convertObsoleteHistoryToGenericHistory =
require("../dist/datasets/utils/history.util").convertObsoleteHistoryToGenericHistory;

const convertGenericHistoriesToObsoleteHistories =
require("../dist/datasets/utils/history.util").convertGenericHistoriesToObsoleteHistories;

module.exports = {
/**
* @param db {import('mongodb').Db}
* @param client {import('mongodb').MongoClient}
* @returns {Promise<void>}
*/
async up(db, client) {
for await (const dataset of db
.collection("Dataset")
.find({ history: { $exists: true, $type: "array", $ne: [] } })) {
console.log(
`Migrating history for dataset ${dataset._id}. Entries: ${dataset.history.length}`,
);
const genericHistories = dataset.history.map((entry) =>
convertObsoleteHistoryToGenericHistory(entry, dataset._id),
);
result = await db.collection("History").insertMany(genericHistories);
}
await db.collection("Dataset").updateMany({}, { $unset: { history: "" } });
},

/**
* @param db {import('mongodb').Db}
* @param client {import('mongodb').MongoClient}
* @returns {Promise<void>}
*/
async down(db, client) {
for await (const dataset of db
.collection("Dataset")
.find({ history: { $exists: false } })) {
console.log(`Rolling back history for dataset ${dataset._id}`);
const genericHistories = await db
.collection("History")
.find(
{ documentId: dataset._id, subsystem: "Dataset" },
{ sort: { timestamp: "desc" } },
)
.toArray();
console.log(
`Found ${genericHistories.length} history entries for dataset ${dataset._id}`,
);
dataset.$clone = () => dataset; // Mock the $clone method, as this is not a mongoose document
const obsoleteHistories = convertGenericHistoriesToObsoleteHistories(
genericHistories,
dataset,
);
console.log(
`Inserting obsolete history entries for dataset ${dataset._id}`,
);
await db
.collection("Dataset")
.updateOne(
{ _id: dataset._id },
{ $set: { history: obsoleteHistories } },
);
}
},
};
Loading