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

Contiguous Internal Project ID; Closes #634 #646

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

co505
Copy link

@co505 co505 commented Jan 21, 2025

Closes #634

Overview

Feature implementation of #634, an user defined internal project ID which establishes a one-to-one relationship with the project primary key to improve functionality with LDAP groups. Feature is enabled with the environment variables PROJECT_CODE and an optional PROJECT_CODE_PADDING.

Changes Made

  • Added a new project model class in models.py, titled "ProjectCode". A new database table called project_projectcode is created to avoid alterations with the preexisting project_project table.
  • Adjusted the project view.py file to create a ProjectCode object upon a form_valid response.
  • Adjusted the project view.py file to display the defined project code in the project_detail and project_list templates.
  • Added test cases for the base functionality of the project code feature.

Motovation

This feature provides a customizable layer for working with the existing project identification system. While the core project ID system remains in place, this enhancement allows HPC departments to customize how they track resource usage and project affiliations and define flexible mappings between projects and LDAP directories.

Examples

If:

PROJECT_CODE is set to EXAMP
PROJECT_CODE_PADDING is set to 3

Output would be:

EXAMP001, EXAMP002, EXAMP003, EXAMP004.

Each project code will auto-increment alongside the primary key.

And

If PROJECT_CODE is changed while in deployment to something like FEATURE and PROJECT_CODE_PADDING is set to 0

New projects will be saved as FEATURE3, FEATURE4, in case organisational dynamics change. All preexisting projects will retain the previous project code set to avoid an intrusive reconfiguration risking data integrity.

Screenshots

Database tables

image

Project List View

image

Project Detail View

image

Coldfront Configuration File

image

Future Development to do

Displaying project code in the administration portal and any other views which may be considered important.

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.

Feature: contiguous internal project ID
1 participant