feat(dotcdn): migrate dotCDN from OSGI plugin to core#35588
Open
swicken wants to merge 10 commits into
Open
Conversation
WIP checkpoint — no real testing has been done yet. This is a structural migration before improving the UI (date range controls, chart formatting, hourly granularity). Backend migration: - Moved all Java classes from com.dotcms.cloud.* to com.dotcms.cdn.* - Registered REST resource, workflow actionlet, ViewTool, event subscriber, web interceptor, and portlet in core - Added app descriptor YAML (auto-discovered by AppsAPI) - Dropped OSGI Activator, AppUtil, and unused BCDNStorage client - Includes #35320 fixes: empty response handling, Integer→Double cast Frontend migration: - Moved Angular app from apps/dotcdn/ to libs/portlets/dot-cdn/ - Converted to standalone component (no NgModule) - Updated PrimeNG tabs to new p-tablist/p-tabpanel API - Registered as lazy-loaded Angular portlet route (no JSP/iframe) - Added smart bandwidth unit selection (B/KB/MB/GB) - Added human-readable number formatting for requests - Fixed duplicate y-axis on charts - Temporary mock data options for visual testing (to be removed) Unit tests: 7/7 passing (DotCDNAPITest)
- Added origin response time, cache hit rate chart, and error rate
(4xx/5xx) charts from Bunny API (loadErrors + loadOriginResponseTimes)
- Replaced dropdown with segmented button bar (Today|24h|7d|30d|90d|Custom)
plus inline date range picker for custom selection
- Backend passes hourly=true to Bunny for short ranges (<=2 days)
- 2x2 chart grid layout with stat cards (4 metrics)
- Smart date labels: hourly ("Apr 1 2pm") vs daily ("Apr 1")
- Integer-only ticks on request/error charts
- Cache hit rate chart with 0-100% scale
- Toolbar with filters scoped to Overview tab only
- Null-safe handling for origin response time
… same path Prevents the Jersey FATAL ambiguous resource error that crashes the entire REST layer when the dotCDN OSGI plugin is still installed alongside the core migration. DotRestApplication.addClass() now checks the plugin's @path against CORE_REST_PATHS and logs a warning instead of registering the conflicting resource.
…nd actionlet DotCDNAPIImpl constructor throws when App secrets are absent, which breaks globally-registered code (push-publish subscriber, workflow actionlet) on sites without dotCDN configured. Add DotCDNAPI.isConfigured() check and skip gracefully. Also fix NPE in createUrlsToPurgeForContentlet when identifier lookup returns null, and downgrade per-URL purge logging from INFO to debug.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
Fix UTC date handling, add defensive stats parsing, close Response in invalidateAll, add isConfigured guard to REST endpoints, log async purge failures, isolate per-contentlet purge in subscriber, restrict purge URLs to relative paths, surface API errors in the frontend store, and fix Math.max stack overflow risk. Run nx format:write on all CDN frontend files to pass CI format check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the dotCDN plugin from a standalone OSGI plugin into the dotCMS core application, providing first-class CDN cache purging and analytics as a built-in capability.
Backend (
com.dotcms.cdn)DotRestApplication,InterceptorFilter,toolbox.xml,portlet.xml, andLocalSystemEventSubscribersInitializerFrontend (
@dotcms/portlets/dot-cdn)app.routes.tsSafety & resilience
Tests
DotCDNAPITest— Unit tests covering stats aggregation, cache invalidation, error handling, and missing-config scenariosTest plan
DotCDNAPITestunit tests pass🤖 Generated with Claude Code
Closes #35593