Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
7d13c96e
Commit
7d13c96e
authored
Jun 16, 2021
by
Guilhem Saurel
Browse files
properly parse release tags
parent
881eb7b0
Pipeline
#14964
failed with stage
in 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
7d13c96e
...
@@ -369,9 +369,15 @@ class Project(Links, NamedModel, TimeStampedModel):
...
@@ -369,9 +369,15 @@ class Project(Links, NamedModel, TimeStampedModel):
self
.
update_repo
()
self
.
update_repo
()
tags
=
self
.
tag_set
.
filter
(
name__startswith
=
'v'
)
# TODO: implement SQL ordering for semver
tags
=
self
.
tag_set
.
filter
(
name__startswith
=
'v'
)
# TODO: implement SQL ordering for semver
if
tags
.
exists
():
if
tags
.
exists
():
self
.
version
=
'%i.%i.%i'
%
sorted
(
releases
=
[]
tuple
(
int
(
v
)
for
v
in
t
.
name
[
1
:].
split
(
'.'
))
for
tag
in
tags
:
for
t
in
tags
if
not
any
(
v
in
t
.
name
for
v
in
[
'-'
,
'rc'
]))[
-
1
]
try
:
release
=
tuple
(
int
(
v
)
for
v
in
tag
.
name
[
1
:].
split
(
'.'
))
releases
.
append
(
release
)
except
ValueError
:
pass
if
releases
:
self
.
version
=
'%i.%i.%i'
%
sorted
(
releases
)[
-
1
]
robotpkg
=
self
.
robotpkg_set
.
order_by
(
'-updated'
).
first
()
robotpkg
=
self
.
robotpkg_set
.
order_by
(
'-updated'
).
first
()
branch
=
self
.
branch_set
.
order_by
(
'-updated'
).
first
()
branch
=
self
.
branch_set
.
order_by
(
'-updated'
).
first
()
branch_updated
=
branch
is
not
None
and
branch
.
updated
is
not
None
branch_updated
=
branch
is
not
None
and
branch
.
updated
is
not
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment