Skip to content

Integration test: Attachment URL conversion with NRS issues #59

@CybotTM

Description

@CybotTM

Summary

Test the attachment URL conversion feature with real NRS project issues to verify:

  1. Attachment mapping is created correctly during attachment migration
  2. Description and comment attachment references convert to OpenProject API URLs
  3. Images display correctly in OpenProject after migration

Related Work

This follows the implementation of proper attachment URL conversion:

  • markdown_converter.py now accepts attachment_mapping parameter
  • attachments_migration.py saves attachment_mapping.json after migration
  • work_package_content_migration.py loads mapping and passes to converter

Test Plan

Prerequisites

  • Run work_packages_skeleton migration for NRS project
  • Run attachments migration for NRS project

Test Steps

  1. Select 10 NRS issues with attachments (images and documents)
  2. Run work_packages_content migration
  3. Verify in OpenProject:
    • Images render correctly in descriptions
    • Attachment links resolve to correct files
    • No broken ![](filename.png) references

Expected Results

  • Images show as ![alt](/api/v3/attachments/{id}/content) in markdown
  • Clicking image links downloads correct file
  • Document links work correctly

Files Modified

  • src/utils/markdown_converter.py
  • src/migrations/attachments_migration.py
  • src/migrations/work_package_content_migration.py
  • src/migrations/work_package_migration.py
  • config/config.yaml
  • tests/unit/test_markdown_converter.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions