Skip to content

chore: update pvtr plugin to ossf repo and v0.23.2 IN-986#4126

Merged
gaspergrom merged 5 commits into
mainfrom
chore/IN-986-update-pvtr-repo
Jun 4, 2026
Merged

chore: update pvtr plugin to ossf repo and v0.23.2 IN-986#4126
gaspergrom merged 5 commits into
mainfrom
chore/IN-986-update-pvtr-repo

Conversation

@gaspergrom
Copy link
Copy Markdown
Contributor

@gaspergrom gaspergrom commented May 18, 2026

Summary

Updates the pvtr GitHub repo scanner plugin from the old revanite-io/pvtr-github-repo repo to the new canonical location at ossf/pvtr-github-repo-scanner, and bumps the version to v0.23.2. Also updates the catalog ID and CATALOG_ID constant from the deprecated OSPS_B to osps-baseline-2026-02.

Changes

  • Dockerfile.security_best_practices_worker: updated clone URL to ossf/pvtr-github-repo-scanner, updated commit hash to v0.23.2 (c7bd9538)
  • example-config.yml: catalog OSPS_Bosps-baseline-2026-02
  • activities/index.ts: CATALOG_ID constant 'OSPS_B''osps-baseline-2026-02'

Type of change

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

JIRA ticket

https://linuxfoundation.atlassian.net/browse/IN-986


Note

Medium Risk
Catalog ID migration and scanner swap affect how OSPS baseline results are stored and matched; suite-scoped lookups reduce wrong-row joins but deploy must run the migration with the worker image update.

Overview
Moves the security best practices worker to the OSSF pvtr-github-repo-scanner plugin at v0.23.2 (new commit, Go 1.26.3 image) and aligns Privateer policy with catalog osps-baseline-2026-02 instead of OSPS_B.

A Flyway migration rewrites existing securityInsightsEvaluationSuites.catalogId values; the worker’s CATALOG_ID and example config match the new id. findSuiteControlEvaluation can filter by securityInsightsEvaluationSuiteId, and persistence now passes suite.id so assessments attach to the correct suite after the catalog rename.

Reviewed by Cursor Bugbot for commit c84ee25. Bugbot is set up for automated code reviews on this repo. Configure here.

@gaspergrom gaspergrom requested a review from joanagmaia May 18, 2026 13:17
@gaspergrom gaspergrom self-assigned this May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 13:17
@gaspergrom gaspergrom force-pushed the chore/IN-986-update-pvtr-repo branch from 3c25713 to 81f9624 Compare May 18, 2026 13:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the security best practices worker to use the canonical OSSF PVTR GitHub repo scanner and the newer OSPS baseline catalog ID.

Changes:

  • Bumps the PVTR plugin source repository and pinned commit to v0.23.2.
  • Updates the Privateer example config catalog from OSPS_B to osps-baseline-2026-02.
  • Updates the worker’s saved evaluation-suite lookup catalog ID accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
services/apps/security_best_practices_worker/src/activities/index.ts Updates the catalog ID used when selecting the evaluation suite to persist.
services/apps/security_best_practices_worker/example-config.yml Updates the configured catalog passed to Privateer/PVTR.
scripts/services/docker/Dockerfile.security_best_practices_worker Switches plugin clone/build source to the OSSF scanner repo and pinned commit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gaspergrom gaspergrom force-pushed the chore/IN-986-update-pvtr-repo branch from 81f9624 to 35a0e22 Compare May 18, 2026 13:18
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
@gaspergrom gaspergrom force-pushed the chore/IN-986-update-pvtr-repo branch from 35a0e22 to 02ba949 Compare May 18, 2026 13:19
…tibility (IN-986)

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI review requested due to automatic review settings May 18, 2026 13:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

… row error (IN-986)

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
@gaspergrom
Copy link
Copy Markdown
Contributor Author

Addressed the duplicate row issue flagged by cursor[bot].

When a repo was previously scanned with the old OSPS_B catalog, control evaluation rows exist in the DB tied to the old suite. After this update, a rescan creates a new suite (different catalogId) and inserts new control evaluations under it. Because findSuiteControlEvaluation queried only by (repo, controlId) with no suite filter, it would find both old and new rows and oneOrNone would throw "Multiple rows were not expected".

Fix: added an optional suiteId parameter to findSuiteControlEvaluation and pass suite.id at the call site, so the query only matches rows from the current scan's suite. Backward compatible — existing callers without the parameter are unaffected.

Copy link
Copy Markdown
Collaborator

@epipav epipav left a comment

Choose a reason for hiding this comment

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

Looks good. One thing we can do to prevent duplicate evaluations and assessments is to update the existing catalogId to the new value in a migration

  UPDATE "securityInsightsEvaluationSuites"                                                                                                                                                                                                   
  SET "catalogId" = 'osps-baseline-2026-02'                                                                                                                                                                                                   
  WHERE "catalogId" = 'OSPS_B'; 

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copilot AI review requested due to automatic review settings June 4, 2026 06:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

@@ -0,0 +1,3 @@
UPDATE "securityInsightsEvaluationSuites"
SET "catalogId" = 'osps-baseline-2026-02'
WHERE "catalogId" = 'OSPS_B';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Migration hits unique constraint

High Severity

The catalog rename UPDATE can fail when a repo already has a securityInsightsEvaluationSuites row with osps-baseline-2026-02 from a rescan on the new worker, while an older row still has OSPS_B. Renaming the legacy row duplicates (repo, catalogId) and violates the table unique constraint, blocking the migration.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 125d6c7. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c84ee25. Configure here.

repo: ISecurityInsightsObsoleteRepo,
): Promise<void> {
const CATALOG_ID = 'OSPS_B'
const CATALOG_ID = 'osps-baseline-2026-02'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Save ignores legacy catalog scans

Medium Severity

saveOSPSBaselineInsightsToDB only selects the evaluation suite matching osps-baseline-2026-02. Redis payloads from scans still using OSPS_B leave evaluationSuite undefined, and the next property access throws at runtime.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c84ee25. Configure here.

@gaspergrom gaspergrom merged commit 9f85ea3 into main Jun 4, 2026
15 checks passed
@gaspergrom gaspergrom deleted the chore/IN-986-update-pvtr-repo branch June 4, 2026 08:17
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.

4 participants