Skip to content

Read Data Classification levels from ChartSegments and drop the hierarchy tables - #113

Merged
rmartinsen-ucd merged 1 commit into
mainfrom
rpm/hierarchy-from-chart-segments
Oct 21, 2026
Merged

rmartinsen-ucd merged 1 commit into
mainfrom
rpm/hierarchy-from-chart-segments

Conversation

@rmartinsen-ucd

Copy link
Copy Markdown
Contributor

Data Classification showed blank levels for nearly every code. The five hierarchy tables were seeded once from small CSVs (182 accounts, 110 funds, 39 activities, 18 purposes, 1 department), while the grid lists thousands of codes from imported transactions. On test the tables are empty, since the seed only runs in development.

ChartSegments already has what the levels need. It is refreshed on every import, every parent code resolves to a named row in the same segment, and all 349 seeded rows matched it exactly where the two overlapped. Local coverage goes from 1 to 2,886 of 2,903 departments, 182 to 2,071 of 2,078 accounts and 107 to all 1,648 funds.

Changes:

  • The Data Classification grid builds levels from ChartSegments, as OrgR Review already does. Levels are lettered A down by level, and a level that repeats the code itself is left out.
  • Department levels now come from the warehouse. The old seed made up A to C (UCD > CAES > AAES); the warehouse has UC Davis > UC Davis Campus > AAES00C.
  • The hierarchy tables, their entities, HierarchySeed and the seed CSVs are removed.
  • The pre-deployment script clears the five tables so the publish can drop them under BlockOnPossibleDataLoss. Verified on a scratch database with populated tables.
  • The dev seed keeps ERN codes and the 2025 purpose rules. Account, Fund, Activity and Department rows come from the import's SeedSegmentClassifications stage, as they do outside development.

ERN codes still have no levels, since no hierarchy exists for them.

Tests: dotnet test passes, 450 of 450, including the SQL integration tests.

🤖 Generated with Claude Code

…rchy tables

The five hierarchy tables were seeded once from small CSVs, so only a few
hundred of the thousands of imported codes had levels and the rest showed
blank in Data Classification. ChartSegments already holds every code's
parent levels from the AE warehouse, refreshed on each import, and every
parent code resolves to a named row in the same segment. Where the two
overlapped, all 349 seeded rows matched it exactly.

The grid now builds levels from ChartSegments, the way OrgR Review does,
lettered A down by level with self-repeating levels left out. The
hierarchy tables, their entities, HierarchySeed and the seed CSVs are
removed. The pre-deployment script clears the tables first so the publish
can drop them under BlockOnPossibleDataLoss.

The dev seed no longer derives Account, Fund, Activity and Department rows
from the hierarchy tables; the import seeds those. It still seeds ERN codes
and the 2025 purpose rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 112a92e9-0f63-4f33-a714-4fdccf0758e5
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@rmartinsen-ucd
rmartinsen-ucd marked this pull request as ready for review October 21, 2026 14:08

@sprucely sprucely left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Didn't fully test, having trouble getting past the PGM import. Something is slowing things down on my side.

@rmartinsen-ucd
rmartinsen-ucd merged commit 77e6e22 into main Oct 21, 2026
5 checks passed
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.

2 participants