Skip to content

Commit

Permalink
4.0.0
Browse files Browse the repository at this point in the history
### BREAKING CHANGES:
- Removed uWSGI as main server.
- Setting ``addrport`` migrated to ``[web]`` section.
- Dropped support of ``Centrifugo`` versions less than 5 (now require ``allow_subscribe_for_client`` enabled).
- Dropped support for ``MariaDB`` 10.4, PostgreSQL 12 and less.
- Dropped support for ``Python`` less 3.10.
- Dropped support for ``MySQL`` less 8.0.11.
- The minimum supported version of ``SQLite`` is increased from 3.21.0 to 3.27.0.
- Migrated to ``Django`` 5.1.
- ``Pagination-Identifiers`` used to send duplicate values before, but now they can't.
- ``Pagination-Identifiers`` are now sorted independently of the order in the results.
- Migrated to ``OAuth2`` authentication model (internal server API).
- Disabled session auth for swagger ui and API.
- ``msgpack`` is used as default serializer for celery instead of ``pickle`` for security and performance reasons.
- Migrated to pyproject.

### Changelog:
- Feature(UI): Custom users tokens for authentication (for integrations and automation).
- Feature(api): Complete migration to uvicorn and asyncio web-server.
- Feature(api): New ``web_worker`` command to start webserver (without celery worker).
- Feature(api): Migrate to JWT authentication.
- Feature(api): ``Python`` 3.13 support.
- Feature(api): Latest Ansible versions support.
- Feature(api): Add tarantool drivers for celery.
- Feature(api): Add support for django cache in tarantool.
- Feature(docker): Migrate base image to python 3.12.
- Fix(api): Other performance enhances.
- Fix(api): Valid Swagger 2.0 schema generation for some custom fields.
- Fix(api): Support SQS fifo queues.
- Fix(plugins): Provide model instances in custom plugin execution.
- Refactoring(build): Migrate to pyproject.

See merge request polemarch/ce!313
  • Loading branch information
onegreyonewhite committed Jan 15, 2025
2 parents 2e439f2 + c667baf commit aacc181
Show file tree
Hide file tree
Showing 127 changed files with 5,804 additions and 6,027 deletions.
35 changes: 0 additions & 35 deletions .coveragerc

This file was deleted.

1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ dist
!ce/doc
!ce/package.json
!ce/frontend_src
!ce/webpack.config.js
!ce/.dockerignore
!ce/requirements.txt
!ce/requirements-doc.txt
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ env
*.pid
*nbproject
pylint_*
index.html
.idea/*
/polemarch.egg-info/
/polemarch/projects/
Expand Down Expand Up @@ -136,6 +135,7 @@ venv.bak/
# Frontend
node_modules
polemarch/static/polemarch
polemarch/static/spa
yarn-error.log

# werf and helm
Expand Down
26 changes: 12 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# set to local images because too long execution
default:
image: registry.gitlab.com/vstconsulting/images:ubuntu-v2
image: registry.gitlab.com/vstconsulting/images:ubuntu-v4

variables:
GET_SOURCES_ATTEMPTS: 3
Expand All @@ -9,7 +9,6 @@ variables:
DJANGO_LOG_LEVEL: 'DEBUG'
TOX_ARGS: "--workdir /cache/.tox_polemarch_${CI_BUILD_REF_NAME}"
CCACHE_DIR: /cache/.ccache
CC: ccache gcc
DOCKER_DRIVER: "overlay2"
REGISTRY_IMAGE: "${CI_REGISTRY_IMAGE}"
REGISTRY_IMAGE_TAG: "${KUBE_NAMESPACE}"
Expand All @@ -34,7 +33,7 @@ stages:
###########################################
.branch_tests_template: &branch_tests
stage: test
image: registry.gitlab.com/vstconsulting/images:ubuntu-v2
image: registry.gitlab.com/vstconsulting/images:ubuntu-v4
coverage: '/\d+\%\s*$/'
variables:
TOX_ENVS: ""
Expand All @@ -60,7 +59,7 @@ stages:

.js_tests_template: &branch_js_tests
<<: *branch_tests
image: registry.gitlab.com/vstconsulting/images:node18-tests
image: registry.gitlab.com/vstconsulting/images:node20-tests
before_script:
- yarn install --pure-lockfile --mutex network
script:
Expand All @@ -72,11 +71,8 @@ stages:
code_style:
<<: *branch_tests
stage: code_standarts
parallel:
matrix:
- TOX_ENVS:
- flake
- pylint
variables:
TOX_ENVS: "flake,pylint"

js_style:
<<: *branch_js_tests
Expand All @@ -87,18 +83,20 @@ js_style:

functional_test:
<<: *branch_tests
needs: ["code_style"]
parallel:
matrix:
- TOX_ENVS:
- py38-install
- py310-install
- TOX_ENVS:
- py311-coverage
- py312-coverage


# Realese
###########################################
release:
stage: release
image: registry.gitlab.com/vstconsulting/images:ubuntu-v2
image: registry.gitlab.com/vstconsulting/images:ubuntu-v4
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $GIT_ACCESS_USER && $GIT_ACCESS_PASSWORD'
when: on_success
Expand Down Expand Up @@ -126,7 +124,7 @@ pages:

release_pypi:
stage: release
image: registry.gitlab.com/vstconsulting/images:build
image: registry.gitlab.com/vstconsulting/images:manylinux_2_17
rules:
- if: '$CI_COMMIT_TAG && $PYPI_UPLOAD_PASSWORD && $PYPI_UPLOAD_NAME'
when: on_success
Expand Down Expand Up @@ -162,7 +160,7 @@ publish_docker:

publish_release:
stage: publish
image: registry.gitlab.com/vstconsulting/images:ubuntu-v2
image: registry.gitlab.com/vstconsulting/images:ubuntu-v4
allow_failure: true
needs: ["release_pypi"]
rules:
Expand Down
17 changes: 8 additions & 9 deletions .helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ centrifugo:
namespaces: []
fullnameOverride: centrifugo
image:
tag: v3.2
tag: v5
ingress:
enabled: false
secrets:
Expand Down Expand Up @@ -68,11 +68,12 @@ polemarch:
requests:
storage: 5Gi
livenessProbe:
exec:
command:
- /bin/sh
- -c
- "ps -A | grep uwsgi"
httpGet:
httpHeaders:
- name: Connection
value: keep-alive
path: /api/live/
port: 8080
initialDelaySeconds: 10
periodSeconds: 20
timeoutSeconds: 15
Expand All @@ -99,9 +100,7 @@ polemarch:
projects_dir = /storage/projects
hooks_dir = /storage/hooks
[uwsgi]
daemon = false
pidfile = /tmp/web.pid
[web]
addrport = 0.0.0.0:8080
[centrifugo]
Expand Down
4 changes: 0 additions & 4 deletions .pep8

This file was deleted.

57 changes: 3 additions & 54 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ unsafe-load-any-extension=no
# run arbitrary code
extension-pkg-whitelist=

# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
# be used to obtain the result of joining multiple strings with the addition
# operator. Joining a lot of strings can lead to a maximum recursion error in
# Pylint and this flag can prevent that. It has one side effect, the resulting
# AST will be different than the one from reality. This option is deprecated
# and it will be removed in Pylint 2.0.
optimize-ast=no


[MESSAGES CONTROL]

Expand All @@ -65,7 +56,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=logging-fstring-interpolation,unexpected-keyword-arg,no-name-in-module,useless-super-delegation,len-as-condition,super-init-not-called,keyword-arg-before-vararg,no-else-return,no-self-argument,inconsistent-return-statements,unsubscriptable-object,too-many-branches,deprecated-lambda,old-style-class,no-init,expression-not-assigned,broad-except,logging-format-interpolation,model-no-explicit-unicode,too-many-ancestors,bad-continuation,bad-whitespace,redefined-builtin,missing-docstring,redefined-variable-type,no-self-use,line-too-long,suppressed-message,cmp-method,no-absolute-import,xrange-builtin,using-cmp-argument,basestring-builtin,backtick,unpacking-in-except,old-raise-syntax,getslice-method,long-builtin,print-statement,reduce-builtin,filter-builtin-not-iterating,import-star-module-level,unichr-builtin,dict-iter-method,range-builtin-not-iterating,file-builtin,old-division,standarderror-builtin,coerce-builtin,setslice-method,old-ne-operator,long-suffix,execfile-builtin,oct-method,metaclass-assignment,intern-builtin,apply-builtin,dict-view-method,raw_input-builtin,raising-string,coerce-method,unicode-builtin,next-method-called,hex-method,nonzero-method,round-builtin,cmp-builtin,reload-builtin,buffer-builtin,useless-suppression,zip-builtin-not-iterating,indexing-exception,map-builtin-not-iterating,delslice-method,old-octal-literal,input-builtin,parameter-unpacking,model-has-unicode,bare-except,too-few-public-methods,fixme,dangerous-default-value,attribute-defined-outside-init,pointless-string-statement,too-many-instance-attributes,arguments-differ,binary-op-exception,bad-classmethod-argument,locally-disabled,file-ignored,multiple-statements,superfluous-parens,bad-mcs-classmethod-argument,useless-object-inheritance,duplicate-code,unused-argument
disable=logging-fstring-interpolation,unexpected-keyword-arg,no-name-in-module,useless-super-delegation,len-as-condition,super-init-not-called,keyword-arg-before-vararg,no-else-return,no-self-argument,inconsistent-return-statements,unsubscriptable-object,too-many-branches,,expression-not-assigned,broad-except,logging-format-interpolation,too-many-ancestors,redefined-builtin,missing-docstring,line-too-long,suppressed-message,useless-suppression,bare-except,too-few-public-methods,fixme,dangerous-default-value,attribute-defined-outside-init,pointless-string-statement,too-many-instance-attributes,arguments-differ,binary-op-exception,bad-classmethod-argument,locally-disabled,file-ignored,multiple-statements,superfluous-parens,bad-mcs-classmethod-argument,useless-object-inheritance,duplicate-code,unused-argument,cyclic-import


[REPORTS]
Expand All @@ -75,12 +66,6 @@ disable=logging-fstring-interpolation,unexpected-keyword-arg,no-name-in-module,u
# mypackage.mymodule.MyReporterClass.
output-format=colorized

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output=no

# Tells whether to display a full report or only the messages
reports=yes

Expand Down Expand Up @@ -118,63 +103,33 @@ property-classes=abc.abstractproperty
# Regular expression matching correct function names
function-rgx=[a-z_][a-zA-Z0-9_]{1,30}$

# Naming hint for function names
function-name-hint=[a-z_][a-zA-Z0-9_]{1,30}$

# Regular expression matching correct method names
method-rgx=[a-z_][a-zA-Z0-9_]{1,30}$

# Naming hint for method names
method-name-hint=[a-z_][a-zA-Z0-9_]{1,30}$

# Regular expression matching correct constant names
const-rgx=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$

# Naming hint for constant names
const-name-hint=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$

# Regular expression matching correct variable names
variable-rgx=[a-z_][a-zA-Z0-9_]{1,30}$

# Naming hint for variable names
variable-name-hint=[a-z_][a-zA-Z0-9_]{1,30}$

# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$

# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{1,30}$

# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{1,30}$

# Regular expression matching correct class names
class-rgx=[_]{0,2}[A-Z_][a-zA-Z0-9]+$

# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$

# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{1,30}$

# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{1,30}$

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
Expand Down Expand Up @@ -202,12 +157,6 @@ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000

Expand Down Expand Up @@ -287,7 +236,7 @@ ignored-classes=optparse.Values,thread._local,_thread._local,
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=RepoTask.task_class,PlusEventLog.delay,asyncio.subprocess.Process
generated-members=RepoTask.task_class,PlusEventLog.delay,asyncio.subprocess.Process,orjson.loads

# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
Expand Down Expand Up @@ -404,4 +353,4 @@ analyse-fallback-blocks=no

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.Exception
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
nodejs: "18"
nodejs: "20"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -23,4 +23,4 @@ formats:
# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: requirements-doc.txt
- requirements: requirements-rtd.txt
Loading

0 comments on commit aacc181

Please sign in to comment.