Add provider-neutral ticket attachment metadata service - #662
Draft
adriandemian wants to merge 2 commits into
Draft
Add provider-neutral ticket attachment metadata service#662adriandemian wants to merge 2 commits into
adriandemian wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
User Impact
Technical Context
ticket_attachment_servicenormalizesTicketingTicketIdentity, fetches provider content through the existing Jira, Linear, and ClickUp integration services, and maps attachments intoTicketAttachmentList/TicketAttachmentMetadataDTOs.ticketing_identitynow owns provider constants and identity normalization helpers, andticketing_servicereuses those shared helpers instead of keeping the duplicate logic inline.Risks / Follow-Ups
View full plan
Goal
User wording: "Implement phase 1 of the Ticket Attachment MCP Access automation as a scoped PR." The run should add a provider-neutral backend attachment domain/service layer for Jira, Linear, and ClickUp ticket references, with tests, while deliberately not exposing MCP tools or a live download/cache endpoint yet.
Interpretation: create backend-only Rust application/domain models and a service that accepts the existing normalized ticket identity shape, fetches the current provider ticket through existing integrations, returns bounded safe attachment metadata, and marks retrievability without returning provider URLs, download URLs, credentials, or trusted-content wording.
Assumptions:
Evidence
src-tauri/src/application/ticketing_service.rsalready owns provider-neutral ticket identity and routing for Jira, Linear, and ClickUp throughTicketingTicketIdentity, provider constants, andnormalize_ticket_identity.src-tauri/src/application/atlassian_integration_service.rsexposesfetch_resource_content(...)andAtlassianJiraAttachment { id, filename, mime_type, size, author, content_url, thumbnail_url, created_at }.src-tauri/src/application/linear_integration_service.rsexposesfetch_issue_content(...)andLinearAttachment { id, title, subtitle, url }.src-tauri/src/application/clickup_integration_service.rsexposesfetch_task(...)andClickUpAttachment { id, filename, mime_type, size, url }; ClickUp comments can also contain attachments.src-tauri/src/commands/ticketing_commands/mod.rsalready has provider detail routing inget_ticket_detail, but phase 1 should not add endpoint exposure there.Affected Files
.artifacts/specs/ticket-attachment-mcp/tracker.md- create/update first in implementation mode with findings, decisions, validation, and PR handoff notes.src-tauri/src/application/ticketing_identity.rs- add a small shared provider-neutral identity module if needed; move or centralize provider constants, external-kind mapping, and normalized ticket identity validation now private toticketing_service.rs.src-tauri/src/application/ticketing_service.rs- import shared identity helpers instead of owning a second normalization implementation; preserve existing public behavior and tests.src-tauri/src/application/ticket_attachment_service.rs- add the new provider-neutral attachment service, safe output models, provider fetch routing, bounding, and redaction helpers.src-tauri/src/application/ticket_attachment_service_tests.rs- add focused tests for Jira, Linear, ClickUp normalization, missing/disabled integrations, unsupported providers, bounded output, and URL/secret redaction.src-tauri/src/application/mod.rs- wire/re-export the new service and any shared identity types needed by tests or future backend callers.src-tauri/src/application/ticketing_service_tests.rs- update imports/assertions only if identity helpers move; keep behavior assertions intact.atlassian_integration_service_tests.rs,linear_integration_service_tests.rs,clickup_integration_service_tests.rsfor touched fetch behavior, but avoid expanding scope if the new service can use existing fakes.Constraints
CLAUDE.md,src-tauri/CLAUDE.md, code quality, CodeQL path safety, runtime-root, MCP tool alignment, Rust API stability, PR description, and Rust test execution rules before editing.rustfmt --edition 2021only on touched leaf Rust files, notmod.rsroots.Avoid
plugins/app/ralphx-mcp-servertools, schemas, handlers, allowlists, or rebuild requirements in phase 1.content_url,thumbnail_url, Linearurl, ClickUpurl/downloadUrl, auth tokens, secret refs, or raw provider payloads in the returned agent-facing model.attachments_json; fetch provider content through the existing integration services so output is current and provider-neutral.Data / State
retrievableorretrievalStatus.Agent And MCP Surface
agents/*/agent.yaml,config/ralphx.yaml,plugins/app/ralphx-mcp-server/src/tools.ts, or MCP handler route changes are part of this phase.UI / UX
Progression Scenarios
fetch_resource_content; service maps each Jira attachment to safe bounded metadata, redacts URLs, and marks retrievable when a provider content URL exists.fetch_issue_content; service maps Linear attachments fromcontent.attachments, redactsurl/URL-like fields, and marks retrievability based on safe provider metadata presence.fetch_task; service maps task-level attachments and, if intentionally included, comment attachments with source metadata, while redacting all URLs.Decisions
src-tauri/src/application/, not in commands, HTTP handlers, plugins, or infrastructure.TicketingTicketIdentitynormalization rather than inventing a second ticket-reference format.Proof Obligations
Testing Strategy
cargo test --manifest-path src-tauri/Cargo.toml ticket_attachment_service --lib.cargo test --manifest-path src-tauri/Cargo.toml ticketing_service --lib.cargo test --manifest-path src-tauri/Cargo.toml atlassian_integration_service --lib,linear_integration_service --lib, orclickup_integration_service --lib.python3 scripts/check-layering.pyif the new module/export changes application/domain layering.git difffor every touched file, fetch/rebase onto latestorigin/main, push the branch, and open the scoped PR with the required reviewer-focused description.Generated by RalphX