Skip to content

CLI: Implement WordPress.org sanity checks in since, readme, and versions commands - #2713

Open
wprashed wants to merge 2 commits into
WordPress:trunkfrom
wprashed:fix/1444-sanity-checks-since-readme-versions
Open

wprashed wants to merge 2 commits into
WordPress:trunkfrom
wprashed:fix/1444-sanity-checks-since-readme-versions

Conversation

@wprashed

Copy link
Copy Markdown

Fixes #1444.

Description

Adds a sanity check in the since, readme, and versions CLI commands to ensure that a plugin version detected locally is not already released on WordPress.org before performing replacements or changelog generation.

Changes

  • Created bin/plugin/lib/wporg.js to provide:
    • getWpOrgPluginData(slug): fetches WordPress.org API plugin metadata.
    • compareVersions(v1, v2): semver comparator with prerelease support.
    • isVersionReleased(slug, version): checks whether a given version has already been published.
  • Added bin/plugin/lib/wporg.test.js unit tests covering version comparisons and API checks.
  • Updated since command to skip plugins whose version is already released on WordPress.org (with a warning message).
  • Updated readme command to skip plugins whose stable tag version is already released on WordPress.org.
  • Updated versions command to flag already-released versions with a warning.
  • Added -f, --force flag across all three commands to allow bypassing the WordPress.org sanity check when explicitly desired.

…ions commands

Fixes WordPress#1444.

Add check to ensure that the plugin version detected locally is not already released on WordPress.org before running replacements in 'since' and changelog updates in 'readme'. Also update 'versions' to flag already-released versions, with an optional '-f, --force' flag to bypass the check when needed.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: wprashed <wprashed@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: thelovekesh <thelovekesh@git.wordpress.org>
Co-authored-by: felixarntz <flixos90@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

This branch has not been deployed

No deployments
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.

Implement sanity checks in since, readme, and versions commands

1 participant