fix: remove criticality_score - #4209
Conversation
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
Pull request overview
This PR fixes Maven worker failures against production packages-db by removing all reads/writes of the non-existent criticality_score column from the Maven enrichment and DAL code paths. It also changes the Temporal schedule bootstrap behavior to skip creation when the schedule already exists (instead of delete+recreate), and adjusts Maven sync ordering to fall back to dependent_count.
Changes:
- Removed
criticalityScorefrom Maven worker upsert/touch call sites and from DAL types/queries/updates/inserts that previously referencedcriticality_score. - Updated Maven critical queue ordering to
dependent_count DESC NULLS LAST. - Changed Temporal schedule bootstrap for
maven-criticalto “skip if already exists” behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| services/libs/data-access-layer/src/osspckgs/types.ts | Removes criticalityScore from DB row/upsert types to match production schema. |
| services/libs/data-access-layer/src/osspckgs/packages.ts | Drops criticality_score from Maven sync SELECT/UPDATE/INSERT paths and changes ordering to dependent_count. |
| services/apps/packages_worker/src/maven/schedule.ts | Stops delete+recreate on ScheduleAlreadyRunning; logs and skips creation instead. |
| services/apps/packages_worker/src/maven/runMavenEnrichmentLoop.ts | Removes criticalityScore propagation in Maven enrichment loop writes/touch operations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (err instanceof ScheduleAlreadyRunning) { | ||
| // Schedule exists → delete and recreate so cron/spec changes take effect on | ||
| // restart (schedule.create is a no-op when the id exists → it would keep the old cron). | ||
| await temporal.schedule.getHandle('maven-critical').delete() | ||
| await temporal.schedule.create(scheduleOptions) | ||
| svc.log.info('Schedule maven-critical recreated (cron synced).') | ||
| svc.log.info('Schedule maven-critical already exists, skipping creation.') |
Summary
Removes criticality_score from the Maven worker code paths — the column does not exist in the production packages-db, causing an error on every activity execution. Ordering falls back to dependent_count. Also changes the Temporal schedule bootstrap to skip-if-exists instead of delete+recreate on restart.
Changes
Type of change
Note
Medium Risk
Production bug fix with behavior change: sync priority shifts from criticality to dependent_count, and schedule spec no longer auto-syncs on deploy.
Overview
Fixes Maven worker activity failures against production packages-db, which has no
criticality_scorecolumn. All reads/writes of that field are removed from the Maven enrichment loop, DAL sync queries,upsertPackage, andtouchPackageSyncedAt. Critical Maven queue ordering now usesdependent_count DESCinstead ofcriticality_score.Temporal: when
maven-criticalschedule already exists, startup logs and skips instead of delete-and-recreate, so cron/spec updates no longer apply automatically on worker restart (manual Temporal UI changes required).Reviewed by Cursor Bugbot for commit 4d657a0. Bugbot is set up for automated code reviews on this repo. Configure here.