Skip to content

feat: record the pcc projects whose creation is blocked - #5446

Merged
ulemons merged 1 commit into
mainfrom
feat/issue-180-pcc-record-blocked-creations
Nov 25, 2026
Merged

ulemons merged 1 commit into
mainfrom
feat/issue-180-pcc-record-blocked-creations

Conversation

@ulemons

@ulemons ulemons commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

What

A missing PCC project that the sync cannot create because CDP and PCC disagree is now recorded in pcc_projects_sync_errors as PROJECT_CREATION_BLOCKED, with the reason and the CDP segments in the way.

Until now these projects were only counted in the PCC job completed log line, so there was no list to review.

Behaviour

  • One row per blocked PCC project, refreshed at every run.
  • The row is resolved by the existing sweep once the project is no longer reported as blocked.
  • Recorded whatever the value of PCC_PROJECT_CREATION: the list is useful also while creation is off.
  • Nothing changes in what gets created.

Testing

Unit tests in missingProjectCreation.test.ts.

Refs linuxfoundation/lfx-cdp-insights-ops#180

🤖 Generated with Claude Code

@ulemons
ulemons requested review from a team and lfx-one as code owners November 25, 2026 15:25
@ulemons
ulemons requested a review from mbani01 November 25, 2026 15:25
@ulemons ulemons self-assigned this Nov 25, 2026
Copilot AI balanced review requested due to automatic review settings November 25, 2026 15:25
@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Observability-only: adds sync-error rows for already-blocked projects; creation behavior is unchanged.

Overview
PCC projects that are missing in CDP but cannot be auto-created (CDP/PCC disagreement) are now written to pcc_projects_sync_errors as PROJECT_CREATION_BLOCKED, with project name, block reason, and plan details (e.g. conflicting CDP segments).

A new describeBlockedCreation helper builds that payload when the creation plan is BLOCKED; the consumer records it during SKIPPED handling alongside the existing creation summary—without changing what actually gets created.

Unit tests cover blocked, incomplete PCC data, and creatable (no-op) cases.

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

@lfx-one

lfx-one commented Nov 25, 2026 •

Copy link
Copy Markdown

@ulemons I'm starting review 1 of this pull request now (started 2026-11-25 15:25 UTC using review agent v0.1.34). This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by re-review, to start another. For help with the review agent, see https://github.com/linuxfoundation/lfx-review-agent/issues.


Hi @ulemons, thanks for the PR.

Summary

This pull request records each PCC project whose creation is blocked as a PROJECT_CREATION_BLOCKED sync error, with the reason and the CDP segments in the way. It reuses the existing sync-error upsert and resolve sweep, and it leaves what gets created unchanged. The change is small and well tested.

Decision

✅ Approved

Details

Overall impression: The change adds one helper, describeBlockedCreation, and one call to the existing recordSyncError in the consumer. The upsert keys on (external_project_id, error_type) among unresolved rows, so each blocked project keeps one row and the row is refreshed on each run. The existing resolveSyncErrorsNotReportedBy sweep resolves it once the project is no longer blocked, because PROJECT_CREATION_BLOCKED is not in the kept list. Writes are skipped in dry-run mode and happen whatever PCC_PROJECT_CREATION is set to, as the description says. The three new unit tests cover the blocked, incomplete-data and creatable cases.

Other reviewers and CI checks: Cursor Bugbot's summary agrees: low risk, with no change to what gets created. The required DCO check passed on ec48486.

Documentation reminder: changed PROJECT_CREATION_BLOCKED. Please check product pages and external docs; the author and maintainers own those updates.

Rule files: read AGENTS.md; skipped none

Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues

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.

🟢 Approval recommended

There are no active review issues for the blocked-project sync-error reporting change.

No open issues 🎉

What changed in this PR

This PR makes blocked PCC project creation visible in CDP’s sync-error records, rather than only in completion logs, without changing which projects are created.

Changes:

  • Records blocked projects as PROJECT_CREATION_BLOCKED, independently of the creation setting.
  • Includes the project name, blocking reason, and available conflicting segment details.
  • Adds unit tests for blocked, incomplete, and creatable project plans.
File Description
services/​apps/​pcc_sync_worker/​src/​consumer/​pccProjectConsumer.ts Records blocked creation plans through the existing sync-error mechanism.
services/​apps/​pcc_sync_worker/​src/​consumer/​missingProjectCreation.ts Defines the blocked-error type and builds its diagnostic details.
services/​apps/​pcc_sync_worker/​src/​consumer/​missingProjectCreation.test.ts Tests diagnostic details and excludes creatable plans from blocked reporting.

Review effort: Balanced

@lfx-one lfx-one left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No blocking or minor findings. The blocked-creation rows reuse the existing sync-error upsert and the existing resolve sweep, and nothing about what gets created changes.

Documentation

This pull request changes behavior that may also be described outside this repository, such as product pages or an external docs site. I can't read those, so please check them; the author and maintainers own those updates. Changed here:

  • PROJECT_CREATION_BLOCKED (new sync error type recorded in pcc_projects_sync_errors)

Refs linuxfoundation/lfx-cdp-insights-ops#180

Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
@ulemons
ulemons force-pushed the feat/issue-180-pcc-record-blocked-creations branch from ec48486 to 4871d1e Compare November 25, 2026 15:31
Copilot AI balanced review requested due to automatic review settings November 25, 2026 15:31

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.

🟢 Approval recommended

No active review issues were identified with the changes that track blocked project creation as sync errors.

No open issues 🎉

Review effort: Balanced

@ulemons
ulemons merged commit de1ddd4 into main Nov 25, 2026
14 checks passed
@ulemons
ulemons deleted the feat/issue-180-pcc-record-blocked-creations branch November 25, 2026 15:36
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