Skip to content

fix: remove criticality_score#4209

Merged
ulemons merged 1 commit into
mainfrom
fix/maven-update-schema
Jun 15, 2026
Merged

fix: remove criticality_score#4209
ulemons merged 1 commit into
mainfrom
fix/maven-update-schema

Conversation

@ulemons

@ulemons ulemons commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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

  • runMavenEnrichmentLoop.ts — removed criticalityScore from all upsertPackage and touchPackageSyncedAt call sites (6 occurrences)
  • packages.ts — removed criticality_score from listMavenPackagesToSync SELECT, changed ORDER BY to dependent_count DESC, removed from touchPackageSyncedAt UPDATE and upsertPackage INSERT/ON CONFLICT
  • types.ts — removed criticalityScore from IDbPackageUniverse and IDbPackageUpsert
  • schedule.ts — on ScheduleAlreadyRunning, skip instead of delete+recreate; schedule changes must now be applied manually via Temporal UI

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Performance improvement
  • Chore / dependency update
  • Documentation

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_score column. All reads/writes of that field are removed from the Maven enrichment loop, DAL sync queries, upsertPackage, and touchPackageSyncedAt. Critical Maven queue ordering now uses dependent_count DESC instead of criticality_score.

Temporal: when maven-critical schedule 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.

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons ulemons self-assigned this Jun 15, 2026
Copilot AI review requested due to automatic review settings June 15, 2026 07:47
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 criticalityScore from Maven worker upsert/touch call sites and from DAL types/queries/updates/inserts that previously referenced criticality_score.
  • Updated Maven critical queue ordering to dependent_count DESC NULLS LAST.
  • Changed Temporal schedule bootstrap for maven-critical to “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.

Comment on lines 36 to +37
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.')
@ulemons
ulemons merged commit 72eef8d into main Jun 15, 2026
20 checks passed
@ulemons
ulemons deleted the fix/maven-update-schema branch June 15, 2026 08:02
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.

3 participants