Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1d4dddd
feat: consolidate backfill scripts and update transfer logic for lega…
jirhiker Jan 10, 2026
e5b697e
feat: add ERD generation script and initial schema visualization
jirhiker Jan 10, 2026
2980c6d
feat: enhance ERD generation with detailed column types and constraints
jirhiker Jan 10, 2026
cc570b1
feat: implement robust GCS blob download and upload functions with re…
jirhiker Jan 11, 2026
e4b0dfb
feat: implement initial migration with schema creation and smoke test
jirhiker Jan 11, 2026
d0a39ec
Potential fix for code scanning alert no. 12: Clear-text logging of s…
jirhiker Jan 11, 2026
f016719
Formatting changes
jirhiker Jan 11, 2026
de54605
Update transfers/util.py
jirhiker Jan 11, 2026
194a20a
feat: improve JSON blob download and elevation conversion logic with …
jirhiker Jan 11, 2026
eea5aa7
feat: enhance initial migration with sequence and function creation, …
jirhiker Jan 11, 2026
167191f
feat: enhance run_backfill.sh with detailed comments on backfill proc…
jirhiker Jan 12, 2026
ef5705b
feat: refactor field definitions in various models for consistency an…
jirhiker Jan 13, 2026
7d21dea
feat: update collected_by field in test_chemistry_sampleinfo_legacy f…
jirhiker Jan 13, 2026
7f9ced2
feat: standardize parameter ID retrieval and improve field consistenc…
jirhiker Jan 13, 2026
4829579
update initial migration script
jirhiker Jan 13, 2026
2da3080
Merge branch 'staging' into consolidate-backfill-transfers
jirhiker Jan 13, 2026
8efba52
feat: add thing_id foreign key to NMA_Chemistry_SampleInfo and update…
jirhiker Jan 13, 2026
4d5245f
Update transfers/util.py
jirhiker Jan 13, 2026
744db5d
feat: update NMA_MinorTraceChemistry to use UUID for foreign key and …
jirhiker Jan 13, 2026
f09fe64
feat: replace print statements with logging for improved warning mana…
jirhiker Jan 13, 2026
042a3bb
feat: improve data handling and logging in various modules
jirhiker Jan 13, 2026
a645885
Potential fix for code scanning alert no. 14: Clear-text logging of s…
jirhiker Jan 13, 2026
624dae4
Update transfers/backfill/backfill.py
jirhiker Jan 13, 2026
0397f1c
feat: remove unused list fields and field labels from various models …
jirhiker Jan 13, 2026
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
12 changes: 0 additions & 12 deletions .github/workflows/CD_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ jobs:
run: |
uv run alembic upgrade head

- name: Run backfill script on production database
env:
DB_DRIVER: "cloudsql"
CLOUD_SQL_INSTANCE_NAME: "${{ secrets.CLOUD_SQL_INSTANCE_NAME }}"
CLOUD_SQL_DATABASE: "${{ vars.CLOUD_SQL_DATABASE }}"
CLOUD_SQL_USER: "${{ secrets.CLOUD_SQL_USER }}"
CLOUD_SQL_IAM_AUTH: true
GCS_SERVICE_ACCOUNT_KEY: "${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}"
GCS_BUCKET_NAME: "${{ vars.GCS_BUCKET_NAME }}"
run: |
uv run python -m transfers.backfill.backfill

- name: Create app.yaml
run: |
cat <<EOF > app.yaml
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/CD_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ jobs:
run: |
uv run alembic upgrade head

- name: Run backfill script on staging database
env:
DB_DRIVER: "cloudsql"
CLOUD_SQL_INSTANCE_NAME: "${{ secrets.CLOUD_SQL_INSTANCE_NAME }}"
CLOUD_SQL_DATABASE: "${{ vars.CLOUD_SQL_DATABASE }}"
CLOUD_SQL_USER: "${{ secrets.CLOUD_SQL_USER }}"
CLOUD_SQL_IAM_AUTH: true
GCS_SERVICE_ACCOUNT_KEY: "${{ secrets.GCS_SERVICE_ACCOUNT_KEY }}"
GCS_BUCKET_NAME: "${{ vars.GCS_BUCKET_NAME }}"
run: |
uv run python -m transfers.backfill.backfill

# Uses Google Cloud Secret Manager to store secret credentials
- name: Create app.yaml
run: |
Expand Down
34 changes: 3 additions & 31 deletions admin/views/aquifer_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,42 +33,26 @@ class AquiferSystemAdmin(OcotilloModelView):

# ========== List View ==========

column_list = [
sortable_fields = [
"id",
"name",
"primary_aquifer_type",
"geographic_scale",
"release_status",
"created_at",
"updated_by_name",
]

column_sortable_list = [
"id",
"name",
"primary_aquifer_type",
"geographic_scale",
"release_status",
"created_at",
]

column_default_sort = ("name", False)
fields_default_sort = [("name", False)]

search_fields = [
searchable_fields = [
"name",
"description",
]

column_filters = [
"primary_aquifer_type",
"geographic_scale",
"release_status",
"created_at",
]

can_export = True
export_types = ["csv", "excel"]

page_size = 50
page_size_options = [25, 50, 100, 200]

Expand Down Expand Up @@ -105,17 +89,5 @@ class AquiferSystemAdmin(OcotilloModelView):
"created_by_name",
]

labels = {
"id": "Aquifer System ID",
"name": "Name",
"description": "Description",
"primary_aquifer_type": "Primary Aquifer Type",
"geographic_scale": "Geographic Scale",
"release_status": "Release Status",
"created_at": "Created At",
"created_by_name": "Created By",
"updated_by_name": "Updated By",
}


# ============= EOF =============================================
32 changes: 3 additions & 29 deletions admin/views/aquifer_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,38 +32,22 @@ class AquiferTypeAdmin(OcotilloModelView):

# ========== List View ==========

column_list = [
sortable_fields = [
"id",
"thing_aquifer_association_id",
"aquifer_type",
"release_status",
"created_at",
"updated_by_name",
]

column_sortable_list = [
"id",
"thing_aquifer_association_id",
"aquifer_type",
"release_status",
"created_at",
]
fields_default_sort = [("created_at", True)]

column_default_sort = ("created_at", True)

search_fields = [
"aquifer_type",
]

column_filters = [
searchable_fields = [
"aquifer_type",
"release_status",
"created_at",
]

can_export = True
export_types = ["csv", "excel"]

page_size = 50
page_size_options = [25, 50, 100, 200]

Expand Down Expand Up @@ -97,15 +81,5 @@ class AquiferTypeAdmin(OcotilloModelView):
"created_by_name",
]

labels = {
"id": "Aquifer Type ID",
"thing_aquifer_association_id": "Thing-Aquifer Association",
"aquifer_type": "Aquifer Type",
"release_status": "Release Status",
"created_at": "Created At",
"created_by_name": "Created By",
"updated_by_name": "Updated By",
}


# ============= EOF =============================================
41 changes: 3 additions & 38 deletions admin/views/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,49 +34,29 @@ class AssetAdmin(OcotilloModelView):

# ========== List View ==========

column_list = [
sortable_fields = [
"id",
"name",
"label",
"mime_type",
"storage_service",
"size",
"release_status",
"created_at",
"updated_by_name",
]

column_sortable_list = [
"id",
"name",
"mime_type",
"storage_service",
"size",
"release_status",
"created_at",
]

column_default_sort = ("created_at", True)
fields_default_sort = [("created_at", True)]

search_fields = [
searchable_fields = [
"name",
"label",
"mime_type",
"storage_service",
"storage_path",
"uri",
]

column_filters = [
"mime_type",
"storage_service",
"release_status",
"created_at",
]

can_export = True
export_types = ["csv", "excel"]

page_size = 50
page_size_options = [25, 50, 100, 200]

Expand Down Expand Up @@ -115,20 +95,5 @@ class AssetAdmin(OcotilloModelView):
"created_by_name",
]

labels = {
"id": "Asset ID",
"name": "Name",
"label": "Label",
"storage_service": "Storage Service",
"storage_path": "Storage Path",
"mime_type": "MIME Type",
"size": "Size (bytes)",
"uri": "URI",
"release_status": "Release Status",
"created_at": "Created At",
"created_by_name": "Created By",
"updated_by_name": "Updated By",
}


# ============= EOF =============================================
8 changes: 6 additions & 2 deletions admin/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
# ===============================================================================
from __future__ import annotations

from typing import Any, Iterable
from typing import Any, Iterable, Sequence

from sqlalchemy import select, update
from starlette.requests import Request
from starlette.responses import Response
from starlette_admin import action
from starlette_admin import ExportType, action
from starlette_admin.contrib.sqla import ModelView

from db.engine import session_ctx
Expand All @@ -39,6 +39,10 @@ class OcotilloModelView(ModelView):
draft_value = "draft"
published_value = "published"
enable_publish_actions: bool = True
export_types: Sequence[ExportType] = (ExportType.CSV, ExportType.EXCEL)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

# ========= Permissions (RBAC) =========
def _get_user(self, request: Request) -> Any:
Expand Down
49 changes: 5 additions & 44 deletions admin/views/chemistry_sampleinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,10 @@ class ChemistrySampleInfoAdmin(OcotilloModelView):

# ========== List View ==========

column_list = [
"object_id",
"sample_point_id",
sortable_fields = [
"sample_pt_id",
"wclab_id",
"collection_date",
"sample_type",
"data_source",
"data_quality",
"public_release",
]

column_sortable_list = [
"object_id",
"sample_point_id",
"sample_pt_id",
"wclab_id",
"collection_date",
"sample_type",
Expand All @@ -56,18 +44,15 @@ class ChemistrySampleInfoAdmin(OcotilloModelView):
"public_release",
]

column_default_sort = ("collection_date", True)
fields_default_sort = [("collection_date", True)]

search_fields = [
searchable_fields = [
"sample_point_id",
"sample_pt_id",
"wclab_id",
"collected_by",
"analyses_agency",
"sample_notes",
]

column_filters = [
"collection_date",
"sample_type",
"sample_material_not_h2o",
Expand All @@ -78,18 +63,15 @@ class ChemistrySampleInfoAdmin(OcotilloModelView):
"public_release",
]

can_export = True
export_types = ["csv", "excel"]

page_size = 50
page_size_options = [25, 50, 100, 200]

# ========== Form View ==========

fields = [
"object_id",
"sample_point_id",
"sample_pt_id",
"sample_point_id",
"object_id",
"wclab_id",
"collection_date",
"collection_method",
Expand All @@ -115,26 +97,5 @@ class ChemistrySampleInfoAdmin(OcotilloModelView):
"object_id",
]

labels = {
"object_id": "OBJECTID",
"sample_point_id": "SamplePointID",
"sample_pt_id": "SamplePtID",
"wclab_id": "WCLab ID",
"collection_date": "Collection Date",
"collection_method": "Collection Method",
"collected_by": "Collected By",
"analyses_agency": "Analyses Agency",
"sample_type": "Sample Type",
"sample_material_not_h2o": "Sample Material Not H2O",
"water_type": "Water Type",
"study_sample": "Study Sample",
"data_source": "Data Source",
"data_quality": "Data Quality",
"public_release": "Public Release",
"added_day_to_date": "Added Day to Date",
"added_month_day_to_date": "Added Month Day to Date",
"sample_notes": "Sample Notes",
}


# ============= EOF =============================================
Loading
Loading