Skip to content

Check if strict_max_version in manifest.json is synchronized with the latest beta version #177

@northword

Description

@northword

Clear and concise description of the problem

/

Suggested solution

During the build, fetch the latest Zotero version number from the Zotero API:

// https://www.zotero.org/download/client/version?channel=beta
{
    "mac": "9.0-beta.21+1a89239a1",
    "win-x64": "9.0-beta.21+1a89239a1",
    "win-arm64": "9.0-beta.21+1a89239a1",
    "win32": "9.0-beta.21+1a89239a1",
    "linux-x86_64": "9.0-beta.21+1a89239a1",
    "linux-i686": "9.0-beta.21+1a89239a1",
    "linux-arm64": "9.0-beta.21+1a89239a1"
}
// https://www.zotero.org/download/client/version?channel=release
{
    "mac": "9.0",
    "win-x64": "9.0",
    "win-arm64": "9.0",
    "win32": "9.0",
    "linux-x86_64": "9.0",
    "linux-i686": "9.0",
    "linux-arm64": "9.0"
}

The fetch results should be written to the file .scaffold/cacahe/zotero-version.json with the last timestamp of retrieval; items already retrieved within the last 3 days should not be fetched again.

// .scaffold/cacahe/zotero-version.json
{
  "lastUpdated": "",
  "release": {
    "mac": "9.0",
    "win-x64": "9.0",
    "win-arm64": "9.0",
    "win32": "9.0",
    "linux-x86_64": "9.0",
    "linux-i686": "9.0",
    "linux-arm64": "9.0"
  },
  "beta": {
    "mac": "9.0-beta.21+1a89239a1",
    "win-x64": "9.0-beta.21+1a89239a1",
    "win-arm64": "9.0-beta.21+1a89239a1",
    "win32": "9.0-beta.21+1a89239a1",
    "linux-x86_64": "9.0-beta.21+1a89239a1",
    "linux-i686": "9.0-beta.21+1a89239a1",
    "linux-arm64": "9.0-beta.21+1a89239a1"
  }
}

Then check the user plugin's manifest.json:

  1. If the user provides strict_max_version
    1. If strict_max_version >= the latest Zotero stable / beta version, nothing to do
    2. If strict_max_version < the latest Zotero stable / beta version, log a warning and print the command to quickly modify this field
  2. If the user does not provide strict_max_version, log and automatically fill it with the latest Zotero beta major version number + 1

Additionally, a script can be provided to help users quickly modify this field. This script may need to accept the path of the manifest.json file, and if not provided, it can look for manifest.json in the current working directory.

Additional context

https://groups.google.com/g/zotero-dev/c/_6OxdXeFnUI/m/0hLaEzapAAAJ

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions