Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into uat
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed Dec 12, 2024
2 parents 304f738 + 9ef9c76 commit 7674d4a
Show file tree
Hide file tree
Showing 77 changed files with 3,754 additions and 2,979 deletions.
79 changes: 17 additions & 62 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,24 @@
name: "CI"

on:
[push, pull_request]
on: [push, pull_request]

jobs:

server:
runs-on: ubuntu-latest

defaults:
run:
working-directory: server

services:
redis:
image: redis:alpine
ports:
- "6379:6379"

mongo:
image: mongo:4
ports:
- "27017:27017"

elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
ports:
- "9200:9200"
env:
discovery.type: single-node

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: server/requirements.txt

- name: apt-get
run: |
sudo apt-get update
sudo apt-get -y install libxml2-dev libxmlsec1-dev libxmlsec1-openssl libexempi-dev
- name: pip install
run: |
python -m pip install --upgrade pip wheel setuptools
pip install -r dev-requirements.txt
- run: flake8
- run: pytest --log-level=ERROR --disable-warnings
- run: mypy .
- run: python manage.py app:initialize_data

strategy:
matrix:
python-version: ['3.8', '3.10']
uses: superdesk/superdesk/.github/workflows/server.yml@develop
with:
python-version: ${{ matrix.python-version }}

pytest:
strategy:
matrix:
python-version: ['3.8', '3.10']
uses: superdesk/superdesk/.github/workflows/pytest.yml@develop
with:
python-version: ${{ matrix.python-version }}

client:
runs-on: ubuntu-latest

defaults:
run:
working-directory: client

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12.x
- run: npm ci || npm install
- run: npm run build
uses: superdesk/superdesk/.github/workflows/client.yml@develop
566 changes: 445 additions & 121 deletions client/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/superdesk.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module.exports = function(grunt) {
closeAndContinue: true,
},
confirmDueDate: true,
showPublishSchedule: true,
},

workspace: {
Expand Down
8 changes: 4 additions & 4 deletions server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_app(config=None):
if config is None:
config = {}

config['APP_ABSPATH'] = os.path.abspath(os.path.dirname(__file__))
config["APP_ABSPATH"] = os.path.abspath(os.path.dirname(__file__))

for key in dir(settings):
if key.isupper():
Expand All @@ -34,9 +34,9 @@ def get_app(config=None):
return app


if __name__ == '__main__':
if __name__ == "__main__":
debug = True
host = '0.0.0.0'
port = int(os.environ.get('PORT', '5000'))
host = "0.0.0.0"
port = int(os.environ.get("PORT", "5000"))
app = get_app()
app.run(host=host, port=port, debug=debug, use_reloader=debug)
17 changes: 11 additions & 6 deletions server/belga/ai_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
def init_app(app: Flask) -> None:
belga_ai_url = app.config.get("BELGA_AI_URL")
if belga_ai_url is None:
logger.warning("'BELGA_AI_URL' config not set, HTTP Proxy will not be available")
logger.warning(
"'BELGA_AI_URL' config not set, HTTP Proxy will not be available"
)
return

register_http_proxy(app, HTTPProxy(
endpoint_name="belga.ai_proxy",
internal_url="belga/ai",
external_url=belga_ai_url,
))
register_http_proxy(
app,
HTTPProxy(
endpoint_name="belga.ai_proxy",
internal_url="belga/ai",
external_url=belga_ai_url,
),
)
Loading

0 comments on commit 7674d4a

Please sign in to comment.