Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump postcss, css-loader and postcss-loader in /akvo/rsr/dir #83

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
665a132
Upgrade to postgres 14.11 for dev env
zuhdil Mar 7, 2024
22b78bb
Refactor python code to be compatible with Django 4.2
zuhdil Mar 7, 2024
c8780d3
More Django 4.2 compatibility refactoring
zuhdil Mar 7, 2024
9caf6a1
Fix linting error
zuhdil Mar 7, 2024
983cec5
Upgrade Django to 4.2
zuhdil Mar 11, 2024
ca3c84b
Rewrite custom cache backend to use pymemcache
zuhdil Mar 13, 2024
e4873c3
Fix linting errors
zuhdil Mar 13, 2024
5e7ee64
Bump minimist, mkdirp and loader-fs-cache in /akvo/rsr/spa
dependabot[bot] Mar 14, 2024
1253a11
Fix error generating dbml
zuhdil Mar 15, 2024
2e6785b
Bump fsevents from 1.2.7 to 1.2.13 in /akvo/rsr/spa
dependabot[bot] Mar 18, 2024
1df531c
Bump minimist from 1.2.5 to 1.2.8 in /akvo/rsr/e2e
dependabot[bot] Mar 18, 2024
a8b0f77
Merge pull request #11 from akvo/dependabot/npm_and_yarn/akvo/rsr/spa…
zuhdil Mar 18, 2024
e96dd52
Merge pull request #16 from akvo/dependabot/npm_and_yarn/akvo/rsr/e2e…
zuhdil Mar 18, 2024
3eb4864
Bump minimist and loader-fs-cache in /akvo/rsr/dir
dependabot[bot] Mar 18, 2024
1910d4d
Merge pull request #22 from akvo/dependabot/npm_and_yarn/akvo/rsr/dir…
zuhdil Mar 18, 2024
7e6f993
Add staging env
anjarakvo Mar 18, 2024
929ec73
Update pip on Dockerfile-prod-no-code
zuhdil Mar 18, 2024
6703797
Temporary prod image with staging image
anjarakvo Mar 19, 2024
12ea08f
Change healthcheck to staging
anjarakvo Mar 19, 2024
d647d44
Update Memcached host address for staging
anjarakvo Mar 19, 2024
a54b260
Update Docker compose Memcached service name
anjarakvo Mar 19, 2024
69f55e3
Run create cache table command on production init script
zuhdil Mar 19, 2024
11c4ea5
Bump the npm_and_yarn group group in /akvo/rsr/dir with 2 updates
dependabot[bot] Mar 21, 2024
1983123
Merge pull request #25 from akvo/dependabot/npm_and_yarn/akvo/rsr/dir…
zuhdil Mar 21, 2024
7a8b4a0
Bump json-schema and jsprim in /akvo/rsr/spa
dependabot[bot] Mar 21, 2024
e899a6d
Merge pull request #27 from akvo/dependabot/npm_and_yarn/akvo/rsr/spa…
zuhdil Mar 21, 2024
5f2500d
Bump url-parse from 1.5.1 to 1.5.10 in /akvo/rsr/spa
dependabot[bot] Mar 21, 2024
ba7a4e3
Merge pull request #6 from akvo/dependabot/npm_and_yarn/akvo/rsr/spa/…
zuhdil Mar 21, 2024
56f25bc
Bump url-parse from 1.5.3 to 1.5.10 in /akvo/rsr/dir
dependabot[bot] Mar 21, 2024
b66b113
Merge pull request #28 from akvo/dependabot/npm_and_yarn/akvo/rsr/dir…
zuhdil Mar 21, 2024
a7602b2
Bump eventsource from 1.1.0 to 1.1.2 in /akvo/rsr/spa
dependabot[bot] Mar 21, 2024
7b19927
Merge pull request #29 from akvo/dependabot/npm_and_yarn/akvo/rsr/spa…
zuhdil Mar 21, 2024
8da8b48
Bump eventsource from 1.1.0 to 1.1.2 in /akvo/rsr/dir
dependabot[bot] Mar 21, 2024
9500c9d
Merge pull request #30 from akvo/dependabot/npm_and_yarn/akvo/rsr/dir…
zuhdil Mar 21, 2024
0233394
Bump global-modules-path and webpack-cli in /akvo/rsr/spa
dependabot[bot] Mar 21, 2024
d3fd573
Merge pull request #32 from akvo/dependabot/npm_and_yarn/akvo/rsr/spa…
zuhdil Mar 22, 2024
101eb34
Bump global-modules-path and webpack-cli in /akvo/rsr/dir
dependabot[bot] Mar 22, 2024
faa4c7f
Merge pull request #36 from akvo/dependabot/npm_and_yarn/akvo/rsr/dir…
zuhdil Mar 22, 2024
2f9f62d
Update node to v14
zuhdil Mar 25, 2024
196e14d
Run `npm audit fix` on rsr/dir app
zuhdil Mar 26, 2024
23e2c08
Fix rsr/frontend build error
zuhdil Mar 27, 2024
1baec5d
Make eslintrc of rsr/spa the same as rsr/dir
zuhdil Mar 27, 2024
fa75893
Update rsr/spa @babel/core package
zuhdil Mar 27, 2024
55f06b0
Targeting a specific version of @babel/parser
zuhdil Mar 28, 2024
43d40d8
Update rsr/spa webpack versions
zuhdil Mar 30, 2024
34d1390
Fix rsr/spa linting errors
zuhdil Mar 30, 2024
2356e51
Fix rsr/spa build production command
zuhdil Mar 31, 2024
8621d45
Upgrade momentjs and react-hot-loader libs
zuhdil Apr 1, 2024
a6a88d1
Update rsr/dir webpack versions
zuhdil Apr 1, 2024
335e1e1
Fix rsr/dir linting errors
zuhdil Apr 1, 2024
57183b5
Bump axios, jest-puppeteer and wait-on in /akvo/rsr/e2e
dependabot[bot] Apr 1, 2024
aa902aa
Update axios
zuhdil Apr 1, 2024
ef1501b
Merge pull request #65 from akvo/dependabot/npm_and_yarn/akvo/rsr/e2e…
zuhdil Apr 2, 2024
321deb2
Update rsr/spa node-sass and sass-loader
zuhdil Apr 3, 2024
dc8936f
Update rsr/dir node-sass and sass-loader
zuhdil Apr 4, 2024
da0889b
Fix rsr/dir "target.matches is not a function" error
zuhdil Apr 5, 2024
da3cb80
Bump pillow in /scripts/deployment/pip/requirements
dependabot[bot] Apr 5, 2024
dd8cd03
Merge pull request #67 from akvo/dependabot/pip/scripts/deployment/pi…
zuhdil Apr 5, 2024
d22d199
Update rsr/front-end node-sass and sass-loader
zuhdil Apr 5, 2024
08f8a4c
Update rsr/spa html-webpack-plugin
zuhdil Apr 8, 2024
278ddf0
Fix frontend assets build tests
zuhdil Apr 8, 2024
5af17bc
Update rsr/dir html-webpack-plugin
zuhdil Apr 9, 2024
5fb19d5
Remove unmaintained e2e tests
zuhdil Apr 9, 2024
44c8c24
Update rsr/spa jest
zuhdil Apr 9, 2024
b329478
Update rsr/dir jest
zuhdil Apr 9, 2024
ac1055c
Uninstall copy-webpack-plugin
zuhdil Apr 9, 2024
114e979
Uninstall uglifyjs-webpack-plugin
zuhdil Apr 9, 2024
e617fa3
Uninstall unused react-print package
zuhdil Apr 9, 2024
c8405a1
Update backend requirements
zuhdil Apr 18, 2024
110dfad
Update react and react-dom
zuhdil Apr 23, 2024
ff57d56
Update dir antd to v4
zuhdil Apr 25, 2024
90efbb8
Merge pull request #82 from akvo/dir-upgrade-antd
zuhdil Apr 25, 2024
733b1e1
Bump postcss, css-loader and postcss-loader in /akvo/rsr/dir
dependabot[bot] Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ RUN set -ex; apt-get update \

RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py && \
pip install --upgrade pip && \
rm get-pip.py

ENV NODE_VERSION 10.24.1
ENV NODE_VERSION 14.21.3

RUN curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
Expand Down
30 changes: 0 additions & 30 deletions Dockerfile-e2e

This file was deleted.

5 changes: 5 additions & 0 deletions Dockerfile-prod-no-code
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ RUN set -ex; apt-get update && \
libxml2-dev libxslt1-dev zlib1g-dev python3-dev && \
rm -rf /var/lib/apt/lists/*

RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py && \
pip install --upgrade pip && \
rm get-pip.py

WORKDIR /var/akvo/rsr/code

COPY scripts/deployment/pip/requirements/2_rsr.txt ./
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-prod-no-code-with-nodejs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM akvo/rsr-backend-prod-no-code:local

ENV NODE_VERSION 10.24.1
ENV NODE_VERSION 14.21.3

RUN curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
104 changes: 26 additions & 78 deletions akvo/cache/memcache.py
Original file line number Diff line number Diff line change
@@ -1,91 +1,39 @@
import operator
import pickle
import socket
from functools import reduce
from typing import List, Tuple, Dict
from typing import List

import memcache
from django.core.cache.backends.memcached import MemcachedCache
from pymemcache.serde import python_memcache_deserializer
from pymemcache.serde import python_memcache_serializer
from django.core.cache.backends.memcached import PyMemcacheCache


class AkvoMemcacheClient(memcache.Client):
class AkvoMemcachedCache(PyMemcacheCache):

def get_slabs(self) -> List[Tuple[str, Dict[str, dict]]]: # pragma: no cover
"""
Override to fix decoding error in super().get_slabs

Slabs are memory regions in memcache where data is stored.
They have a unique ID (number).
"""
data = []
for s in self.servers:
if not s.connect():
continue
if s.family == socket.AF_INET:
name = '%s:%s (%s)' % (s.ip, s.port, s.weight)
elif s.family == socket.AF_INET6:
name = '[%s]:%s (%s)' % (s.ip, s.port, s.weight)
else:
name = 'unix:%s (%s)' % (s.address, s.weight)
serverData = {}
data.append((name, serverData))
s.send_cmd('stats items')
readline = s.readline
while 1:
line: bytes = readline()
if not line or line.strip() == b'END':
break
item = line.decode('ascii').strip().split(' ', 2)
# 0 = STAT, 1 = ITEM, 2 = Value
slab = item[1].split(':', 2)
# 0 = items, 1 = Slab #, 2 = Name
if slab[1] not in serverData:
serverData[slab[1]] = {}
serverData[slab[1]][slab[2]] = item[2]
return data


class AkvoMemcachedCache(MemcachedCache):

@property
def _cache(self):
"""Provide our AkvoMemcacheClient for cache access"""

if getattr(self, '_client', None) is None:
client_kwargs = dict(pickleProtocol=pickle.HIGHEST_PROTOCOL)
client_kwargs.update(self._options)
self._client = AkvoMemcacheClient(self._servers, **client_kwargs)
return self._client
def __init__(self, server, params):
super().__init__(server, params)
self._options = {
'serializer': python_memcache_serializer,
'deserializer': python_memcache_deserializer,
**self._options,
}

def list_keys(self) -> List[str]:
"""
List all keys in memcached

Implementation of https://www.darkcoding.net/software/memcached-list-all-keys/
"""
# tuples of (server name, server data)
# server data has key: slab_id, value: slab stats
data: List[Tuple[str, Dict[str, dict]]] = self._cache.get_slabs()
keys = []
slab_keys = reduce(
operator.add,
[list(slab_data.keys()) for _, slab_data in data],
[]
)
for slab_key in slab_keys:
# List max 10,000 keys
# tuples of (servername, server data)
# server data has key: cache line, value: stats line
stat_data: List[Tuple[str, Dict[str, str]]] = self._cache.get_stats(f"cachedump {slab_key} 10000")
cache_lines = reduce(
operator.add,
[list(server_data.keys()) for _, server_data in stat_data],
[]
)
# example:
# :1:projects_filter__user_45454__418c1b09da887315af25ccde52100faf
for cache_line in cache_lines:
# 0: ???, 1: id?, 2: key
_, _id, key = cache_line.split(":", 2)
keys.append(key)
for client in self._cache.clients.values():
slab_keys = set()
items = client.stats('items')
for item in items.keys():
slab = item.decode('ascii').split(':')
slab_keys.add(slab[1])
for slab_key in slab_keys:
data = client.stats('cachedump', str(slab_key), '10000')
for raw_key in data.keys():
# raw_key format "%s:%s:%s" (django.core.cache.backends.base.default_key_func)
key = raw_key.decode('ascii').split(':', 2)
if len(key) < 3:
continue
keys.append(key[2])
return keys
2 changes: 1 addition & 1 deletion akvo/codelists/models/activity_date_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/activity_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/activity_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/aid_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/aid_type_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/aid_type_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/aid_type_vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/base_codelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class BaseCodelist(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_identifier_sector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_identifier_sector_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_identifier_vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_not_provided.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/budget_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/cashand_voucher_modalities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/collaboration_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/condition_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/contact_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/country.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/crs_add_other_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/crs_channel_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
2 changes: 1 addition & 1 deletion akvo/codelists/models/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .base_codelist import BaseCodelist

Expand Down
Loading