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

Change statuses to include delete and minor quality #859

Merged
merged 3 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/quality_and_indexing/add_perfect_to_prod_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
from sde_collections.models.collection import Collection
from sde_collections.models.collection_choice_fields import WorkflowStatusChoices

for collection in Collection.objects.filter(workflow_status=WorkflowStatusChoices.READY_FOR_PUBLIC_PROD):
for collection in Collection.objects.filter(workflow_status=WorkflowStatusChoices.QUALITY_CHECK_PERFECT):
print(collection.config_folder)
collection.add_to_public_query()
56 changes: 30 additions & 26 deletions scripts/quality_and_indexing/change_statuses_on_webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,54 @@
READY_FOR_LRM_QUALITY_CHECK = 10, "Ready for LRM Quality Check"
READY_FOR_FINAL_QUALITY_CHECK = 11, "Ready for Quality Check"
QUALITY_CHECK_FAILED = 12, "Quality Check Failed"
READY_FOR_PUBLIC_PROD = 13, "Ready for Public Production"
PERFECT_ON_PROD = 14, "Perfect and on Production"
LOW_PRIORITY_PROBLEMS_ON_PROD = 15, "Low Priority Problems on Production"
HIGH_PRIORITY_PROBLEMS_ON_PROD = 16, "High Priority Problems on Production, only for old sources"
QUALITY_CHECK_PERFECT = 13, "Ready for Public Production"
PROD_PERFECT = 14, "Perfect and on Production"
PROD_MINOR = 15, "Low Priority Problems on Production"
PROD_MAJOR = 16, "High Priority Problems on Production, only for old sources"
MERGE_PENDING = 17, "Code Merge Pending"

perfect = [
# "WIND_Spacecraft",
# "gamma_ray_data_tools_core_package",
# "land_processes_distributed_active_archive_center",
# "mdscc_deep_space_network",
# "HelioAnalytics",
# "nasa_infrared_telescope_facility_irtf",
# "gmao_fluid",
# "starchild_a_learning_center_for_young_astronomers",
# "voyager_Cosmic_Ray_Subsystem",
"ldas_land_data_assimilatin_system",
"ppi_node",
"Van_Allen_Probes",
"gamma_ray_data_tools_github",
"hawc_observatory",
"activate_aerosol_cloud_meteorology_interactions_over_the_western_atlantic_experiment",
"nasa_visible_earth",
"global_sulfur_dioxide_monitoring",
"Voyager_Cosmic_Ray_Subsystem",
"stereo_at_gsfc",
"nasa_applied_sciences",
"cosmic_data_stories",
"solar_terrestrial_probes_program",
"atmospheric_imaging_assembly",
"treasure_map",
"incus_investigation_of_convective_updrafts",
"airmoss_airborne_microwave_observatory_of_subcanopy_and_subsurface_at_jpl",
"cii_hosted_payload_opportunity_online_database",
"act_america_atmospheric_carbon_and_transport_america",
"astropy",
"pds_website",
"astrophysics_source_code_library",
]

low_priority = [
"nasa_applied_sciences",
"parker_solar_probe",
"virtual_wave_observatory",
"explorer_program_acquisition",
"lisa_consortium",
"astropy",
"fermi_at_gsfc",
"microobservatory_robotic_telescope_network",
"nasa_arcgis_online",
"physics_of_the_cosmos",
"dscovr_epic_earth_polychromatic_imaging_camera",
]

for config in perfect:
print(config)
collection = Collection.objects.get(config_folder=config)
collection.workflow_status = WorkflowStatusChoices.PERFECT_ON_PROD
collection.workflow_status = WorkflowStatusChoices.PROD_PERFECT
collection.save()

for config in low_priority:
print(config)
collection = Collection.objects.get(config_folder=config)
collection.workflow_status = WorkflowStatusChoices.LOW_PRIORITY_PROBLEMS_ON_PROD
collection.workflow_status = WorkflowStatusChoices.PROD_MINOR
collection.save()

# for config in perfect:
# collection = Collection.objects.get(config_folder=config)
# collection.workflow_status = WorkflowStatusChoices.PERFECT_ON_PROD
# collection.workflow_status = WorkflowStatusChoices.PROD_PERFECT
# collection.save()
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Generated by Django 4.2.9 on 2024-06-18 15:53

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("sde_collections", "0055_alter_workflowhistory_old_status_and_more"),
]

operations = [
migrations.AlterField(
model_name="collection",
name="workflow_status",
field=models.IntegerField(
choices=[
(1, "Research in Progress"),
(2, "Ready for Engineering"),
(3, "Engineering in Progress"),
(4, "Ready for Curation"),
(5, "Curation in Progress"),
(6, "Curated"),
(7, "Quality Fixed"),
(8, "Secret Deployment Started"),
(9, "Secret Deployment Failed"),
(10, "Ready for LRM Quality Check"),
(11, "Ready for Quality Check"),
(12, "QC: Failed"),
(18, "QC: Minor Issues"),
(13, "QC: Perfect"),
(14, "Prod: Perfect"),
(15, "Prod: Minor Issues"),
(16, "Prod: Major Issues"),
(17, "Code Merge Pending"),
(19, "Delete from Prod"),
],
default=1,
),
),
migrations.AlterField(
model_name="workflowhistory",
name="old_status",
field=models.IntegerField(
choices=[
(1, "Research in Progress"),
(2, "Ready for Engineering"),
(3, "Engineering in Progress"),
(4, "Ready for Curation"),
(5, "Curation in Progress"),
(6, "Curated"),
(7, "Quality Fixed"),
(8, "Secret Deployment Started"),
(9, "Secret Deployment Failed"),
(10, "Ready for LRM Quality Check"),
(11, "Ready for Quality Check"),
(12, "QC: Failed"),
(18, "QC: Minor Issues"),
(13, "QC: Perfect"),
(14, "Prod: Perfect"),
(15, "Prod: Minor Issues"),
(16, "Prod: Major Issues"),
(17, "Code Merge Pending"),
(19, "Delete from Prod"),
],
null=True,
),
),
migrations.AlterField(
model_name="workflowhistory",
name="workflow_status",
field=models.IntegerField(
choices=[
(1, "Research in Progress"),
(2, "Ready for Engineering"),
(3, "Engineering in Progress"),
(4, "Ready for Curation"),
(5, "Curation in Progress"),
(6, "Curated"),
(7, "Quality Fixed"),
(8, "Secret Deployment Started"),
(9, "Secret Deployment Failed"),
(10, "Ready for LRM Quality Check"),
(11, "Ready for Quality Check"),
(12, "QC: Failed"),
(18, "QC: Minor Issues"),
(13, "QC: Perfect"),
(14, "Prod: Perfect"),
(15, "Prod: Minor Issues"),
(16, "Prod: Major Issues"),
(17, "Code Merge Pending"),
(19, "Delete from Prod"),
],
default=1,
),
),
]
10 changes: 8 additions & 2 deletions sde_collections/models/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ class Meta:

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

gh = GitHubHandler()
Expand Down Expand Up @@ -562,5 +565,8 @@ def create_configs_on_status_change(sender, instance, created, **kwargs):
elif instance.workflow_status == WorkflowStatusChoices.READY_FOR_ENGINEERING:
instance.create_scraper_config(overwrite=False)
instance.create_indexer_config(overwrite=False)
elif instance.workflow_status == WorkflowStatusChoices.READY_FOR_PUBLIC_PROD:
elif instance.workflow_status in [
WorkflowStatusChoices.QUALITY_CHECK_PERFECT,
WorkflowStatusChoices.QUALITY_CHECK_MINOR,
]:
instance.add_to_public_query()
12 changes: 7 additions & 5 deletions sde_collections/models/collection_choice_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ class WorkflowStatusChoices(models.IntegerChoices):
SECRET_DEPLOYMENT_FAILED = 9, "Secret Deployment Failed"
READY_FOR_LRM_QUALITY_CHECK = 10, "Ready for LRM Quality Check"
READY_FOR_FINAL_QUALITY_CHECK = 11, "Ready for Quality Check"
QUALITY_CHECK_FAILED = 12, "Quality Check Failed"
READY_FOR_PUBLIC_PROD = 13, "Ready for Public Production"
PERFECT_ON_PROD = 14, "Perfect and on Production"
LOW_PRIORITY_PROBLEMS_ON_PROD = 15, "Low Priority Problems on Production"
HIGH_PRIORITY_PROBLEMS_ON_PROD = 16, "High Priority Problems on Production, only for old sources"
QUALITY_CHECK_FAILED = 12, "QC: Failed"
QUALITY_CHECK_MINOR = 18, "QC: Minor Issues"
QUALITY_CHECK_PERFECT = 13, "QC: Perfect"
PROD_PERFECT = 14, "Prod: Perfect"
PROD_MINOR = 15, "Prod: Minor Issues"
PROD_MAJOR = 16, "Prod: Major Issues"
MERGE_PENDING = 17, "Code Merge Pending"
NEEDS_DELETE = 19, "Delete from Prod"
15 changes: 10 additions & 5 deletions sde_collections/utils/slack_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,29 @@
SLACK_ID_MAPPING["Xiang Li"],
SLACK_ID_MAPPING["Shravan Vishwanathan"],
SLACK_ID_MAPPING["Advait Yogaonkar"],
],
},
(WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.QUALITY_CHECK_PERFECT): {
"message": "{name} has passed all quality checks and is ready for public production! :white_check_mark:",
"tags": [
SLACK_ID_MAPPING["Carson Davis"],
SLACK_ID_MAPPING["Bishwas Praveen"],
SLACK_ID_MAPPING["Ashish Acharya"],
],
},
(WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.READY_FOR_PUBLIC_PROD): {
"message": "{name} has passed all quality checks and is ready for public production! :trophy:",
(WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.QUALITY_CHECK_MINOR): {
"message": "{name} has passed all quality checks and is ready for public production! :white_check_mark:",
"tags": [
SLACK_ID_MAPPING["Carson Davis"],
SLACK_ID_MAPPING["Bishwas Praveen"],
SLACK_ID_MAPPING["Ashish Acharya"],
],
},
(WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.LOW_PRIORITY_PROBLEMS_ON_PROD): {
"message": "{name} is now on Public Prod and is almost perfect, with minor issues noted. Please review! :memo:",
(WorkflowStatusChoices.QUALITY_CHECK_PERFECT, WorkflowStatusChoices.PROD_PERFECT): {
"message": "{name} is now live on Public Prod! Congrats team! :sparkles:",
"tags": [SLACK_ID_MAPPING["channel"]],
},
(WorkflowStatusChoices.READY_FOR_PUBLIC_PROD, WorkflowStatusChoices.PERFECT_ON_PROD): {
(WorkflowStatusChoices.QUALITY_CHECK_MINOR, WorkflowStatusChoices.PROD_MINOR): {
"message": "{name} is now live on Public Prod! Congrats team! :sparkles:",
"tags": [SLACK_ID_MAPPING["channel"]],
},
Expand Down