Skip to content

Code cleanup#3927

Open
jmendeza wants to merge 2 commits into
craftercms:developfrom
jmendeza:feature/6061
Open

Code cleanup#3927
jmendeza wants to merge 2 commits 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

  • Deprecations & Removals

    • Removed deprecated WebDAV integration and related browsing/upload pages and scripts.
    • Removed AWS Elastic Transcoder and MediaConvert job/profile models and mappers.
    • Removed legacy content-versioning and several content retrieval APIs.
    • Removed legacy security role/permission APIs, multiple exception types, and assorted legacy constants/utilities (including HTML diff tooling).
  • Infrastructure Updates

    • Updated service wiring and internal services to use v2 content service APIs.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3cfbb814-27b1-4ffa-ae57-f790e314d045

📥 Commits

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

📒 Files selected for processing (1)
  • src/main/java/org/craftercms/studio/api/v1/asset/processing/AssetProcessingConfigReader.java

Walkthrough

This PR removes many deprecated v1 APIs and implementations (AWS ElasticTranscoder types, WebDAV service, multiple exception types), trims public v1 service interfaces, deletes several Groovy page/scripts and utilities, migrates selected implementations to the v2 ContentService, and updates Spring wiring and constants.

Changes

V1 API Deprecation and Cleanup

Layer / File(s) Summary
Constants and XML element removals
src/main/java/org/craftercms/studio/api/v1/constant/*
Updates copyright years and removes multiple public constants including KEY_* fields and ELM_INTERNAL_NAME.
ContentService & SecurityService API reduction
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
Removes content existence/retrieval/version APIs and role/global-admin APIs from v1 service contracts; implementations converted to protected helpers or had methods removed.
AWS ElasticTranscoder and Asset processing removal
src/main/java/org/craftercms/studio/api/v1/aws/*, src/main/java/org/craftercms/studio/impl/v1/aws/*, src/main/java/org/craftercms/studio/impl/v1/asset/processing/*
Deletes ElasticTranscoder interface and related model classes (TranscoderProfile/Output/Job), removes TranscoderProfileMapper and MediaConvert/S3 output types; adjusts AssetProcessingConfigReader contract and impl visibility/imports.
WebDAV implementation and Groovy scripts removal
src/main/java/org/craftercms/studio/api/v1/service/webdav/WebDavService.java, src/main/java/org/craftercms/studio/impl/v1/service/webdav/WebDavServiceImpl.java, src/main/webapp/default-site/scripts/**
Removes v1 WebDAV interface and implementation; deletes multiple Groovy page scripts, utilities (HTMLCompareTools), and small API methods used by pages.
Model, SiteConfig and upgrade op removals
src/main/java/org/craftercms/studio/api/v1/exception/*, src/main/java/org/craftercms/studio/model/*, src/main/java/org/craftercms/studio/api/v1/to/SiteConfigTO.java, src/main/resources/crafter/studio/studio-upgrade-context.xml
Removes several exception classes, the Entity interface, removes wemProject from SiteConfigTO and its use, and deletes the MigrateWorkflowUpgradeOperation and its Spring bean.
V1 → V2 ContentService migration and Spring bean wiring
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
Replaces v1 ContentService imports with v2 ContentService in loaders/implementations and rewires Spring beans to use contentServiceInternal.

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly Related PRs

Suggested Reviewers

  • sumerjabri
  • rart
🚥 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; it does not clearly convey the primary change or scope of this large, multi-file removal and API deprecation changeset. Use a more descriptive title that reflects the main objectives, such as 'Deprecate v1 API methods and remove AWS Elastic Transcoder support' or 'Remove deprecated v1 service APIs and constants'.
✅ 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

@jmendeza jmendeza marked this pull request as ready for review May 22, 2026 15:39
@jmendeza jmendeza requested a review from sumerjabri as a code owner May 22, 2026 15:39
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