Skip to content

A constraint with a pre-release and a feature suffix matches nothing #151

Closed

Description

@roxblnfk

Description

A version constraint that combines a numbered pre-release with a feature suffix matches nothing, even the release with exactly that tag.

Constraint cuts only a whole --separated stability keyword off the suffix, so beta.1-feature stays the feature suffix. Version reads beta.1 as the stability and keeps only feature as the suffix. The str_contains() check then never passes.

Expected: 3.5.0-beta.1-feature matches v3.5.0-beta.1-feature and nothing else, the same way 3.5.0-beta.1 names one release after #150.

Steps to reproduce

use Internal\DLoad\Module\Version\{Constraint, Version};

Constraint::fromConstraintString('3.5.0-beta.1-feature')
    ->isSatisfiedBy(Version::fromVersionString('v3.5.0-beta.1-feature')); // false
Constraint Release Result Constraint's feature suffix Version's suffix
3.5.0-beta.1-feature v3.5.0-beta.1-feature false beta.1-feature feature
^2.12.0-alpha.1-feature 2.12.0-alpha.1-feature false alpha.1-feature feature
^3.5.0-feature@beta v3.5.0-beta.1-feature true feature feature

The last row is the workaround: drop the pre-release number and give the stability with @.

Additional context

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions