Skip to content

Conversation

@martin-trajanovski
Copy link
Collaborator

@martin-trajanovski martin-trajanovski commented Apr 24, 2025

Description

This PR aims to provide a migration script for datasets properties that were overwritten by a bug that was found and fixed in the code.

Motivation

size, numberOfFiles, packedSize and numberOfFilesArchived were all overwritten by a bug in the code and those needed to be fixed.

Fixes

Changes:

  • Added new mongo migration script

Tests included

  • Included for each change/fix?
  • Passing?

Documentation

  • swagger documentation updated (required for API changes)
  • official documentation updated

official documentation info

@martin-trajanovski martin-trajanovski marked this pull request as ready for review April 24, 2025 10:28
@martin-trajanovski martin-trajanovski added bug Something isn't working DCS DAPHNE Contribution to SciCat labels Apr 24, 2025
0,
);

const datasetSizeSum = origDatablockSizeSum + datablockSizeSum;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that this is the way that it is calculated?
I think that the dataset total size is the sum of the size of the files listed in the origDatablock

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you see this line for example on the creation of origDatablock: https://github.com/SciCatProject/scicat-backend-next/blob/master/src/datasets/datasets.controller.ts#L1945
Or this line in the update: https://github.com/SciCatProject/scicat-backend-next/blob/master/src/datasets/datasets.controller.ts#L2101
We can see that the size it is used and not the sum of the files listed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. You are correct.
Let's resolve this conversation, and bring the discussion to the collaborators

Copy link
Member

@Junjiequan Junjiequan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine to me

@martin-trajanovski
Copy link
Collaborator Author

@nitrosx let me know what are your final thoughts about this one. As I know you left some comments before.

@Junjiequan Junjiequan force-pushed the SWAP-4629-fix-affected-dataset-with-size-0 branch from bc2a991 to 1e24dae Compare May 21, 2025 12:11
@martin-trajanovski martin-trajanovski merged commit 238af84 into master May 22, 2025
13 checks passed
@martin-trajanovski martin-trajanovski deleted the SWAP-4629-fix-affected-dataset-with-size-0 branch May 22, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working DCS DAPHNE Contribution to SciCat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants