Skip to content

Conversation

@jumoog
Copy link
Member

@jumoog jumoog commented Jun 3, 2025

Summary by Sourcery

Add support for JPRM YAML build files in the manifest update GitHub Action by auto-detecting and loading build.yaml/.yml for plugin metadata, falling back to the existing intro-skipper flow when no valid JPRM file is found, and consolidating dispatch, version retrieval, and documentation updates.

New Features:

  • Auto-detect JPRM build files in common project locations
  • Parse JPRM YAML to extract plugin metadata (name, version, targetAbi) for manifest updates

Enhancements:

  • Refactor updateManifest to branch between JPRM-based and legacy intro-skipper flows
  • Unify GitHub dispatch, version lookup, and documentation update logic into shared steps

Build:

  • Add js-yaml dependency and its TypeScript types for YAML parsing

@sourcery-ai
Copy link

sourcery-ai bot commented Jun 3, 2025

Reviewer's Guide

Implements support for JPRM YAML build files by detecting and loading custom build metadata, branching the existing manifest-update logic to accommodate legacy and JPRM paths, and adding a new utility module plus YAML parsing dependencies.

Sequence Diagram: Manifest Update Process with JPRM YAML Option

sequenceDiagram
    participant MainProcess as "updateManifest()"
    participant JPRMUtil as "jprm.ts module"
    participant FileSystem
    participant GitHubAPI

    MainProcess->>JPRMUtil: findBuildYaml()
    JPRMUtil-->>MainProcess: buildYamlPath (e.g., "jprm.yml" or null)

    alt buildYamlPath is found
        MainProcess->>JPRMUtil: loadJPRMBuildFile(buildYamlPath)
        JPRMUtil->>FileSystem: readFileSync(buildYamlPath)
        FileSystem-->>JPRMUtil: yamlContent
        JPRMUtil->>JPRMUtil: Parse YAML content into JPRMBuildConfig
        JPRMUtil-->>MainProcess: jprmConfig: JPRMBuildConfig
        MainProcess->>MainProcess: Create client_payload from jprmConfig
        MainProcess->>FileSystem: getMD5FromFile(zipFileName)
        FileSystem-->>MainProcess: checksum
        MainProcess->>GitHubAPI: POST /dispatches (with JPRM client_payload)
        GitHubAPI-->>MainProcess: API Response
    else buildYamlPath is null (not found or invalid)
        MainProcess->>MainProcess: Execute legacy manifest update logic
        MainProcess->>FileSystem: Read README.md & bug_report_form.yml
        MainProcess->>MainProcess: Determine currentVersion, targetAbi
        MainProcess->>MainProcess: Create client_payload (legacy)
        MainProcess->>GitHubAPI: POST /dispatches (with legacy client_payload)
        GitHubAPI-->>MainProcess: API Response
        MainProcess->>FileSystem: Update README.md
        MainProcess->>FileSystem: Update bug_report_form.yml
    end
Loading

File-Level Changes

Change Details Files
Branch existing validate-and-update-manifest task to detect and handle JPRM build YAML files
  • Import findBuildYaml and loadJPRMBuildFile
  • Call findBuildYaml and conditionally choose legacy vs JPRM logic
  • Encapsulate legacy update logic in the “no YAML” branch
  • Build GitHub dispatch payload using either hard-coded values or YAML fields
  • Refactor README/bug-report template version updates into the legacy branch
src/validate-and-update-manifest.ts
Add jprm.ts utility module for YAML build file operations
  • Implement findBuildYaml scanning common file names
  • Validate JPRM config structure in isValidJPRMBuildFile
  • Provide updateJPRMVersion to bump and persist version
  • Expose loadJPRMBuildFile for reading metadata
src/jprm.ts
Introduce YAML parsing support dependencies
  • Add js-yaml runtime dependency
  • Add @types/js-yaml for TypeScript definitions
package.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

2 participants