-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: unassign * first draft * WIP: introduce BaseEvent and subclasses, VStage, Version * fix 'gto show name' * fix 'gto history' * fix 'gto check-ref' * adding unassign to 'history' and enabling it in 'show model' * filter out lw tags later to speed up the git tags parsing * add 'last-assignments-per-version' and 'last-versions-per-stage' flags * fix 'which' and add --av and --vs * add deregister and deprecate to README * renamings: not implemented yet * more details in readme + register an artifact * add summary for GS * minor readme update * fix tests * add deregister and parse git tags with regexp * fix test, update readme * Update README.md Co-authored-by: tapadipti <[email protected]> * fix readme * Update README.md * update README with command * fix couple of things in README * WIP: add 'tag' instead of 'register' and 'promote', add 'deprecate' * add explanations to creating git tags - update README * implement --delete * add 'git push' suggestion * escape '!' in git commands suggestions * delete tag2 tests * readme update: use deprecate instead of unassign and deregister * fix tests and add --force to register * return deregister and unassign to API: it's clearer * rename deregister to unregister * fix deprecate in CLI Co-authored-by: tapadipti <[email protected]>
- Loading branch information
Showing
21 changed files
with
2,206 additions
and
981 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,42 @@ | ||
import re | ||
from enum import Enum | ||
|
||
COMMIT = "commit" | ||
REF = "ref" | ||
# COMMIT = "commit" | ||
TAG = "tag" | ||
# BRANCH = "branch" | ||
# FILE = "file" | ||
|
||
ARTIFACT = "artifact" | ||
ACTION = "action" | ||
TYPE = "type" | ||
NAME = "name" | ||
PATH = "path" | ||
VERSION = "version" | ||
STAGE = "stage" | ||
NUMBER = "number" | ||
COUNTER = "counter" | ||
|
||
|
||
class Action(Enum): | ||
CREATE = "create" | ||
DEPRECATE = "deprecate" | ||
DEREGISTER = "deregister" | ||
REGISTER = "register" | ||
ASSIGN = "assign" | ||
UNASSIGN = "unassign" | ||
|
||
|
||
class Event(Enum): | ||
COMMIT = "commit" | ||
REGISTRATION = "registration" | ||
ASSIGNMENT = "assignment" | ||
name = "[a-z][a-z0-9-/]*[a-z0-9]" | ||
semver = r"(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?" | ||
counter = "?P<counter>[0-9]+" | ||
name_regexp = re.compile(f"^{name}$") | ||
tag_regexp = re.compile( | ||
f"^(?P<artifact>{name})(((#(?P<stage>{name})|@(?P<version>v{semver}))(?P<cancel>!?))|@((?P<deprecated>deprecated)|(?P<created>created)))(#({counter}))?$" | ||
) | ||
|
||
|
||
class VersionSort(Enum): | ||
SemVer = "semver" | ||
Timestamp = "timestamp" | ||
|
||
|
||
ASSIGNMENTS_PER_VERSION = -1 | ||
VERSIONS_PER_STAGE = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.