Fix semantic versioning parsing #7

Merged
Dalai Felinto merged 1 commits from dfelinto/extensions-website:fix-version into main 2024-01-16 12:12:22 +01:00

The original parser was failing at handling 2.9.3-alpha. And although I
could fix the regex, this patch implements a complete semantic version
support instead, and uses the 'semantic_version' Python module natively
as much as possible.

Note that although this uses the semantic_version library as much as
possible, it has still to implement its own Field to make it
serializable.

The old migrations files had to be updated because the new
VersionStringField will only accept semantic version values (e.g., the
old 0.1 entries would fail now).

On top of that as part of the latest migration we update all the
version-like fields to be compliant with the semantic version. So
existing databases are validated once they migrate.

These models are:

  • abuse.abuse_report (version and extension_version)
  • extensions.version (version, blender_version_min, blender_version_max)
  • releases.release (version)

Remember to ./manage.py migrate after pulling this commit.


How add-ons can have a "-alpha" version, as well as Blender:

image

The original parser was failing at handling 2.9.3-alpha. And although I could fix the regex, this patch implements a complete semantic version support instead, and uses the 'semantic_version' Python module natively as much as possible. Note that although this uses the semantic_version library as much as possible, it has still to implement its own Field to make it serializable. The old migrations files had to be updated because the new VersionStringField will only accept semantic version values (e.g., the old 0.1 entries would fail now). On top of that as part of the latest migration we update all the version-like fields to be compliant with the semantic version. So existing databases are validated once they migrate. These models are: * abuse.abuse_report (version and extension_version) * extensions.version (version, blender_version_min, blender_version_max) * releases.release (version) Remember to ./manage.py migrate after pulling this commit. --- How add-ons can have a "-alpha" version, as well as Blender: ![image](/attachments/80f76060-f0cf-489a-a9a2-c2397cb8ef51)
Dalai Felinto referenced this issue from a commit 2024-01-11 10:42:29 +01:00
Dalai Felinto force-pushed fix-version from 70dc621710 to be1b36b2db 2024-01-11 18:55:25 +01:00 Compare
Dalai Felinto force-pushed fix-version from be1b36b2db to 79cdd560a7 2024-01-11 19:05:44 +01:00 Compare
Dalai Felinto requested review from Francesco Siddi 2024-01-11 19:07:20 +01:00
Francesco Siddi approved these changes 2024-01-16 10:54:28 +01:00
Dalai Felinto merged commit c48094a82a into main 2024-01-16 12:12:22 +01:00
Dalai Felinto deleted branch fix-version 2024-01-16 12:12:22 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/extensions-website#7
No description provided.