Repository navigation
web publish: replace MinIO backend with My Pages - #153
Merged
Merged
Conversation
Add a new opt-in publish path that uses osaas-deploy-manager's /mypages API instead of provisioning a dedicated minio-minio instance per site. The existing default (direct MinIO bucket per site) is unchanged. - packages/web/src/mypage.ts: new module implementing the POST /mypages -> POST /mypages/:id/upload-urls -> POST /mypages/:id/publish flow. Uploads are real multipart S3 POST policy submissions built with `form-data`, streamed from disk (no base64). Retries on 503 using the server's Retry-After header (~60s budget), fails fast on 409 name collisions, chunks upload-urls requests at the server's 500-files-per- request cap, and surfaces the specific file that failed an upload rather than continuing silently. - packages/web/src/index.ts: export the new publishToMyPages function and its types. - packages/cli/src/web/cmd.ts: add `--backend <backend>` to `osc web publish` (minio [default] | mypages). - packages/web/package.json: add `form-data` as a direct dependency (was already transitive via other deps). - Docs: packages/cli/readme.md and packages/web/README.md. Closes #152 Co-Authored-By: Claude <noreply@anthropic.com>
Scope correction requested by birme on issue #152: `osc web publish` now uses the My Pages backend (osaas-deploy-manager's /mypages API) unconditionally, replacing the direct-MinIO implementation rather than adding it as an opt-in `--backend mypages` flag. - packages/cli/src/web/cmd.ts: removed the `--backend`/`-s, --sync` options and the minio/mypages branching; `web publish` now always calls publishToMyPages(). The regression note about cdn-create/custom domains not being available for My Pages sites is preserved. - packages/web/src/publish.ts and packages/web/src/bucket.ts deleted (dead code — no remaining callers after removing the minio branch; confirmed no other package imports either module, and cdn.ts has no code dependency on them). - packages/web/src/mime.d.ts deleted (only used by bucket.ts). - packages/web/src/index.ts: removed the `publish` export. - packages/web/examples/publish-website.ts: updated to call publishToMyPages instead of the deleted publish(). - Docs (packages/cli/readme.md, packages/web/README.md) updated to document web publish as directly using My Pages, with a prominent breaking-change note for anyone who was chaining `web publish` output into `web cdn-create` for a custom domain. - Added packages/cli/src/web/cmd.test.ts confirming the --backend option no longer exists and that publish unconditionally calls publishToMyPages, including the success/error/regression-note paths. The mypage.ts implementation, its auth pattern, and its 19 existing unit tests are unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
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
Scope correction (2026-08-31): this PR originally shipped an opt-in
--backend mypagesflag. Per birme's explicit scope update on issue #152, this is now a true replacement:osc web publish <name> <dir>unconditionally publishes viaosaas-deploy-manager's/mypagesAPI. There is no flag and no conditional branching — the old direct-MinIO path has been removed.# the only publish path now osc web publish mysite ./distweb publishused to provision a dedicated MinIO bucket per site and print an "Origin / Origin Path" block so users could manually chainosc web cdn-createafterwards to front the bucket with a CloudFront distribution / custom domain. That workflow is gone. My Pages uses one shared per-tenant storage instance across all of a tenant's pages, not a bucket-per-site — there is nothing forcdn-createto target. Custom domains/CDN in front of a My Pages site are not yet supported (Eyevinn/osaas-deploy-manager#1409, open/unimplemented). Anyone relying on the old bucket +cdn-createflow needs to hold off upgrading until #1409 ships.What was verified against source (not guessed)
packages/cli/src/web/cmd.ts,packages/web/src/{publish,bucket,cdn,mypage,index}.tsread directly in this repo before writing any code./mypagesAPI contract (request/response shapes, status codes,MAX_PAGE_FILE_SIZE_BYTES= 25 MiB,MAX_UPLOAD_FILES_PER_REQUEST= 500,MAX_PAGE_MANIFEST_FILES= 5000, page-name regex, file-path validation) was verified in the original implementation by readingEyevinn/osaas-deploy-manager'ssrc/apps/mypage.ts/src/api_mypages.tsonmain— unchanged in this correction.grep -rn "from.*['\"].*bucket['\"]"/...publish['\"]acrosspackages/that nothing outside the deleted files importedpublish.ts/bucket.ts, and thatweb cdn-create(packages/web/src/cdn.ts) has zero code dependency on either — the coupling was workflow-only (see breaking-change note above).What changed in this correction
packages/cli/src/web/cmd.ts: removed the--backend <backend>option and the-s, --sync(minio-only) option, and allminio/mypagesbranching.web publishnow always callspublishToMyPages(). The custom-domain/CDN regression note is now printed unconditionally after every successful publish.packages/web/src/publish.tsandpackages/web/src/bucket.ts— dead code once the minio branch is gone. No other package or example imports either module after this change (confirmed by grep acrosspackages/).packages/web/src/mime.d.ts— only used by the now-deletedbucket.ts.packages/web/src/index.ts: removed thepublishexport.packages/web/examples/publish-website.ts: updated to callpublishToMyPagesinstead of the deletedpublish().packages/cli/readme.mdandpackages/web/README.mdnow documentweb publishas directly using My Pages, with the breaking-change/regression note kept prominent.packages/cli/src/web/cmd.test.ts(5 tests) confirming the--backendoption no longer exists on the command and thatpublishunconditionally callspublishToMyPages, including success, error, and regression-note-printed paths. The 19 existingmypage.tsunit tests are untouched and still pass — they were already testing the correct code path.Testing
npx lerna run typecheck— clean (this triggers the dependency build chain first; a bare per-packagetsc --noEmitin a fresh clone gives phantom errors because@osaas/client-web'slib/isn't built yet).npx lerna run lint— 0 errors (only pre-existing unrelatedno-explicit-anywarnings inintercom/cmd.tsanduser/util.ts).npx lerna run pretty(repo-wide--check) — clean.npx lerna run test— all 10 projects pass, 336 tests total (19 inpackages/web, all inmypage.test.ts; new + existingpackages/clitests pass).Lessons
The original PR's implementation of the
/mypagesAPI integration (mypage.ts), its retry/error handling, and its 19 unit tests were already correct and needed no changes — only the CLI's invocation model was wrong. When a scope-change correction lands on an existing PR, it's worth explicitly re-verifying which parts of the prior work are still sound (via source/test re-run) rather than re-doing everything from scratch. Separately:nx.json'stypecheck: { dependsOn: ["build"] }meanslerna run typechecksilently builds every workspace package'slib/as a side effect — that's whylerna run testafterward can resolve@osaas/client-web's type declarations; runningtestas the very first command in a fresh clone (skippingtypecheck) would fail withTS2307module-not-found.Closes #152
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com