Skip to content

Code cleanup#3927

Draft
jmendeza wants to merge 1 commit into
craftercms:developfrom
jmendeza:feature/6061
Draft

Code cleanup#3927
jmendeza wants to merge 1 commit into
craftercms:developfrom
jmendeza:feature/6061

Conversation

@jmendeza
Copy link
Copy Markdown
Member

@jmendeza jmendeza commented May 21, 2026

Code cleanup
craftercms/craftercms#6061

Summary by CodeRabbit

Release Notes

  • Deprecations & Removals

    • Removed deprecated WebDAV integration and related browsing functionality.
    • Removed AWS ElasticTranscoder support and associated job/profile configurations.
    • Removed legacy content versioning APIs from core content service.
    • Removed deprecated security role and permission checking methods.
    • Removed legacy constants and unused exception types.
  • Infrastructure Updates

    • Updated service wiring to use modern content service APIs instead of legacy variants.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Walkthrough

This PR removes deprecated v1 service APIs, AWS media transcoding support, and WebDAV functionality; simplifies v1 service method contracts; migrates remaining v1 implementations to use v2 ContentService; and updates Spring bean wiring accordingly.

Changes

V1 API Deprecation and Cleanup

Layer / File(s) Summary
AWS ElasticTranscoder and Media APIs
src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/ElasticTranscoder.java, src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/TranscoderProfile.java, src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/TranscoderJob.java, src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/TranscoderOutput.java, src/main/java/org/craftercms/studio/api/v1/aws/mediaconvert/MediaConvertJob.java, src/main/java/org/craftercms/studio/api/v1/aws/s3/S3Output.java, src/main/java/org/craftercms/studio/impl/v1/aws/elastictranscoder/TranscoderProfileMapper.java, src/main/java/org/craftercms/studio/impl/v1/asset/processing/AssetProcessingConfigReader.java, src/main/java/org/craftercms/studio/impl/v1/asset/processing/AssetProcessingConfigReaderImpl.java
Removes ElasticTranscoder interface and related model classes (TranscoderProfile, TranscoderOutput, TranscoderJob), MediaConvertJob, S3Output, and their corresponding mappers/implementations.
V1 Service Interface Simplification
src/main/java/org/craftercms/studio/api/v1/service/content/ContentService.java, src/main/java/org/craftercms/studio/impl/v1/service/content/ContentServiceImpl.java, src/main/java/org/craftercms/studio/api/v1/service/security/SecurityService.java, src/main/java/org/craftercms/studio/impl/v1/service/security/SecurityServiceImpl.java, src/main/java/org/craftercms/studio/api/v1/service/webdav/WebDavService.java
Removes content existence checks, retrieval, and version lookup methods from ContentService; removes role/permission methods from SecurityService; removes WebDavService interface. Implementation methods become protected internal helpers.
Constants and XML Element Removal
src/main/java/org/craftercms/studio/api/v1/constant/DmConstants.java, src/main/java/org/craftercms/studio/api/v1/constant/DmXmlConstants.java, src/main/java/org/craftercms/studio/api/v1/constant/StudioConstants.java
Removes unused public constants including content chain types, media processing keys, permission values, and configuration path constants; updates copyright years.
V1 to V2 ContentService Migration
src/main/java/org/craftercms/studio/impl/v1/util/config/profiles/SiteAwareConfigProfileLoader.java, src/main/java/org/craftercms/studio/impl/v2/service/scripting/internal/ScriptingServiceInternalImpl.java, src/main/resources/crafter/studio/studio-services-context.xml
Updates imports and dependencies to use org.craftercms.studio.api.v2.service.content.ContentService; rewires Spring beans to inject v2 contentServiceInternal instead of v1 cstudioContentService.
Deprecated Groovy APIs and Scripts
src/main/webapp/default-site/scripts/api/ContentServices.groovy, src/main/webapp/default-site/scripts/api/impl/content/SpringContentServices.groovy, src/main/webapp/default-site/scripts/api/impl/user/SpringUserServices.groovy, src/main/webapp/default-site/scripts/libs/HTMLCompareTools.groovy, src/main/webapp/default-site/scripts/pages/analytics-dashboard.groovy, src/main/webapp/default-site/scripts/pages/browse.groovy, src/main/webapp/default-site/scripts/pages/browseS3.groovy, src/main/webapp/default-site/scripts/pages/browseWebDAV.groovy, src/main/webapp/default-site/scripts/pages/diff.groovy, src/main/webapp/default-site/scripts/pages/overlay-css.groovy, src/main/webapp/default-site/scripts/pages/overlayhook.groovy
Removes content version retrieval methods from ContentServices/SpringContentServices; removes HTMLCompareTools utility class; removes environment configuration setup from page scripts.
Model and Configuration Updates
src/main/java/org/craftercms/studio/api/v1/exception/ContentProcessException.java, src/main/java/org/craftercms/studio/api/v1/exception/ContentNotAllowedException.java, src/main/java/org/craftercms/studio/api/v1/exception/SiteCreationException.java, src/main/java/org/craftercms/studio/api/v1/exception/repository/RemoteRepositoryNotBareException.java, src/main/java/org/craftercms/studio/model/Entity.java, src/main/java/org/craftercms/studio/model/Site.java, src/main/java/org/craftercms/studio/api/v1/to/SiteConfigTO.java, src/main/java/org/craftercms/studio/impl/v1/service/configuration/ServicesConfigImpl.java, src/main/java/org/craftercms/studio/impl/v1/service/webdav/WebDavServiceImpl.java, src/main/java/org/craftercms/studio/impl/v2/upgrade/operations/db/MigrateWorkflowUpgradeOperation.java, src/main/resources/crafter/studio/studio-upgrade-context.xml
Removes deprecated exception classes; removes Entity interface and updates Site to no longer implement it; removes wemProject field from SiteConfigTO; removes MigrateWorkflowUpgradeOperation upgrade task and its Spring bean definition.

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly Related PRs

  • craftercms/studio#3922: Both PRs delete the same deprecated v1 API contracts at the code level (e.g., api/v1/aws/elastictranscoder/ElasticTranscoder and api/v1/service/webdav/WebDavService).
  • craftercms/studio#3753: Both PRs reduce the v1 content-layer API by removing methods from ContentService/ContentServiceImpl in line with removing underlying content repository layers.
  • craftercms/studio#3892: Both PRs perform v1 API cleanup by removing methods from ContentService and associated v1 service contracts.

Suggested Reviewers

  • sumerjabri
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Code cleanup' is vague and generic, using a non-descriptive term that does not clearly convey the specific nature or scope of the substantial changes made in this PR. Revise the title to be more specific about the primary changes, such as 'Deprecate v1 API methods and remove AWS Elastic Transcoder/WebDAV services' or 'Remove deprecated v1 APIs and legacy service implementations'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/org/craftercms/studio/api/v1/constant/DmConstants.java (1)

23-59: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Keep deprecated aliases or explicitly treat this as a breaking API change.

org.craftercms.studio.api.v1.constant is still an exported v1 surface. Removing public fields from DmConstants turns existing imports into compile failures and can also trigger NoSuchFieldError for already-compiled extensions. If these constants are being retired, please keep deprecated aliases for a release or add explicit migration/release-note coverage for the break.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/java/org/craftercms/studio/api/v1/constant/DmConstants.java` around
lines 23 - 59, The PR removed or renamed public constants from DmConstants which
breaks the v1 API; restore any removed fields (e.g., INDEX_FILE,
SLASH_INDEX_FILE, SLASH_SITE_WEBSITE, XML_PATTERN, KEY_CONTENT_TYPE, KEY_PATH,
KEY_SITE, KEY_USER, KEY_SOURCE_PATH, KEY_CONTENT_LOADER, ROOT_PATTERN_PAGES,
ROOT_PATTERN_COMPONENTS, ROOT_PATTERN_ASSETS, ROOT_PATTERN_DOCUMENTS,
CONTENT_LIFECYCLE_OPERATION, JSON_KEY_ORDER_DEFAULT, KEY_APPLICATION_CONTEXT) as
deprecated aliases that forward to the new names, annotate them with `@Deprecated`
and a Javadoc pointing to the replacement constant, or alternatively document
this as a breaking change by keeping them removed only if you add explicit
migration notes and bump the public API version; update DmConstants accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/org/craftercms/studio/api/v1/asset/processing/AssetProcessingConfigReader.java`:
- Around line 23-25: Update the AssetProcessingConfigReader interface Javadoc to
remove any mention of accepting an Apache Commons Configuration object and
instead document the single exposed method readConfig(InputStream): describe
that callers supply an InputStream, what format(s) are expected, and that the
implementation maps that input to ProcessorPipelineConfiguration and
ProcessorConfiguration objects; reference the interface name
AssetProcessingConfigReader and the method readConfig(InputStream) in the
updated description so the Javadoc matches the current API surface.

---

Outside diff comments:
In `@src/main/java/org/craftercms/studio/api/v1/constant/DmConstants.java`:
- Around line 23-59: The PR removed or renamed public constants from DmConstants
which breaks the v1 API; restore any removed fields (e.g., INDEX_FILE,
SLASH_INDEX_FILE, SLASH_SITE_WEBSITE, XML_PATTERN, KEY_CONTENT_TYPE, KEY_PATH,
KEY_SITE, KEY_USER, KEY_SOURCE_PATH, KEY_CONTENT_LOADER, ROOT_PATTERN_PAGES,
ROOT_PATTERN_COMPONENTS, ROOT_PATTERN_ASSETS, ROOT_PATTERN_DOCUMENTS,
CONTENT_LIFECYCLE_OPERATION, JSON_KEY_ORDER_DEFAULT, KEY_APPLICATION_CONTEXT) as
deprecated aliases that forward to the new names, annotate them with `@Deprecated`
and a Javadoc pointing to the replacement constant, or alternatively document
this as a breaking change by keeping them removed only if you add explicit
migration notes and bump the public API version; update DmConstants accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d8dbea3b-c443-40c4-a4fd-353515640a5f

📥 Commits

Reviewing files that changed from the base of the PR and between c7abf4e and 1250935.

📒 Files selected for processing (42)
  • src/main/java/org/craftercms/studio/api/v1/asset/processing/AssetProcessingConfigReader.java
  • src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/ElasticTranscoder.java
  • src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/TranscoderJob.java
  • src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/TranscoderOutput.java
  • src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/TranscoderProfile.java
  • src/main/java/org/craftercms/studio/api/v1/aws/mediaconvert/MediaConvertJob.java
  • src/main/java/org/craftercms/studio/api/v1/aws/s3/S3Output.java
  • src/main/java/org/craftercms/studio/api/v1/constant/DmConstants.java
  • src/main/java/org/craftercms/studio/api/v1/constant/DmXmlConstants.java
  • src/main/java/org/craftercms/studio/api/v1/constant/StudioConstants.java
  • src/main/java/org/craftercms/studio/api/v1/exception/ContentNotAllowedException.java
  • src/main/java/org/craftercms/studio/api/v1/exception/ContentProcessException.java
  • src/main/java/org/craftercms/studio/api/v1/exception/SiteCreationException.java
  • src/main/java/org/craftercms/studio/api/v1/exception/repository/RemoteRepositoryNotBareException.java
  • src/main/java/org/craftercms/studio/api/v1/service/content/ContentService.java
  • src/main/java/org/craftercms/studio/api/v1/service/security/SecurityService.java
  • src/main/java/org/craftercms/studio/api/v1/service/webdav/WebDavService.java
  • src/main/java/org/craftercms/studio/api/v1/to/SiteConfigTO.java
  • src/main/java/org/craftercms/studio/impl/v1/asset/processing/AssetProcessingConfigReaderImpl.java
  • src/main/java/org/craftercms/studio/impl/v1/aws/elastictranscoder/TranscoderProfileMapper.java
  • src/main/java/org/craftercms/studio/impl/v1/service/configuration/ServicesConfigImpl.java
  • src/main/java/org/craftercms/studio/impl/v1/service/content/ContentServiceImpl.java
  • src/main/java/org/craftercms/studio/impl/v1/service/security/SecurityServiceImpl.java
  • src/main/java/org/craftercms/studio/impl/v1/service/webdav/WebDavServiceImpl.java
  • src/main/java/org/craftercms/studio/impl/v1/util/config/profiles/SiteAwareConfigProfileLoader.java
  • src/main/java/org/craftercms/studio/impl/v2/service/scripting/internal/ScriptingServiceInternalImpl.java
  • src/main/java/org/craftercms/studio/impl/v2/upgrade/operations/db/MigrateWorkflowUpgradeOperation.java
  • src/main/java/org/craftercms/studio/model/Entity.java
  • src/main/java/org/craftercms/studio/model/Site.java
  • src/main/resources/crafter/studio/studio-services-context.xml
  • src/main/resources/crafter/studio/studio-upgrade-context.xml
  • src/main/webapp/default-site/scripts/api/ContentServices.groovy
  • src/main/webapp/default-site/scripts/api/impl/content/SpringContentServices.groovy
  • src/main/webapp/default-site/scripts/api/impl/user/SpringUserServices.groovy
  • src/main/webapp/default-site/scripts/libs/HTMLCompareTools.groovy
  • src/main/webapp/default-site/scripts/pages/analytics-dashboard.groovy
  • src/main/webapp/default-site/scripts/pages/browse.groovy
  • src/main/webapp/default-site/scripts/pages/browseS3.groovy
  • src/main/webapp/default-site/scripts/pages/browseWebDAV.groovy
  • src/main/webapp/default-site/scripts/pages/diff.groovy
  • src/main/webapp/default-site/scripts/pages/overlay-css.groovy
  • src/main/webapp/default-site/scripts/pages/overlayhook.groovy
💤 Files with no reviewable changes (32)
  • src/main/java/org/craftercms/studio/api/v1/exception/ContentProcessException.java
  • src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/TranscoderOutput.java
  • src/main/java/org/craftercms/studio/api/v1/exception/ContentNotAllowedException.java
  • src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/ElasticTranscoder.java
  • src/main/webapp/default-site/scripts/pages/analytics-dashboard.groovy
  • src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/TranscoderJob.java
  • src/main/java/org/craftercms/studio/model/Entity.java
  • src/main/java/org/craftercms/studio/api/v1/aws/s3/S3Output.java
  • src/main/webapp/default-site/scripts/api/ContentServices.groovy
  • src/main/webapp/default-site/scripts/pages/overlay-css.groovy
  • src/main/java/org/craftercms/studio/api/v1/aws/mediaconvert/MediaConvertJob.java
  • src/main/webapp/default-site/scripts/pages/browseWebDAV.groovy
  • src/main/webapp/default-site/scripts/api/impl/user/SpringUserServices.groovy
  • src/main/java/org/craftercms/studio/impl/v1/service/configuration/ServicesConfigImpl.java
  • src/main/java/org/craftercms/studio/api/v1/to/SiteConfigTO.java
  • src/main/java/org/craftercms/studio/api/v1/aws/elastictranscoder/TranscoderProfile.java
  • src/main/java/org/craftercms/studio/api/v1/exception/SiteCreationException.java
  • src/main/webapp/default-site/scripts/pages/browse.groovy
  • src/main/java/org/craftercms/studio/impl/v1/aws/elastictranscoder/TranscoderProfileMapper.java
  • src/main/webapp/default-site/scripts/pages/diff.groovy
  • src/main/java/org/craftercms/studio/impl/v1/service/webdav/WebDavServiceImpl.java
  • src/main/resources/crafter/studio/studio-upgrade-context.xml
  • src/main/java/org/craftercms/studio/impl/v2/upgrade/operations/db/MigrateWorkflowUpgradeOperation.java
  • src/main/java/org/craftercms/studio/api/v1/service/content/ContentService.java
  • src/main/webapp/default-site/scripts/pages/overlayhook.groovy
  • src/main/java/org/craftercms/studio/api/v1/constant/StudioConstants.java
  • src/main/webapp/default-site/scripts/libs/HTMLCompareTools.groovy
  • src/main/java/org/craftercms/studio/api/v1/service/security/SecurityService.java
  • src/main/webapp/default-site/scripts/pages/browseS3.groovy
  • src/main/java/org/craftercms/studio/api/v1/service/webdav/WebDavService.java
  • src/main/webapp/default-site/scripts/api/impl/content/SpringContentServices.groovy
  • src/main/java/org/craftercms/studio/api/v1/exception/repository/RemoteRepositoryNotBareException.java

Comment on lines 23 to 25
/**
* Reads the configuration from an input stream or a Apache Commons Configuration object and maps it to actual asset processing
* configuration objects like {@link ProcessorPipelineConfiguration} and {@link ProcessorConfiguration}.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the interface Javadoc to match the remaining API.

It still says callers can provide an Apache Commons Configuration object, but this interface now only exposes readConfig(InputStream).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/org/craftercms/studio/api/v1/asset/processing/AssetProcessingConfigReader.java`
around lines 23 - 25, Update the AssetProcessingConfigReader interface Javadoc
to remove any mention of accepting an Apache Commons Configuration object and
instead document the single exposed method readConfig(InputStream): describe
that callers supply an InputStream, what format(s) are expected, and that the
implementation maps that input to ProcessorPipelineConfiguration and
ProcessorConfiguration objects; reference the interface name
AssetProcessingConfigReader and the method readConfig(InputStream) in the
updated description so the Javadoc matches the current API surface.

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.

1 participant