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

Start using Node.js v22 inside container #3871

Merged
merged 3 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/coverity_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
with:
python-version: 3.11

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install depenencies
run: |
sudo apt-get update
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Run eslint
run: |
cd tcms/
Expand Down
73 changes: 43 additions & 30 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,25 @@ jobs:
python-version: [3.11]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: test-for-missing-migrations
run: |
pip install -r requirements/devel.txt
pushd tcms/ && ./npm-install && popd
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

export LANG=en-us
make test_for_missing_migrations
- name: test-for-missing-migrations
run: |
pip install -r requirements/devel.txt
pushd tcms/ && ./npm-install && popd

export LANG=en-us
make test_for_missing_migrations

test-migrations-rollback:
runs-on: ubuntu-latest
Expand All @@ -53,24 +60,30 @@ jobs:
python-version: [3.11]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4

- name: Create database
run: |
docker compose -f docker-compose.postgres pull db
docker compose -f docker-compose.postgres run -d -p 5432:5432 --name kiwi_db db
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: migrations rollback
run: |
pip install -r requirements/devel.txt
pip install -r requirements/postgres.txt
pushd tcms/ && ./npm-install && popd

export LANG=en-us
# Postgres b/c it has best support for schema altering operations
export DJANGO_SETTINGS_MODULE=tcms.settings.test.postgresql
./tests/migrations-rollback
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Create database
run: |
docker compose -f docker-compose.postgres pull db
docker compose -f docker-compose.postgres run -d -p 5432:5432 --name kiwi_db db

- name: migrations rollback
run: |
pip install -r requirements/devel.txt
pip install -r requirements/postgres.txt
pushd tcms/ && ./npm-install && popd

export LANG=en-us
# Postgres b/c it has best support for schema altering operations
export DJANGO_SETTINGS_MODULE=tcms.settings.test.postgresql
./tests/migrations-rollback
6 changes: 6 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: npm audit
run: |
pushd tcms/
Expand Down
88 changes: 58 additions & 30 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Configure ~/.tcms.conf for ${{ matrix.kiwitcms-url }}
run: |
echo "[tcms]" > ~/.tcms.conf
Expand Down Expand Up @@ -79,36 +85,41 @@ jobs:
python-version: [3.11]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Python dependencies
run: |
sudo apt-get update
sudo apt-get install gettext
pip install -r requirements/devel.txt
pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
pushd tcms/ && ./npm-install && popd

- name: Run test
run: |
export LANG=en-us
export TEST_DASHBOARD_CHECK_UNAPPLIED_MIGRATIONS=1
coverage run --source='.' ./manage.py test -v2 --noinput --settings=tcms.settings.test tcms.core.tests.test_views.TestDashboardCheckMigrations
coverage report -m

- name: Send coverage to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install Python dependencies
run: |
sudo apt-get update
sudo apt-get install gettext
pip install -r requirements/devel.txt
pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
pushd tcms/ && ./npm-install && popd

- name: Run test
run: |
export LANG=en-us
export TEST_DASHBOARD_CHECK_UNAPPLIED_MIGRATIONS=1
coverage run --source='.' ./manage.py test -v2 --noinput --settings=tcms.settings.test tcms.core.tests.test_views.TestDashboardCheckMigrations
coverage report -m

- name: Send coverage to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
verbose: true

without_internal_bugtracker:
name: without internal bugtracker
Expand All @@ -124,6 +135,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Execute tests
run: |
sudo apt-get update
Expand Down Expand Up @@ -159,11 +175,17 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Create database
run: |
docker compose pull db
Expand Down Expand Up @@ -207,11 +229,17 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Create database
run: |
docker compose -f docker-compose.postgres pull db
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.buildroot
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# checkov:skip=CKV_DOCKER_7:Ensure the base image uses a non latest version tag
FROM registry.access.redhat.com/ubi9-minimal

RUN microdnf -y --nodocs install python3.11-devel mariadb-connector-c-devel tar gzip make \
RUN microdnf -y module enable nodejs:22 && \
microdnf -y --nodocs install python3.11-devel mariadb-connector-c-devel tar gzip make \
postgresql-devel libffi-devel gcc gettext npm unzip which rust cargo findutils \
libjpeg-turbo-devel && \
microdnf -y --nodocs update && \
Expand All @@ -30,7 +31,7 @@ RUN pip3 install --no-cache-dir -r requirements/mariadb.txt -r requirements/post
RUN sed -i "s/tcms.settings.devel/tcms.settings.product/" manage.py

# compile tcms/static/js/bundle.js explicitly
RUN pushd tcms/ && npm install --dev && ./node_modules/.bin/webpack && popd
RUN pushd tcms/ && npm install --include=dev && ./node_modules/.bin/webpack && popd

RUN ./tests/check-build
RUN pip3 install --no-cache-dir dist/kiwitcms-*.tar.gz
29 changes: 16 additions & 13 deletions tcms/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading