SciCatProject / SciCatProject/backend

Use config object in Dataset controller

Open
#701 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
27
Forks
37
Avg merge
17h 32m
Merged PRs (30d)
38

Description

Summary

Currently in datasets controller, we retrieve the values for the following variable directly from process.env:

  • CREATE_DATASET_WITH_PID_GROUPS
  • DATASET_CREATION_VALIDATION_ENABLED
  • DATASET_CREATION_VALIDATION_REGEX
  • ADMIN_GROUPS

For consistency sake, we should use the config object, which use the env variables, but also allows a facility to further customize the configuration directly in code if env variables are not enough for their use case.

Expected Behaviour

datasets.controller import config object and use equivalent values in there.
Config object pulls in the equivalent env variable value if they are configured, or use the default one hardcoded.

Extra Details

Changes in Dataset.controller should be done at the following location:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/datasets/datasets.controller.ts at the referenced lines and inspect the existing config object for equivalents of the four process.env variables: CREATE_DATASET_WITH_PID_GROUPS, DATASET_CREATION_VALIDATION_ENABLED, DATASET_CREATION_VALIDATION_REGEX, and ADMIN_GROUPS. Update the controller to use those config values, preserving configured environment values and defaults; done means no direct environment reads remain for these settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.