Skip to content

Conversation

@anon-pradip
Copy link
Contributor

@anon-pradip anon-pradip commented Dec 15, 2025

Description

Key Changes

1. CI Pipeline Configuration (.drone.star)

  • Enabled k8s for wopi tests: Set "k8s": True and "skip": False for the wopi test configuration targeting the apiCollaboration suite
  • Set "collaborationServiceNeeded": True to ensure WOPI services are deployed
  • testOcis function: Added appregistry readiness checks and config file validation to prevent race conditions:
    "kubectl -n ocis wait --for=condition=ready pod -l app=appregistry --timeout=60s",
    "kubectl -n ocis exec $(kubectl -n ocis get pod -l app=appregistry -o jsonpath='{.items[0].metadata.name}') -- test -f /etc/ocis/app-registry.yaml && echo 'Config file exists' || (echo 'Config file missing'; exit 1)",

2. WOPI Configuration and Setup

  • injectWopiConfig(): Injects comprehensive WOPI configuration into deployment-values.yaml including:
    • Office suites: FakeOffice, Collabora, OnlyOffice
    • MIME type mappings with default app assignments (e.g., .odt → FakeOffice)
    • WOPI source URLs and postMessage origins
  • patchCollaborationWopiSrc(): Updates Helm templates to use dynamic wopiSrc values from configuration
  • Port forwarding setup: Added getWopiPortForwardCommands() for exposing collaboration services on localhost ports (9300, 9302, 9304, 9305)

3. Feature File Corrections

  • wopi.feature: Updated WOPI URL regex patterns to accept URLs ending with either $ or & for better compatibility
  • checkFileInfo.feature: Changed PostMessageOrigin from hardcoded localhost to dynamic %base_url% pattern

4. Kubernetes Infrastructure

  • FakeOffice service manifests: Added deployment and service YAML files for the FakeOffice WOPI server in k8s
  • Hosting discovery configuration: Enhanced hosting-discovery.xml with comprehensive file extension support and template conversion actions

5. Test Environment Setup

  • Deployment preparation: Modified prepareOcisDeployment() to handle WOPI-specific configurations
  • Service exposure: Added functions to expose collaboration services via NodePort for external access

Technical Details

  • Race condition mitigation: Added explicit waits for appregistry pod readiness and config file presence
  • Dynamic configuration: WOPI settings are injected at deployment time rather than hardcoded
  • Port management: Proper port forwarding for multiple WOPI services (FakeOffice, Collabora, OnlyOffice)
  • MIME type handling: Comprehensive mapping of office document types to appropriate WOPI applications

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@anon-pradip anon-pradip self-assigned this Dec 15, 2025
@anon-pradip anon-pradip force-pushed the test/include-wopi-test-suite-in-k8s branch 28 times, most recently from 9f0c580 to 7624c85 Compare December 18, 2025 06:50
@anon-pradip anon-pradip force-pushed the test/include-wopi-test-suite-in-k8s branch 4 times, most recently from eca3f30 to 2599db2 Compare December 31, 2025 08:49

def patchCollaborationWopiSrc():
"""Force COLLABORATION_WOPI_SRC to use wopiSrc from values"""
return [
Copy link
Contributor Author

@anon-pradip anon-pradip Dec 31, 2025

Choose a reason for hiding this comment

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

sed is avoided because this requires multi-line parsing.

@anon-pradip anon-pradip force-pushed the test/include-wopi-test-suite-in-k8s branch 5 times, most recently from 384fca3 to a0ee820 Compare December 31, 2025 09:26
"sed -i 's|name: sharing-banned-passwords-{{ .appName }}|name: sharing-banned-passwords|' ./charts/ocis/templates/frontend/deployment.yaml",
# Add OCIS_CONFIG_DIR env var to appregistry deployment
"grep -q 'name: OCIS_CONFIG_DIR' ./charts/ocis/templates/appregistry/deployment.yaml || " +
"cat > /tmp/patch_appregistry.py << 'EOF'" + "\n" +
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using Python/awk to reliably insert multi-line YAML — sed's escaping produced invalid YAML.

@anon-pradip anon-pradip force-pushed the test/include-wopi-test-suite-in-k8s branch 7 times, most recently from 0104f9a to 17ac760 Compare December 31, 2025 14:54
@sonarqubecloud
Copy link

@anon-pradip anon-pradip force-pushed the test/include-wopi-test-suite-in-k8s branch 11 times, most recently from fb30d0c to 6a83848 Compare January 1, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants