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

Swap 3250 post dataset with explicit pid #518

Merged
merged 9 commits into from
May 25, 2023

Conversation

martin-trajanovski
Copy link
Collaborator

@martin-trajanovski martin-trajanovski commented May 24, 2023

Description

This PR aims to add the feature of creating datasets with explicit PID. There are few environmental variables introduced here and their purpose is:

  • CREATE_DATASET_WITH_PID_GROUPS, create_dataset_with_pid_groups
  • DATASET_CREATION_VALIDATION_ENABLED, dataset_creation_validation_enabled
  • DATASET_CREATION_VALIDATION_REGEX, dataset_creation_validation_regex

As a user:

If I belong to a group that is listed as admin group (ADMIN_GROUPS), I can create a dataset with explicit pid
if I belong to a group that is listed in CREATE_DATASET_WITH_PID_GROUPS, I can create a dataset with explicit pid
if I belong to a group that is listed in CREATE_DATASET_GROUPS, I can create a dataset without pid. PID is assigned by the system

In usecase 1 and 2, if pid is not provided, the system automatically assigned a uuid v4 as dataset pid.
In use case 3, pid is automatically assigned as a uuid v4.

When pid is explicitly provided, the system should check that it is unique in the database.
If DATASET_CREATION_VALIDATION_ENABLED is set to TRUE, the system should validate the pid provided using the regex provided in DATASET_CREATION_VALIDATION_REGEX.

These configuration options should have the following default values:

CREATE_DATASET_GROUPS = "all" 
CREATE_DATASET_WITH_PID_GROUPS = "" 
DATASET_CREATION_VALIDATION_ENABLED = true 
DATASET_CREATION_VALIDATION_REGEX = "^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$"  

Motivation

There was no option to create dataset with some explicit PID that is not generated by the system.

Fixes:

Changes:

  • changes made

Tests included/Docs Updated?

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)
  • Docs updated?
  • New packages used/requires npm install?
  • Toggle added for new features?

@martin-trajanovski martin-trajanovski changed the title Swap 3250 post dataaset with explicit pid Swap 3250 post dataset with explicit pid May 24, 2023
@nitrosx nitrosx merged commit c2f52fd into master May 25, 2023
@nitrosx nitrosx deleted the SWAP-3250-post-dataaset-with-explicit-pid branch May 25, 2023 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants