Skip to content

chore: fix generator script for dev versions #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Orkuncakilkaya
Copy link
Contributor

No description provided.

Copy link
Contributor

github-actions bot commented May 6, 2025

🟢 Coverage increased by 35.52%

Code Coverage Report

Coverage Report

St. Category Percentage Covered / Total
🔴 Statements 35.52% 1630 / 4589
🔴 Functions 29.53% 650 / 2201
Files Coverage
St. File Methods Statements Total Coverage
🔴 src/Model/BotdBotResult.php 0.00% 0.00% 0.00%
🔴 src/Model/ErrorCode.php 0.00% 0.00% 0.00%
🔴 src/Model/ModelInterface.php 0.00% 0.00% 0.00%
🔴 src/Model/VPNConfidence.php 0.00% 0.00% 0.00%

TheUnderScorer
TheUnderScorer previously approved these changes May 6, 2025
Copy link
Contributor

github-actions bot commented May 6, 2025

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

VERSION="${_temp_part//-/.}-dev"
elif [[ $VERSION == *-dev* ]]; then
_temp_part=${VERSION#*-dev}
_temp_part=${_temp_part//-/.}
Copy link
Contributor

@erayaydin erayaydin May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For stability to be recognized as dev, the version needs to follow the SemVer spec like X.Y.Z-dev+M. You can use this regex and the snippet below to test this.

<?php

use Composer\Semver\VersionParser;

include "../vendor/autoload.php";

var_dump(VersionParser::parseStability("6.5.0-dev.0")); // "stable"
var_dump(VersionParser::parseStability("6.5.0-dev+0")); // "dev"

I also suggest using -alpha, -beta, or -rc, since -dev and dev- have special meanings in Composer. Then we can use 6.5.0-rc and 6.5.0-rc.1

VERSION="dev-$SANITIZED_VERSION-$BUILD_VERSION"
VERSION=${VERSION//develop/dev}

if [[ $VERSION =~ ^dev[.-]([0-9]+)[.-]([0-9]+)[.-]([0-9]+)[.-]([0-9]+)$ ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comments with the examples for each case so as not to spend time on this next time when we need to edit.

@Orkuncakilkaya Orkuncakilkaya marked this pull request as draft May 7, 2025 09:08
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.

4 participants