Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
d424795c
Commit
d424795c
authored
6 months ago
by
Bastien Abadie
Committed by
Erwan Rouchet
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Detect system workers version mismatch through pre-commit
parent
c724cd2b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2453
Detect system workers version mismatch through pre-commit
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.pre-commit-config.yaml
+9
-0
9 additions, 0 deletions
.pre-commit-config.yaml
Makefile
+1
-1
1 addition, 1 deletion
Makefile
ci/check_system_workers.py
+28
-0
28 additions, 0 deletions
ci/check_system_workers.py
with
38 additions
and
1 deletion
.pre-commit-config.yaml
+
9
−
0
View file @
d424795c
...
...
@@ -41,3 +41,12 @@ repos:
args
:
[
'
1000'
]
# Only run on Arkindex unit test files
files
:
'
^arkindex\/[^\/]*\/tests\/(.*\/)?test_.*\.py'
-
repo
:
local
hooks
:
-
id
:
check-system-workers-version
name
:
Check system workers version matches current Arkindex version
entry
:
python ci/check_system_workers.py
language
:
system
pass_filenames
:
false
files
:
'
^(VERSION|arkindex/system_workers.yml)$'
This diff is collapsed.
Click to expand it.
Makefile
+
1
−
1
View file @
d424795c
...
...
@@ -47,7 +47,7 @@ schema:
release
:
$(
eval
version:
=
$(
shell
cat
VERSION
))
echo
$(
version
)
git commit VERSION
-m
"Version
$(
version
)
"
git commit VERSION
arkindex/system_workers.yml
-m
"Version
$(
version
)
"
git tag
$(
version
)
git push origin master
$(
version
)
...
...
This diff is collapsed.
Click to expand it.
ci/check_system_workers.py
0 → 100644
+
28
−
0
View file @
d424795c
import
sys
from
pathlib
import
Path
import
yaml
ROOT
=
Path
(
__file__
).
parent
.
parent
def
check_versions_match
():
system_workers_file
=
ROOT
/
"
arkindex
"
/
"
system_workers.yml
"
assert
system_workers_file
.
exists
(),
f
"
Missing system workers file in
{
system_workers_file
}
"
version_file
=
ROOT
/
"
VERSION
"
assert
version_file
.
exists
(),
f
"
Missing version file in
{
version_file
}
"
version
=
version_file
.
read_text
().
strip
()
system_workers
=
yaml
.
safe_load
(
system_workers_file
.
open
())
assert
system_workers
[
"
version
"
]
==
version
,
f
"
Version mismatch between VERSION (
{
version
}
) and system worker (
{
system_workers
[
'
version
'
]
}
)
"
if
__name__
==
"
__main__
"
:
try
:
check_versions_match
()
except
AssertionError
as
e
:
print
(
f
"
[ERROR]
{
e
}
"
)
sys
.
exit
(
1
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment