Skip to content

ci: run PR Build and Sonar on feature/ai-contribution pull requests - #2016

Open
bmestrallet wants to merge 5 commits into
feature/ai-contributionfrom
fix/EXO-88732-ci-on-ai-contribution
Open

ci: run PR Build and Sonar on feature/ai-contribution pull requests#2016
bmestrallet wants to merge 5 commits into
feature/ai-contributionfrom
fix/EXO-88732-ci-on-ai-contribution

Conversation

@bmestrallet

Copy link
Copy Markdown
Contributor

Problem

Pull requests targeting feature/ai-contribution in this repository run no build, no tests and no quality gate. Both workflows filter the base branch:

# .github/workflows/prbuild.yml        # .github/workflows/sonar.yml
on:                                    on:
  pull_request:                          pull_request:
    branches:                              branches:
      - develop                              - feature/maintenance
      - stable/*                             - develop
      - feature/maintenance                  - stable/*

feature/ai-contribution is in neither list, so the only checks on those PRs are the Tribe/Builders notifiers and Snyk's "No manifest changes detected". Concretely, #2007, #2009, #2010 and #2011 carry roughly 1500 changed front-end lines with nothing verifying that the module even compiles — a Sonar quality-gate failure of the kind that blocked a sibling PR in Meeds-io/matrix this week would pass unnoticed here.

Change

One line in each workflow, adding feature/ai-contribution to the pull_request branch filters, so that stream gets the same safety net as the other target branches.

GitHub resolves a pull_request workflow from the base branch of the PR, which is why this PR targets feature/ai-contribution itself: it takes effect for PRs targeting that branch as soon as it is merged there. The same two lines should go to develop whenever the branch is reconciled, so the setting is not lost.

Verification

Nothing to run: the change is limited to the trigger filters, the jobs themselves are untouched. The next PR opened against feature/ai-contribution will show PR Build and SonarCloud Code Analysis in its checks.

🤖 Generated with Claude Code

aycherif and others added 5 commits July 11, 2026 01:39
…lic link, shortcuts, favorites) - EXO-88456 (#2001)

* feat: Relocate Document MCP tools into the Documents add-on

Move the generic document MCP tools out of the enterprise distribution
into the open Documents add-on so they ship in all editions.

- Add DocumentMcpTool (@service @Profile("mcp-server")) exposing the 9
  document tools (get_root_folder_by_space, attach_document_to_content,
  update_document_description, get_documents_by_folder_id,
  get_root_folder_for_user, get_document_by_id, get_document_content_by_id,
  get_document_transcription_by_id, search_documents) as the current user.
- get_document_transcription_by_id is now a plain read of the stored
  transcription (DocumentFileService.getAudioTranscription) with no
  ai-agent-service coupling; on-demand AI transcription stays enterprise.
- Add documents-services ai-tool-definitions.json with the 9 tool entries.
- documents-services: add mcp-server-tools (provided), ecms-core-services
  (AttachmentService), notes-service (NoteService) and the -parameters
  javac flag required for MCP argument binding by name.

The AI-experience layer (UX bindings, curated prompts, auto-transcription
listener) intentionally remains in the enterprise edition.

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

* fix: Move Document MCP model records into the Documents add-on

The relocated DocumentMcpTool imported DocumentModel / DocumentFileModel /
DocumentFolderModel from org.exoplatform.documents.model, but those three
records were left behind in the enterprise edition, so documents-services
failed to compile ("cannot find symbol").

Bring them into the add-on under org.exoplatform.documents.mcp.model
(co-located with the tool, mirroring the poll add-on's io.meeds.poll.mcp.model
layout) instead of splitting the org.exoplatform.documents.model package
across the api and services jars. Update the imports in DocumentMcpTool
accordingly.

Add DocumentMcpToolTest (13 cases, JUnit 4 like the rest of the module) so the
new tool methods keep the module above its 0.55 coverage gate.

No AI (io.meeds.ai / ai-agent-service) dependency is introduced.

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

* feat: Add v1 batch of Documents MCP tools (folders, versions, content management)

Extend DocumentMcpTool with 15 new MCP tools acting as the current user
(ACL enforced by DocumentFileService):

Reads: list_folder_children, get_folder_breadcrumb, get_folder_tree,
list_document_versions, get_documents_size.

Writes (require_approval): create_folder, rename_document, move_document,
copy_document, duplicate_document, delete_document (trash only, delay=0),
undo_delete_document, restore_document_version, update_version_summary,
set_document_visibility.

Adds thin model records (BreadcrumbItemModel, DocumentVersionModel,
DocumentTreeItemModel, DocumentsSizeModel), matching ai-tool-definitions.json
entries, and DocumentMcpToolTest coverage.

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

* fix: create_folder under root folder fails in Documents MCP tools

The JCR storage createFolder/getBreadcrumb resolve the parent from the
node id (folderId) and treat 'folderPath' as a RELATIVE sub-path from
that node (node.getNode(folderPath) / getNodeByPath). DocumentMcpTool
was passing the parent node's ABSOLUTE JCR path, so creating a folder
under the user's ROOT folder failed with
ObjectNotFoundException: Folder with path : /Users/.../Private isn't found.

Pass null as folderPath in createFolder and getFolderBreadcrumb since
the folder id already identifies the JCR node uniquely. move/delete keep
passing absolute paths (the storage uses them as absolute JCR paths).

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

* feat: Add create_document/upload_document MCP tools using UploadToolUtils - EXO-88354

create_document turns chat-authored text/markdown/HTML into a real DMS file;
upload_document imports a binary file from base64 or an SSRF-guarded URL fetch.
Both stage the bytes via UploadToolUtils.materialize, wrap them in a one-entry
zip (importFiles unzips), import into the target folder as the current user, and
poll the folder to return the created document. Pins mcp-server-tools to the
ai-contribution build that ships UploadToolUtils.

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

* feat: upload_document accepts chat attachments + create_document honors mime_type - EXO-88354

upload_document now declares attachment_object_type/attachment_object_id so
EVA forwards a chat-attached file/image; the bytes are resolved server-side as
the current user (ACL enforced) via UploadToolUtils.resolveImage's attachment
branch (no image-only constraint), keeping the existing base64/url paths.

create_document forces the requested mime_type on the stored file via a new
DocumentFileService/Storage updateDocumentMimeType (JCR jcr:content/jcr:mimeType),
fixing .md files that importFiles left as application/octet-stream.

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

* revert: drop JCR mime-forcing in create_document; content-type follows file extension - EXO-88354

The prior commit forced the requested mime_type onto the stored file via a
new DocumentFileService/Storage updateDocumentMimeType that opened a JCR
session and set jcr:content/jcr:mimeType. Revert that JCR plumbing entirely:
create_document's stored content type now follows the file extension
(resolved by the platform MimeTypeResolver), the pre-fix behavior. The
mime_type param is kept but is advisory (extension inference only). The
upload_document chat-attachment support is untouched.

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

* refactor: use renamed UploadToolUtils.FetchedContent - EXO-88354

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

* feat: clear error messages for create_document/upload_document bad input - EXO-88354

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

* refactor: drop mime_type from create_document; require a filename with extension - EXO-88354

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

* feat: add version, share, public-link, shortcut and favorite Documents MCP tools

Adds six new MCP tools to DocumentMcpTool, each acting as the current user
(ACLs enforced) with a matching ai-tool-definitions.json entry and tests:

- add_document_version: uploads updated content onto an existing file as a new
  version via DocumentFileService.createNewVersion (checkout -> set jcr:content
  -> checkin/VersionHistoryUtils.createVersion), from text/base64/url/chat
  attachment, with an optional version summary stamped on the new current
  version.
- create_public_link: PublicDocumentAccessService.createPublicDocumentAccess,
  returning the /portal/download-document/{nodeId} shareable link.
- create_document_shortcut: DocumentFileService.createShortcut into a resolved
  destination folder path.
- share_document: DocumentFileService.shareDocument with a user or a space.
- favorite_document / unfavorite_document: social FavoriteService with the
  "document"/"folder" object types.

All writes require approval and pre-check edit permission where applicable.
Skipped by design: list_trash (admin-only global trash, no per-user scope),
share permission levels (service exposes no clean granular API), and
create_document_from_template (still no ECMS service method; tracked on #88422).

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

* fix: correct integration bugs in Documents MCP tools (conflict values, copy/duplicate return, favorites type, filters, size, share permissions, undo-delete, import conflict) - EXO-88354

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

* feat: add create_document_from_template MCP tool (delegates to ecms DocumentService) - EXO-88354

Adds a Documents MCP tool that creates a new empty office document
(Word/Excel/PowerPoint, + ODF when the editor add-on provides it) from the
platform's blank template, by delegating to the ecms DocumentService rather
than re-implementing template/office logic.

- documents-storage-jcr: inject DocumentService, add
  createDocumentFromTemplate mirroring createFolder (session/parent/ACL),
  resolve the template by matching NewDocumentTemplate.getExtension against
  the requested type, then call ecms createDocumentFromTemplate.
- documents-api / documents-services: propagate the new storage/service
  signatures.
- DocumentMcpTool.createDocumentFromTemplate + ai-tool-definitions entry
  (require_approval, document_type enum). ecms does NOT append the extension,
  so the tool builds a title that ends with '.<type>'. Softened
  create_document's office-format rejection to point at the new tool.

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

* fix: re-verify follow-ups — template extension match, share no-downgrade, undo-delete system session, favorite docs - EXO-88354

Fix 1: create_document_from_template never matched a template because
onlyoffice stores extensions with a leading dot (".docx") while the caller's
type is dot-stripped ("docx"). Normalize the dot on both sides of the compare
in JCRDocumentFileStorage. Trim supported types to docx/xlsx/pptx (the 3 the
editor add-on actually ships) in DocumentMcpTool and ai-tool-definitions.json.

Fix 2: share_document silently downgraded an existing editor to read because
it always appended (recipient,"read") after the preserved (recipient,"edit"),
and storage writes permissions in list order. Only add the read grant when the
recipient is not already a collaborator.

Fix 3: undo_delete_document resolved the trashed node via the user-session
overload, but trash lives under a system session, so it false-negatived with a
misleading "permanently deleted" error. Use the system-session getDocumentById
overload.

Fix 4: favorite/unfavorite descriptions and Javadoc advertised "file or
folder" though folders are rejected. Correct to files-only wording.

Adds regression tests: template dotted-extension match (storage), share
edit-preservation, and undo-delete via the system-session overload.

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

* fix: resolve created document by name with an ambiguity guard instead of a blind folder-diff (boubaker review, MCP-only) - EXO-88354

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

* fix: adapt DocumentMcpTool to the new UploadToolUtils.ImageSource API

mcp-server's develop refactored UploadToolUtils.resolveImage, replacing the
four loose imageUrl/imageBase64/attachmentObjectType/attachmentObjectId
parameters with a single ImageSource record. Now that feature/ai-contribution
tracks that version, the old eight-argument calls no longer compile. Wrap the
four values in ImageSource at both call sites.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… API (#2007)

Rewrite the level-2 "Use existing uploads" picker
(AttachmentsDriveExplorerDrawer) off the legacy ECMS/WCM XML drive
listing onto the modern documents-service /v1/documents JSON API.

- Two-source model: My Documents (userIdentityId) + My Spaces
  (space.identity.id); cloud drives dropped.
- Reuse the mobile FolderTreeViewDrawer for drive/space/folder
  navigation; the panel icon opens it and it auto-expands to the
  current folder (fix a Vuetify v-treeview buildTree crash caused by
  backend children:null on empty leaf folders).
- Reuse documents-breadcrumb with a new global mobile branch
  (fa-angle-left to parent + current folder / drive name).
- Simple list rows (checkbox + icon + name); exo-drawer use-filter
  header search driving server-side query; server-side pagination.
- Reuse Documents list cells via a $root shim on the attachment app.
- Preserve the level-1 emit contract and folder CRUD.
- Scope two leaking documents.css rules (.v-alert__content, .py-10px)
  under .documents-application to avoid bleeding into other portlets.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…drawer - EXO-88732 (#2009)

Level-1 "Attach files" drawer:
- Empty state: hero drop-zone + secondary tiles (Select from Documents / Create
  a new document); populated state: compact add bar (Upload / Documents / New)
  keeping room for the list.
- Full-drawer drag-and-drop overlay (bound to the drawer body, since exo-drawer
  teleports its panel out of the component root), remove-all with confirm,
  retry-on-failed-upload, and de-dup of the rendered list by (id || uploadId).
- Richer attachment rows: thumbnails, transparent source + location chips,
  and a remove/detach control that shows in both composer and entity-bound modes.

Create document is now a dedicated nested "Add a document" drawer (replacing the
popup menu):
- Doc-type selectable cards (Document/Spreadsheet/Presentation) with hover and a
  primary-ring selected state, keyboard-accessible (role/tabindex/Enter-Space).
- Inline title field + a footer Cancel/Create (Create disabled until a type is
  picked and the title is valid); reuses the existing create / 409 / OnlyOffice
  editor-tab logic; returns to the populated level-1 list on success.
- "Or start from a template" separator + a Templates placeholder empty-state
  (scaffold for a future templates backend).

Level-2 drive picker:
- Explicit back arrow returning to level-1.
- Ship the breadcrumb root label keys in the attachments bundle so they resolve
  on host pages (notes/task/news editors) that do not load the Documents bundle.

UI polish: shadow + light-grey tile hover (kept border), larger top margin, and
FA5-safe icons throughout.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pull requests targeting feature/ai-contribution currently get no build, no tests
and no quality gate: prbuild.yml and sonar.yml only list develop, stable/* and
feature/maintenance in their pull_request branch filters, so the AI-contribution
stream merges on the Tribe/Builders notifiers and a Snyk no-op alone. The recent
attachments/documents PRs (#2007, #2009, #2010, #2011) landed roughly 1500 changed
front-end lines under that blind spot.

Adding the branch to both filters restores the same safety net the other target
branches have. GitHub resolves a pull_request workflow from the base branch, so
this takes effect for PRs targeting feature/ai-contribution as soon as it is
merged there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bmestrallet
bmestrallet requested a review from ahamdi July 22, 2026 20:42
@bmestrallet
bmestrallet force-pushed the feature/ai-contribution branch from 4ced318 to c238e71 Compare July 28, 2026 12:19
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.

2 participants