Title: `[semver]` allows invalid version number `1.0.0-beta..1`, not allowed by semver.org suggested regex · Issue #21383 · PowerShell/PowerShell · GitHub
Open Graph Title: `[semver]` allows invalid version number `1.0.0-beta..1`, not allowed by semver.org suggested regex · Issue #21383 · PowerShell/PowerShell
X Title: `[semver]` allows invalid version number `1.0.0-beta..1`, not allowed by semver.org suggested regex · Issue #21383 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/21383
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`[semver]` allows invalid version number `1.0.0-beta..1`, not allowed by semver.org suggested regex","articleBody":"### Prerequisites\r\n\r\n- [X] Write a descriptive title.\r\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\r\n- [X] Search the existing issues.\r\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\r\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://learn.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\r\n\r\n### Steps to reproduce\r\n\r\nHere are some examples of invalid semantic versioning version numbers that are not valid by semver.org suggested regex:\r\n\r\n* \u003chttps://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\u003e\r\n\r\n```powershell\r\n## Should work\r\n[semver]'1'\r\n[semver]'1.0.0'\r\n[semver]'1.0.0-beta'\r\n[semver]'1.0.0-beta1'\r\n[semver]'1.0.0-beta.1'\r\n\r\n## Should error but doesn't\r\n[semver]'1.0.0-beta..1'\r\n[semver]'1.0.0-beta...1'\r\n\r\n## Should error and does\r\n[semver]'1.0.0-beta!1'\r\n```\r\n\r\nThis tells me `[semver]` isn't fully compliant with [semantic versioning v2.0.0](https://semver.org/spec/v2.0.0.html).\r\n\r\nAdditional search tags:\r\n\r\n* `SemanticVersion`, `[SemanticVersion]`\r\n* `System.Management.Automation.SemanticVersion`, `[System.Management.Automation.SemanticVersion]`\r\n\r\n### Expected behavior\r\nFollow semver specification. Throw an error on non-valid version numbers. Like with `[semver]'1.0.0-beta!1'` which gives:\r\n\r\n```console\r\nInvalidArgument: Cannot convert value \"1.0.0-beta!1\" to type \"System.Management.Automation.SemanticVersion\". Error: \"The input string '' was not in a correct format.\"\r\n```\r\n\r\n\r\n### Actual behavior\r\n\r\n```console\r\nPS \u003e [semver]'1.0.0-beta...1'\r\n\r\nMajor Minor Patch PreReleaseLabel BuildLabel\r\n----- ----- ----- --------------- ----------\r\n1 0 0 beta...1\r\n\r\nPS \u003e\r\n```\r\n\r\n\r\n### Error details\r\n\r\n_No response_\r\n\r\n### Environment data\r\n\r\n* PowerShell v7.4.1 x64\r\n* Windows 11 23H2 x64\r\n\r\n### Visuals\r\n\r\n_No response_","author":{"url":"https://github.com/o-l-a-v","@type":"Person","name":"o-l-a-v"},"datePublished":"2024-03-27T15:19:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/21383/PowerShell/issues/21383"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9150fb97-000c-6bd8-ec95-ea5e3f3ed918 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84F0:3CBD01:51EE49:6E8484:6A56956F |
| html-safe-nonce | 94e49a96f3d075893864df7f3abd2bb475d3a6f99049f99d05578a83d2a6060d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEYwOjNDQkQwMTo1MUVFNDk6NkU4NDg0OjZBNTY5NTZGIiwidmlzaXRvcl9pZCI6IjIyMzIwOTE5NTAwMDk3MTgxMjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 93e594da7ee47267fc4f7b840eaef777c5a582762dc81aaab90948210485868c |
| hovercard-subject-tag | issue:2211088541 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/21383/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e03b7f876bf60f0c9337a4152d01c862e3f2fec4f6fae6fb59d2a545150ba90d/PowerShell/PowerShell/issues/21383 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e03b7f876bf60f0c9337a4152d01c862e3f2fec4f6fae6fb59d2a545150ba90d/PowerShell/PowerShell/issues/21383 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | o-l-a-v |
| hostname | github.com |
| expected-hostname | github.com |
| None | 647a25f437e2f54eccdd162bd007c8ae70f4235c4125dba0f4518747cc8b9615 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 05adb86a60ce3d701e556eded3ab26300ec6bcc4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width