Skip to content

[dev] [Marfuen] mariano/compliance-timeline-feature#2488

Open
github-actions[bot] wants to merge 110 commits intomainfrom
mariano/compliance-timeline-feature
Open

[dev] [Marfuen] mariano/compliance-timeline-feature#2488
github-actions[bot] wants to merge 110 commits intomainfrom
mariano/compliance-timeline-feature

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 8, 2026

This is an automated pull request to merge mariano/compliance-timeline-feature into dev.
It was created by the [Auto Pull Request] action.

Marfuen and others added 30 commits April 7, 2026 15:30
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… phase completion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… lines each

Extract lifecycle, phase editing, template management, and template resolution
into separate files to comply with the max 300 lines per file rule.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…wagger cleanup

- DTOs: activate-timeline, update-phase, create-template, create-phase-template,
  update-template, update-phase-template with class-validator decorators
- Customer controller: GET /timelines, GET /timelines/:id,
  POST /timelines/:id/phases/:phaseId/ready with Slack webhook notification
- Admin template controller: full CRUD for timeline templates and their phases
- Admin org timelines controller: activate, pause, resume, phase CRUD, complete
- TimelinesModule registered in AppModule with all services and controllers
- Added @ApiExcludeController() to all 8 existing admin controllers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ases on 100% tasks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a compliance timeline section above the existing dashboard grid,
showing stacked timeline cards with phase bars, status badges, and
date summaries. Also updates the Timeline hook types to match the
actual API response (DRAFT/ACTIVE/PAUSED/COMPLETED statuses).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a new admin page for managing timeline templates with CRUD operations.
Includes a template list with phase bar previews and a sheet editor for
creating/editing templates and their phases. Added sidebar navigation link.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a Timeline tab to the admin organization detail view showing all
timelines for an org. Includes status badges, phase tables, and action
buttons for activating (with date picker), pausing, resuming, and
editing individual phases via a sheet editor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sk completion data

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… date

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…aser

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mintlify
Copy link
Copy Markdown
Contributor

mintlify bot commented Apr 8, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
CompAI 🟢 Ready View Preview Apr 8, 2026, 9:06 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

data: { status: 'IN_PROGRESS', completedAt: null, completedById: null },
});
needsRefetch = true;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Read endpoint mutates phase status causing data corruption

High Severity

The findAllForOrganization method (called by GET /timelines) performs database writes during a read operation. When a completed phase's metric drops below 100%, it reverts the phase to IN_PROGRESS but bypasses TimelinesLifecycleService.completePhase logic — it doesn't check if the timeline itself is COMPLETED, doesn't update the timeline status back from COMPLETED, and doesn't re-advance subsequent phases. This can leave a COMPLETED timeline with an IN_PROGRESS phase, creating an inconsistent state. Every time a customer lists their timelines, phases may flip-flop between completed and in-progress.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 31dbc40. Configure here.

Marfuen added 18 commits April 9, 2026 09:26
@vercel vercel bot temporarily deployed to Preview – portal April 10, 2026 15:52 Inactive
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 3 potential issues.

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

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit 3aced7e. Configure here.

}

return timelines;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Read endpoint performs writes causing side effects

Medium Severity

findAllForOrganization is called from a GET endpoint but performs database writes (backfilling timelines via ensureTimelinesExist, completing phases, reverting phases). This violates the principle that read operations are idempotent. Concurrent GET requests can race on phase status updates, and each call triggers getOverviewScores (an expensive multi-query operation) plus potential completePhase calls with Slack notifications — all on every list request.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3aced7e. Configure here.

organizationId,
timelinesService: this.timelinesService,
}).catch(() => {});
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto-complete not triggered for not_relevant task status

Medium Severity

checkAutoCompletePhases in frameworks-timeline.helper.ts considers tasks with status done OR not_relevant as completed when evaluating whether all tasks are finished. However, the trigger in tasks.service.ts only calls checkAutoCompletePhases when status === TaskStatus.done, not when tasks are set to not_relevant. If the last remaining incomplete task is marked not_relevant, the auto-completion check never fires and the timeline phase stays IN_PROGRESS indefinitely.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3aced7e. Configure here.


const logger = new Logger('TimelinesSlack');

const WEBHOOK_URL = process.env.SLACK_CX_WEBHOOK_URL;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Slack webhook URL captured at module load time

Low Severity

WEBHOOK_URL is read from process.env.SLACK_CX_WEBHOOK_URL at module load time as a top-level constant. According to main.ts, .env files are loaded manually before NestJS starts, but if the module is imported before env loading completes (or the env var is set dynamically), the value will be permanently undefined and all Slack notifications will silently fail for the lifetime of the process.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3aced7e. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant