Skip to content

Commit b125723

Browse files
Merge pull request #859 from NASA-IMPACT/857-add-status-for-minor-quality-issues
Change statuses to include delete and minor quality
2 parents db5f8a4 + d0e94f9 commit b125723

File tree

6 files changed

+153
-39
lines changed

6 files changed

+153
-39
lines changed

scripts/quality_and_indexing/add_perfect_to_prod_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
from sde_collections.models.collection import Collection
77
from sde_collections.models.collection_choice_fields import WorkflowStatusChoices
88

9-
for collection in Collection.objects.filter(workflow_status=WorkflowStatusChoices.READY_FOR_PUBLIC_PROD):
9+
for collection in Collection.objects.filter(workflow_status=WorkflowStatusChoices.QUALITY_CHECK_PERFECT):
1010
print(collection.config_folder)
1111
collection.add_to_public_query()

scripts/quality_and_indexing/change_statuses_on_webapp.py

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,54 @@
1717
READY_FOR_LRM_QUALITY_CHECK = 10, "Ready for LRM Quality Check"
1818
READY_FOR_FINAL_QUALITY_CHECK = 11, "Ready for Quality Check"
1919
QUALITY_CHECK_FAILED = 12, "Quality Check Failed"
20-
READY_FOR_PUBLIC_PROD = 13, "Ready for Public Production"
21-
PERFECT_ON_PROD = 14, "Perfect and on Production"
22-
LOW_PRIORITY_PROBLEMS_ON_PROD = 15, "Low Priority Problems on Production"
23-
HIGH_PRIORITY_PROBLEMS_ON_PROD = 16, "High Priority Problems on Production, only for old sources"
20+
QUALITY_CHECK_PERFECT = 13, "Ready for Public Production"
21+
PROD_PERFECT = 14, "Perfect and on Production"
22+
PROD_MINOR = 15, "Low Priority Problems on Production"
23+
PROD_MAJOR = 16, "High Priority Problems on Production, only for old sources"
2424
MERGE_PENDING = 17, "Code Merge Pending"
2525

2626
perfect = [
27-
# "WIND_Spacecraft",
28-
# "gamma_ray_data_tools_core_package",
29-
# "land_processes_distributed_active_archive_center",
30-
# "mdscc_deep_space_network",
31-
# "HelioAnalytics",
32-
# "nasa_infrared_telescope_facility_irtf",
33-
# "gmao_fluid",
34-
# "starchild_a_learning_center_for_young_astronomers",
35-
# "voyager_Cosmic_Ray_Subsystem",
36-
"ldas_land_data_assimilatin_system",
37-
"ppi_node",
27+
"Van_Allen_Probes",
28+
"gamma_ray_data_tools_github",
29+
"hawc_observatory",
30+
"activate_aerosol_cloud_meteorology_interactions_over_the_western_atlantic_experiment",
31+
"nasa_visible_earth",
32+
"global_sulfur_dioxide_monitoring",
33+
"Voyager_Cosmic_Ray_Subsystem",
34+
"stereo_at_gsfc",
35+
"nasa_applied_sciences",
36+
"cosmic_data_stories",
37+
"solar_terrestrial_probes_program",
38+
"atmospheric_imaging_assembly",
39+
"treasure_map",
40+
"incus_investigation_of_convective_updrafts",
41+
"airmoss_airborne_microwave_observatory_of_subcanopy_and_subsurface_at_jpl",
42+
"cii_hosted_payload_opportunity_online_database",
43+
"act_america_atmospheric_carbon_and_transport_america",
44+
"astropy",
45+
"pds_website",
46+
"astrophysics_source_code_library",
3847
]
3948

4049
low_priority = [
41-
"nasa_applied_sciences",
42-
"parker_solar_probe",
43-
"virtual_wave_observatory",
44-
"explorer_program_acquisition",
45-
"lisa_consortium",
46-
"astropy",
47-
"fermi_at_gsfc",
48-
"microobservatory_robotic_telescope_network",
50+
"nasa_arcgis_online",
51+
"physics_of_the_cosmos",
52+
"dscovr_epic_earth_polychromatic_imaging_camera",
4953
]
5054

5155
for config in perfect:
5256
print(config)
5357
collection = Collection.objects.get(config_folder=config)
54-
collection.workflow_status = WorkflowStatusChoices.PERFECT_ON_PROD
58+
collection.workflow_status = WorkflowStatusChoices.PROD_PERFECT
5559
collection.save()
5660

5761
for config in low_priority:
5862
print(config)
5963
collection = Collection.objects.get(config_folder=config)
60-
collection.workflow_status = WorkflowStatusChoices.LOW_PRIORITY_PROBLEMS_ON_PROD
64+
collection.workflow_status = WorkflowStatusChoices.PROD_MINOR
6165
collection.save()
6266

6367
# for config in perfect:
6468
# collection = Collection.objects.get(config_folder=config)
65-
# collection.workflow_status = WorkflowStatusChoices.PERFECT_ON_PROD
69+
# collection.workflow_status = WorkflowStatusChoices.PROD_PERFECT
6670
# collection.save()
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Generated by Django 4.2.9 on 2024-07-31 14:23
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("sde_collections", "0056_alter_candidateurl_document_type_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="collection",
15+
name="workflow_status",
16+
field=models.IntegerField(
17+
choices=[
18+
(1, "Research in Progress"),
19+
(2, "Ready for Engineering"),
20+
(3, "Engineering in Progress"),
21+
(4, "Ready for Curation"),
22+
(5, "Curation in Progress"),
23+
(6, "Curated"),
24+
(7, "Quality Fixed"),
25+
(8, "Secret Deployment Started"),
26+
(9, "Secret Deployment Failed"),
27+
(10, "Ready for LRM Quality Check"),
28+
(11, "Ready for Quality Check"),
29+
(12, "QC: Failed"),
30+
(18, "QC: Minor Issues"),
31+
(13, "QC: Perfect"),
32+
(14, "Prod: Perfect"),
33+
(15, "Prod: Minor Issues"),
34+
(16, "Prod: Major Issues"),
35+
(17, "Code Merge Pending"),
36+
(19, "Delete from Prod"),
37+
],
38+
default=1,
39+
),
40+
),
41+
migrations.AlterField(
42+
model_name="workflowhistory",
43+
name="old_status",
44+
field=models.IntegerField(
45+
choices=[
46+
(1, "Research in Progress"),
47+
(2, "Ready for Engineering"),
48+
(3, "Engineering in Progress"),
49+
(4, "Ready for Curation"),
50+
(5, "Curation in Progress"),
51+
(6, "Curated"),
52+
(7, "Quality Fixed"),
53+
(8, "Secret Deployment Started"),
54+
(9, "Secret Deployment Failed"),
55+
(10, "Ready for LRM Quality Check"),
56+
(11, "Ready for Quality Check"),
57+
(12, "QC: Failed"),
58+
(18, "QC: Minor Issues"),
59+
(13, "QC: Perfect"),
60+
(14, "Prod: Perfect"),
61+
(15, "Prod: Minor Issues"),
62+
(16, "Prod: Major Issues"),
63+
(17, "Code Merge Pending"),
64+
(19, "Delete from Prod"),
65+
],
66+
null=True,
67+
),
68+
),
69+
migrations.AlterField(
70+
model_name="workflowhistory",
71+
name="workflow_status",
72+
field=models.IntegerField(
73+
choices=[
74+
(1, "Research in Progress"),
75+
(2, "Ready for Engineering"),
76+
(3, "Engineering in Progress"),
77+
(4, "Ready for Curation"),
78+
(5, "Curation in Progress"),
79+
(6, "Curated"),
80+
(7, "Quality Fixed"),
81+
(8, "Secret Deployment Started"),
82+
(9, "Secret Deployment Failed"),
83+
(10, "Ready for LRM Quality Check"),
84+
(11, "Ready for Quality Check"),
85+
(12, "QC: Failed"),
86+
(18, "QC: Minor Issues"),
87+
(13, "QC: Perfect"),
88+
(14, "Prod: Perfect"),
89+
(15, "Prod: Minor Issues"),
90+
(16, "Prod: Major Issues"),
91+
(17, "Code Merge Pending"),
92+
(19, "Delete from Prod"),
93+
],
94+
default=1,
95+
),
96+
),
97+
]

sde_collections/models/collection.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ class Meta:
8484

8585
def add_to_public_query(self):
8686
"""Add the collection to the public query."""
87-
if self.workflow_status != WorkflowStatusChoices.READY_FOR_PUBLIC_PROD:
87+
if self.workflow_status not in [
88+
WorkflowStatusChoices.QUALITY_CHECK_PERFECT,
89+
WorkflowStatusChoices.QUALITY_CHECK_MINOR,
90+
]:
8891
raise ValueError(f"{self.config_folder} is not ready for public prod, you can't add it to the public query")
8992

9093
gh = GitHubHandler()
@@ -562,5 +565,8 @@ def create_configs_on_status_change(sender, instance, created, **kwargs):
562565
elif instance.workflow_status == WorkflowStatusChoices.READY_FOR_ENGINEERING:
563566
instance.create_scraper_config(overwrite=False)
564567
instance.create_indexer_config(overwrite=False)
565-
elif instance.workflow_status == WorkflowStatusChoices.READY_FOR_PUBLIC_PROD:
568+
elif instance.workflow_status in [
569+
WorkflowStatusChoices.QUALITY_CHECK_PERFECT,
570+
WorkflowStatusChoices.QUALITY_CHECK_MINOR,
571+
]:
566572
instance.add_to_public_query()

sde_collections/models/collection_choice_fields.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ class WorkflowStatusChoices(models.IntegerChoices):
8989
SECRET_DEPLOYMENT_FAILED = 9, "Secret Deployment Failed"
9090
READY_FOR_LRM_QUALITY_CHECK = 10, "Ready for LRM Quality Check"
9191
READY_FOR_FINAL_QUALITY_CHECK = 11, "Ready for Quality Check"
92-
QUALITY_CHECK_FAILED = 12, "Quality Check Failed"
93-
READY_FOR_PUBLIC_PROD = 13, "Ready for Public Production"
94-
PERFECT_ON_PROD = 14, "Perfect and on Production"
95-
LOW_PRIORITY_PROBLEMS_ON_PROD = 15, "Low Priority Problems on Production"
96-
HIGH_PRIORITY_PROBLEMS_ON_PROD = 16, "High Priority Problems on Production, only for old sources"
92+
QUALITY_CHECK_FAILED = 12, "QC: Failed"
93+
QUALITY_CHECK_MINOR = 18, "QC: Minor Issues"
94+
QUALITY_CHECK_PERFECT = 13, "QC: Perfect"
95+
PROD_PERFECT = 14, "Prod: Perfect"
96+
PROD_MINOR = 15, "Prod: Minor Issues"
97+
PROD_MAJOR = 16, "Prod: Major Issues"
9798
MERGE_PENDING = 17, "Code Merge Pending"
99+
NEEDS_DELETE = 19, "Delete from Prod"

sde_collections/utils/slack_utils.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,29 @@
5858
SLACK_ID_MAPPING["Xiang Li"],
5959
SLACK_ID_MAPPING["Shravan Vishwanathan"],
6060
SLACK_ID_MAPPING["Advait Yogaonkar"],
61+
],
62+
},
63+
(WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.QUALITY_CHECK_PERFECT): {
64+
"message": "{name} has passed all quality checks and is ready for public production! :white_check_mark:",
65+
"tags": [
6166
SLACK_ID_MAPPING["Carson Davis"],
6267
SLACK_ID_MAPPING["Bishwas Praveen"],
6368
SLACK_ID_MAPPING["Ashish Acharya"],
6469
],
6570
},
66-
(WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.READY_FOR_PUBLIC_PROD): {
67-
"message": "{name} has passed all quality checks and is ready for public production! :trophy:",
71+
(WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.QUALITY_CHECK_MINOR): {
72+
"message": "{name} has passed all quality checks and is ready for public production! :white_check_mark:",
6873
"tags": [
6974
SLACK_ID_MAPPING["Carson Davis"],
7075
SLACK_ID_MAPPING["Bishwas Praveen"],
7176
SLACK_ID_MAPPING["Ashish Acharya"],
7277
],
7378
},
74-
(WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.LOW_PRIORITY_PROBLEMS_ON_PROD): {
75-
"message": "{name} is now on Public Prod and is almost perfect, with minor issues noted. Please review! :memo:",
79+
(WorkflowStatusChoices.QUALITY_CHECK_PERFECT, WorkflowStatusChoices.PROD_PERFECT): {
80+
"message": "{name} is now live on Public Prod! Congrats team! :sparkles:",
7681
"tags": [SLACK_ID_MAPPING["channel"]],
7782
},
78-
(WorkflowStatusChoices.READY_FOR_PUBLIC_PROD, WorkflowStatusChoices.PERFECT_ON_PROD): {
83+
(WorkflowStatusChoices.QUALITY_CHECK_MINOR, WorkflowStatusChoices.PROD_MINOR): {
7984
"message": "{name} is now live on Public Prod! Congrats team! :sparkles:",
8085
"tags": [SLACK_ID_MAPPING["channel"]],
8186
},

0 commit comments

Comments
 (0)