Skip to content

Updated OpenApiDocs to use Cloud shared storage if available, #PG-4593#27

Merged
lachiebol merged 5 commits into
5.x-devfrom
PG-4593-shared-storage
Apr 8, 2026
Merged

Updated OpenApiDocs to use Cloud shared storage if available, #PG-4593#27
lachiebol merged 5 commits into
5.x-devfrom
PG-4593-shared-storage

Conversation

@lachiebol
Copy link
Copy Markdown
Contributor

@lachiebol lachiebol commented Apr 7, 2026

Description

Updated to use a path resolver instead of hardcoding paths for specs and annotations, if Cloud plugin is enabled and CloudDistributedCachePath is available we use that. If not, we default back to /tmp/

Also cleaned up file writing into it's own class, if we need to make some changes to support anything cloud related this should make it simpler.

If cloud is enabled and you run:
openapidocs:generate-spec-file --plugin Funnels --not-dry-run --add-annotations

Your files will appear in /var/www/html/cache/distributed/OpenApiDocs

If cloud is disabled they'll just appear as usual

Issue No

Steps to Replicate the Issue

Checklist

  • [✔] Tested locally or on demo2/demo3?
  • [✔] New test case added/updated?
  • [NA] Are all newly added texts included via translation?
  • [NA] Are text sanitized properly? (Eg use of v-text v/s v-html for vue)
  • [NA] Version bumped?

…if on Cloud, it will use CloudDistributedCachePath, else, it will use /tmp in the plugin
@lachiebol lachiebol requested a review from AltamashShaikh April 7, 2026 22:23
@lachiebol lachiebol added the Needs Review For pull requests that need a code review. label Apr 7, 2026
@lachiebol lachiebol changed the title Moved API documentation from hard coded paths to a resolver service, … Updated OpenApiDocs to use Cloud shared storage if available, #PG-4593 Apr 7, 2026
Comment thread Specs/PathResolver.php
Copy link
Copy Markdown

@marcel-innocraft marcel-innocraft Apr 7, 2026

Choose a reason for hiding this comment

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

Looks good to me from a Cloud perspective! 👍
May want is_dir() + is_writable() checks within getSharedArtifactDirectory() just in case the folder didn't exist or permissions weren't incorrectly set. Either would be highly unlikely given how much it's used though.

AltamashShaikh
AltamashShaikh previously approved these changes Apr 8, 2026
Copy link
Copy Markdown
Contributor

@AltamashShaikh AltamashShaikh left a comment

Choose a reason for hiding this comment

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

LGTM and I can see the files being stored in plugins/OpenApiDocs/tmp/specs when Cloud plugin is disabled and in cache/distributed/OpenApiDocs/specs/ folder when Cloud plugin is enabled.

@lachiebol lachiebol merged commit 8a8a1d1 into 5.x-dev Apr 8, 2026
7 checks passed
@lachiebol lachiebol deleted the PG-4593-shared-storage branch April 8, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review For pull requests that need a code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants