ucb-rit / coldfront

HPC Resource Allocation System
https://coldfront.readthedocs.io
GNU General Public License v3.0
3 stars 3 forks source link

Issue 626: Support CLI and UI validation of LBL Project IDs (from cloned) #629

Closed adeng27 closed 1 month ago

adeng27 commented 1 month ago

Branched off of docker_rocky8_python10 from @matthew-li.

The following was added:

Testing

matthew-li commented 1 month ago

@adeng27 Reminder to add a check mark or something within the "Validate" button.

matthew-li commented 1 month ago

This could be an issue with my box, but perhaps you can recreate it:

In app-shell, the validation function gives:

>>> from coldfront.core.billing.utils.validation import is_billing_id_valid
>>> is_billing_id_valid("123456-789")
False
>>> is_billing_id_valid("123456-788")
True

The UI gives a response that is inconsistent with the function above (I'd expect 788 to be valid):

Screenshot 2024-07-17 at 10 51 25 AM

=====

The CLI gives the below. This is referring to the fact that there's no corresponding BillingActivity object. BillingActivity objects are only created when we want to save a particular ID to associate it with a project or user, but there are many PIDs that exist that are not saved that we might want to check the validity of.

[root@ec3c26d1175b coldfront]# python manage.py billing_ids validate 123456-788
CommandError: Billing ID 123456-788 does not exist.
[root@ec3c26d1175b coldfront]# python manage.py billing_ids validate 123456-789
CommandError: Billing ID 123456-789 does not exist.