Skip to content

Feat/parallel execution#176

Draft
Budaa wants to merge 4 commits into
masterfrom
feat/parallel-execution
Draft

Feat/parallel execution#176
Budaa wants to merge 4 commits into
masterfrom
feat/parallel-execution

Conversation

@Budaa
Copy link
Copy Markdown

@Budaa Budaa commented Feb 6, 2026

PR: Add batch & optional-parallel publish + --no-diff flag

Summary

This PR makes the zappifest publish command safe and convenient for monorepos and CI by:

  • Allowing multiple manifest paths (positional args or legacy --manifest).
  • Adding optional parallel publishing using the parallel gem (--parallel NUM).
  • Performing global startup work (token/account validation and metadata fetch) once to avoid redundant network calls.
  • Passing cached Zapp metadata (targets / ui_frameworks) into per-manifest processing to speed up repeated publishes.
  • Introducing --no-diff to skip showing diffs for existing plugins (useful for CI).
  • Preserving backward compatibility and existing error handling.

Motivation

Publishing many plugins from a monorepo previously triggered repeated network calls and interactive prompts which made automated workflows slow and flaky. This patch reduces the "startup tax" and adds optional parallelism while keeping the original interactive and single-manifest flows intact.

High-level changes

  • zappifest publish now accepts both:
    • Positional arguments (e.g. zappifest publish packages/**/manifests/*.json) and
    • The legacy --manifest <path> option.
  • --parallel NUM is optional; if omitted the command runs sequentially.
  • --no-diff skips the interactive diff for updates.
  • Global validation (token/account) and metadata fetching are executed once per run.
  • Per-manifest problems are logged and do not abort the whole batch.

Files changed / added

  • Modified: lib/zappifest.rb
    • Refactored command :publish to accept multiple manifest paths, optional --parallel, and --no-diff.
    • Added helper process_single_manifest for per-plugin processing and clear logging (with [path] prefixes).
  • Modified: lib/plugin_version.rb
    • initialize now reads cached metadata from options (if provided) and falls back to the existing network calls for backwards compatibility.
  • Modified: Gemfile
    • Added parallel to ensure optional parallel runs work in CI/environments where bundler is used.
  • Added: scripts/test_publish.rb
    • A small test harness that stubs network calls and simulates sequential and parallel flows and demonstrates --no-diff behavior.
  • Added: PR_MESSAGE.md (this file)

Behavior (compatibility & safety)

  • Default behaviour is unchanged: without --parallel the command runs sequentially; diffs are shown for updates unless you pass --no-diff.
  • Per-manifest errors (validation, network, etc.) are logged for each manifest and do not stop processing of the other manifests.
  • The refactor keeps the CLI interface backwards-compatible: existing scripts using --manifest will continue to work.

Execution examples

  • Legacy single manifest (unchanged):
zappifest publish --manifest manifests/ios.json
  • Publish a folder of manifests (sequential, default):
zappifest publish packages/**/manifests/*.json
  • Publish in parallel (8 threads):
zappifest publish packages/**/manifests/*.json --parallel 8
  • Publish in parallel and skip diffs (CI-friendly):
zappifest publish packages/**/manifests/*.json --parallel 8 --no-diff
  • Publish sequentially but skip diffs (CI-friendly):
zappifest publish packages/**/manifests/*.json --no-diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant