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

update pull #1

Open
wants to merge 863 commits into
base: ng
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
863 commits
Select commit Hold shift + click to select a range
051650b
Fix polymorphic for psql
hipek8 Jun 10, 2024
66aecc4
Optimize queries. Add tests
hipek8 Jun 10, 2024
a8b9c31
Optimize API and improve API tests
hipek8 Jun 10, 2024
38d5277
Add missing prefetches. Fix tests
hipek8 Jun 11, 2024
d25d2ad
Adjust expected queries count in tests after modifications. Fix secur…
hipek8 Jun 11, 2024
48096a7
Adjust queries count in tests
hipek8 Jun 11, 2024
de5825e
Fix flake
hipek8 Jun 11, 2024
2545f6b
Fix cluster factory
hipek8 Jun 11, 2024
b62440b
Fix last test
hipek8 Jun 11, 2024
2931ba7
Merge pull request #3810 from allegro/optimize-hosts-endpoints
hipek8 Jun 11, 2024
7b97a0b
Updated changelog for version.
hipek8 Jun 11, 2024
d4d3ee8
Merge branch 'ng' into update-to-django-1-10
hipek8 Jun 12, 2024
d3772fb
merge django-1.10 and django-1.11 branches
hipek8 Jun 12, 2024
f797e8a
Fix flake. adjust query num
hipek8 Jun 14, 2024
20b165e
Fix custom fields
matyldv Jun 14, 2024
89bb1fa
Fix different quote types in different db engines
hipek8 Jun 14, 2024
61cf5aa
Merge branch 'bump-to-django-1.11' of github.com:allegro/ralph into b…
hipek8 Jun 14, 2024
9fa5db3
Fix isort
matyldv Jun 14, 2024
7dfd9b6
Fix flake
hipek8 Jun 14, 2024
53ff617
Fix missing f-string
hipek8 Jun 14, 2024
b75d633
Fix tests
matyldv Jun 14, 2024
7f61c8f
WIP | Remove Django 2.0 deprecation warnings
hipek8 Jun 18, 2024
3ce91f4
Initial support for django 2.0
hipek8 Jun 19, 2024
f2129e8
Fix some more deprecation warnings
hipek8 Jun 19, 2024
4df1479
WIP | Fix more django2.0 warnings
hipek8 Jun 20, 2024
20e56fa
Add missing migrations and missing serializer fields
hipek8 Jun 21, 2024
5e25bb5
Fix flake
hipek8 Jun 21, 2024
64fe8af
Fix more flake
hipek8 Jun 21, 2024
25b3233
Fix bad serializer fields
hipek8 Jun 21, 2024
b898696
Fix bad assignment of many-to-many relation
hipek8 Jun 21, 2024
bc275ba
Another django 2.0 compatibility changes batch
hipek8 Jun 21, 2024
5204a47
Django 2.0
hipek8 Jun 21, 2024
12fc86b
Add missing migrations
hipek8 Jun 21, 2024
edc31fe
Fix namespaced urls
hipek8 Jun 21, 2024
ff490db
Fix template loading and cloning querysets
hipek8 Jun 21, 2024
072816a
Fix number of returned values
hipek8 Jun 21, 2024
f5ec197
Fix serializer fields
hipek8 Jun 24, 2024
3d003de
Hack fix serializers. Adjust tests for error cases
hipek8 Jun 24, 2024
04db4bb
Fix serializer and max username length
hipek8 Jun 25, 2024
4f0af32
Fix some tests and flake
matyldv Jun 25, 2024
2db94ae
Add parent to select_related
matyldv Jun 27, 2024
2b3ebf0
Fix test_admin_get_custom_fields_values_result
matyldv Jun 27, 2024
8637a0c
Fix prefetch in export
hipek8 Jun 27, 2024
24a70c8
Merge branch 'django-2.0' of github.com:allegro/ralph into django-2.0
hipek8 Jun 27, 2024
6c5ed85
Add missing prefetch in export
hipek8 Jun 27, 2024
5c87fee
adjust parent_str in export
hipek8 Jun 27, 2024
dc34ca6
adjust num queries in datacenterasset changelist
hipek8 Jun 27, 2024
c271fe9
Add missing migrations
hipek8 Jun 27, 2024
7f90014
Try adding migrations again
hipek8 Jun 27, 2024
25426a5
Remove extra migrations
hipek8 Jun 28, 2024
ea58427
Fix BaseObjectForeignKey creating unnecessary migrations
hipek8 Jun 28, 2024
efedab7
Add missing migrations for test models
hipek8 Jun 28, 2024
fa5e60b
Fix test not always taking correct item to check
hipek8 Jun 28, 2024
3cf16d1
Tests less flaky now
hipek8 Jun 28, 2024
3978c13
Add test for dhcp config format
hipek8 Jul 2, 2024
d00a1a6
remove removed middleware imports
hipek8 Jul 2, 2024
160156c
Remove WrappedOperationalError occurrence
hipek8 Jul 3, 2024
5d3c323
merge django-1.0 into django-1.11
hipek8 Jul 3, 2024
2867b63
Fix html not rendering in some cases
hipek8 Jul 3, 2024
018de79
Fix graph preview
hipek8 Jul 5, 2024
94eb47c
Fix flake
hipek8 Jul 5, 2024
33a8773
Fix flake
hipek8 Jul 5, 2024
dac27b8
Merge pull request #3814 from allegro/django-1.10
hipek8 Jul 19, 2024
cff0892
Updated changelog for 20240719.1 version.
hipek8 Jul 19, 2024
2c05326
Updated changelog for 20240719.1 version.
hipek8 Jul 19, 2024
b6ec83a
Fix BrowsableAPIRenderer
matyldv Jul 23, 2024
9d0c2ff
Delete sitetree cache
hipek8 Jul 23, 2024
eaf7e9f
Merge pull request #3820 from allegro/fix-browsable-api-renderer
hipek8 Jul 23, 2024
ff470b5
Merge branch 'ng' into remove-sitetree-cache-during-bump
hipek8 Jul 23, 2024
5312cf0
Merge pull request #3821 from allegro/remove-sitetree-cache-during-bump
hipek8 Jul 23, 2024
ba0d407
Updated changelog for 20240723.1 version.
hipek8 Jul 23, 2024
fb09e32
Test API endpoints
hipek8 Jul 25, 2024
9c98b53
Test API endpoints
hipek8 Jul 25, 2024
d88b13a
Test also json content
hipek8 Jul 26, 2024
eee01e7
Merge ng
hipek8 Jul 26, 2024
1231c9c
Fix error when changing custom fields of some hosts
hipek8 Jul 30, 2024
e88c109
Fix error when changing custom fields of some hosts
hipek8 Jul 30, 2024
3f89f1e
Fix error with ldap sync
hipek8 Jul 31, 2024
d701077
Fix flake
hipek8 Jul 31, 2024
ea732f3
Merge pull request #3822 from allegro/fix-query-dict-is-immutable
hipek8 Jul 31, 2024
9340007
Merge pull request #3823 from allegro/fix-error-with-ldap-sync
hipek8 Jul 31, 2024
fe9a90d
Updated changelog for 20240731.1 version.
hipek8 Jul 31, 2024
ab3da5b
Merge branch 'ng' into bump-to-django-1.11
hipek8 Jul 31, 2024
b53ef64
Merge django 1.11
hipek8 Jul 31, 2024
ed5f7d8
Don't smoke test endpoints for django 1.11
hipek8 Jul 31, 2024
a628d66
Fix isort
hipek8 Jul 31, 2024
1227d36
Fix other option
hipek8 Aug 1, 2024
7c9aa87
Fix checkboxes
hipek8 Aug 2, 2024
59bcfcc
Sort imports
hipek8 Aug 2, 2024
bb9e8b9
Merge pull request #3826 from allegro/fix-other-option
hipek8 Aug 2, 2024
7d09f9d
Merge pull request #3827 from allegro/fix-checkboxes-not-checked
hipek8 Aug 2, 2024
2e90dbf
Updated changelog for 20240802.1 version.
hipek8 Aug 2, 2024
3c6a622
Fix bad template
hipek8 Aug 2, 2024
d2c98b4
Fix bad template
hipek8 Aug 2, 2024
334a437
Merge pull request #3828 from allegro/fix-bad-template
hipek8 Aug 2, 2024
6a093d0
Updated changelog for 20240802.2 version.
hipek8 Aug 2, 2024
e6c4aeb
Merge branch 'ng' into bump-to-django-1.11
hipek8 Aug 2, 2024
f8e952d
Merge ng
hipek8 Aug 2, 2024
21b66be
Updated changelog for 20240802.3 version.
hipek8 Aug 2, 2024
3b78aa0
Merge branch 'ng' into bump-to-django-1.11
hipek8 Aug 5, 2024
92fa73d
Fix transitions form
matyldv Aug 6, 2024
601454e
Fix test_action_choices
matyldv Aug 6, 2024
f546c64
Merge branch 'bump-to-django-1.11' of github.com:allegro/ralph into b…
hipek8 Aug 8, 2024
4888820
Merge branch 'bump-to-django-1.11' into django-2.0
hipek8 Aug 8, 2024
2d290d0
Show preboots with warnings and criticals
hipek8 Jul 5, 2024
e0c1092
Add missing import
hipek8 Jul 5, 2024
ab748bf
Format preboot list
hipek8 Jul 5, 2024
8afdd0c
WIP - Warnings and criticals added to preboot selection
hipek8 Jul 5, 2024
7309fd6
Add fields to preboots
hipek8 Jul 5, 2024
cf982b2
Add preboot end of life features
hipek8 Aug 8, 2024
76684c7
Fix flake
hipek8 Aug 8, 2024
b097ce8
Random fix so the test passes
hipek8 Aug 8, 2024
0e8dc6b
Merge pull request #3830 from allegro/django-1.10-preboot
hipek8 Aug 8, 2024
7eb315b
Updated changelog for 20240808.1 version.
hipek8 Aug 8, 2024
a31a470
Increase the value of DATA_UPLOAD_MAX_NUMBER_FIELDS (#3831)
matyldv Aug 13, 2024
9b3645c
Updated changelog for 20240813.1 version.
matyldv Aug 13, 2024
992f340
Fix ldap signals (#3834)
matyldv Aug 19, 2024
6002e5e
Change preboot field type in deployment action (#3835)
matyldv Aug 22, 2024
f07a43a
Updated changelog for 20240822.1 version.
matyldv Aug 22, 2024
3740e8c
Fix import of ldap
hipek8 Aug 22, 2024
1aff2fb
Merge pull request #3836 from allegro/fix-ldap-import
hipek8 Aug 22, 2024
138f49e
Updated changelog for 20240822.2 version.
hipek8 Aug 22, 2024
c7f5326
Merge branch 'ng' into bump-to-django-1.11
hipek8 Aug 23, 2024
a0267e4
Bump django debug toolbar
hipek8 Aug 23, 2024
bf129fd
Fix debian package (#3838)
matyldv Aug 30, 2024
b9d2823
Fix _get_preboot (#3839)
matyldv Aug 30, 2024
3b80a8b
Updated changelog for 20240830.1 version.
matyldv Aug 30, 2024
d4f797c
Updated changelog for 20240830.2 version.
matyldv Aug 30, 2024
272c6b8
Fix ipxe for deploy (#3840)
matyldv Sep 3, 2024
c495610
Updated changelog for 20240903.1 version.
matyldv Sep 3, 2024
6481dd9
Fix ipxe (#3841)
matyldv Sep 3, 2024
5816905
Updated changelog for 20240903.2 version.
matyldv Sep 3, 2024
e6efaec
Spaces in serial number and barcode are now forbidden
hipek8 Sep 4, 2024
d80d2ec
Add missing migration
hipek8 Sep 4, 2024
8acb844
Require field property_of
matyldv Sep 4, 2024
fb5f36c
Fix clean method
matyldv Sep 4, 2024
c41dfd1
Require service environment
matyldv Sep 5, 2024
f023212
Fix DC Visualization
matyldv Sep 6, 2024
f22b39f
Merge pull request #3844 from allegro/require-service-environment
hipek8 Sep 10, 2024
0586b40
Merge pull request #3843 from allegro/require-field-propery-of
hipek8 Sep 10, 2024
27dfdca
Merge pull request #3842 from allegro/add-no-space-validator
hipek8 Sep 10, 2024
68c0f20
Merge branch 'ng' into bump-to-django-1.11
hipek8 Sep 10, 2024
34d88e0
Merge branch 'bump-to-django-1.11' of github.com:allegro/ralph into b…
hipek8 Sep 10, 2024
9ca0bfa
Merge django-1.11 to django-2.0
hipek8 Sep 10, 2024
8051b4f
Updated changelog for 20240910.1 version.
hipek8 Sep 10, 2024
e7b4134
Add merge migration
hipek8 Sep 16, 2024
dcdae1a
Add missing error message for property of field (#3845)
matyldv Sep 16, 2024
6adca01
Updated changelog for 20240916.1 version.
matyldv Sep 16, 2024
61933ba
Updated changelog for 20240916.1 version.
matyldv Sep 16, 2024
2714746
Updated changelog for 20240916.1 version.
matyldv Sep 16, 2024
18ce7df
Updated changelog for 20240916.1 version.
matyldv Sep 16, 2024
7932a3f
Fix serializers
hipek8 Sep 17, 2024
cebb5ab
Improve remaining APIs
hipek8 Sep 17, 2024
bcdbc1a
Improve remaining APIs
hipek8 Sep 17, 2024
78337ab
Fix transition form. Add missing factories and tests
hipek8 Sep 19, 2024
c0cfc74
Fix isort
hipek8 Sep 19, 2024
2838fe0
Fix accessory factory
hipek8 Sep 19, 2024
8ce3815
Further test improvements
hipek8 Sep 20, 2024
0af3060
Remove unused inline
hipek8 Sep 20, 2024
cf4bef0
Django 1.11 (#3815)
hipek8 Sep 23, 2024
e11a03f
Updated changelog for 20240923.1 version.
matyldv Sep 23, 2024
cc3b27a
Merge ng to django-2.0
hipek8 Sep 23, 2024
4d575b3
Fix polymorphic queryset when saving m2m relation
hipek8 Sep 23, 2024
0e1ae15
Merge pull request #3848 from allegro/fix-polymorphic-queryset-in-m2m…
hipek8 Sep 24, 2024
ff0c634
Updated changelog for 20240924.1 version.
hipek8 Sep 24, 2024
1b85ef3
Add PolymorphicManyToManyField
hipek8 Sep 24, 2024
0ff3dbd
Remove bad migrations
hipek8 Sep 24, 2024
9bca2c2
Fix flake
hipek8 Sep 24, 2024
7b72ce4
Merge pull request #3849 from allegro/fix-other-m2m-polymorphic-save
hipek8 Sep 24, 2024
9737f27
Updated changelog for 20240924.2 version.
hipek8 Sep 24, 2024
e42e7a8
Merge branch 'ng' into django-2.0
hipek8 Sep 25, 2024
4824899
Merge ng
hipek8 Sep 25, 2024
a220bd7
Fix lint
hipek8 Sep 25, 2024
b6cc157
Fix errors after ng merge
hipek8 Sep 25, 2024
c491a29
Simplify transition serializers
hipek8 Sep 25, 2024
cec72bd
Improve test coverage
hipek8 Sep 25, 2024
6ad66ad
Fix missing comma
hipek8 Sep 25, 2024
a8cbe6f
Log extra queries
hipek8 Sep 25, 2024
ab2a1ba
Adjust queries count in tests
hipek8 Sep 25, 2024
f2dd1d3
Fix badly merged widget
hipek8 Sep 26, 2024
71819a1
Improve remaining APIs
hipek8 Sep 27, 2024
e8c0ac2
Select related cluster type
hipek8 Sep 27, 2024
1b559cc
Add missing newline
hipek8 Sep 27, 2024
ba2e947
Fix get for polymorphic queryset
hipek8 Oct 1, 2024
870c859
Fix get for polymorphic queryset another attempt
hipek8 Oct 1, 2024
72a7c1a
Add test making sure polymorphic queryset get works correctly
hipek8 Oct 1, 2024
ed326ea
Merge pull request #3851 from allegro/fix-get-for-polymorphic-qs
hipek8 Oct 1, 2024
7337de1
Updated changelog for 20241001.1 version.
hipek8 Oct 1, 2024
84d3361
Migrate to polymorphic manytomany field
hipek8 Oct 2, 2024
9791949
Change default manager for licences
hipek8 Oct 2, 2024
4d0c405
Use objects manager in graphs
hipek8 Oct 2, 2024
dc77d61
Merge pull request #3852 from allegro/migrate-to-polymorphic-many-to-…
hipek8 Oct 7, 2024
9913469
Merge branch 'ng' of github.com:allegro/ralph into django-2.0
hipek8 Oct 8, 2024
3b36395
Minor fixes
hipek8 Oct 8, 2024
49ff773
Updated changelog for 20241008.1 version.
hipek8 Oct 8, 2024
3200f99
Merge branch 'ng' of github.com:allegro/ralph into ng
hipek8 Oct 8, 2024
43be6ad
Updated changelog for 20241008.2 version.
hipek8 Oct 8, 2024
0ba52ae
Merge branch 'ng' into django-2.0
hipek8 Oct 8, 2024
e498cc0
Add new ethernet speed (#3853)
matyldv Oct 8, 2024
edafe55
Updated changelog for 20241008.3 version.
matyldv Oct 8, 2024
b728c51
Merge migrations
hipek8 Oct 8, 2024
77ba36c
Revert change in transition serializer
hipek8 Oct 8, 2024
a6475e0
Merge branch 'ng' into django-2.0
hipek8 Oct 8, 2024
4a1637c
Merge ng
hipek8 Oct 8, 2024
53a9043
Hopefully fix missing woff2 file by bumping drf
hipek8 Oct 9, 2024
1798517
Fix template loader
hipek8 Oct 9, 2024
88c51a6
Fix loader and page_not_found
hipek8 Oct 9, 2024
fa7940f
Don't save vulnerability and security scan history. Fix network ip
hipek8 Oct 10, 2024
c35c1ac
Fix tags in API
hipek8 Oct 10, 2024
358af8d
Fix file permissions
hipek8 Oct 11, 2024
728d80e
Add queries more or less check for API tests
hipek8 Oct 11, 2024
42dbed5
Cleanup
matyldv Oct 11, 2024
541ab23
Merge pull request #3813 from allegro/django-2.0
hipek8 Oct 11, 2024
be25fd4
Updated changelog for 20241011.1 version.
hipek8 Oct 11, 2024
97b8aeb
Merge branch 'ng' of github.com:allegro/ralph into ng
hipek8 Oct 11, 2024
aeb7b0d
Updated changelog for 20241011.1 version.
hipek8 Oct 11, 2024
91e3d05
Updated changelog for 20241011.1 version.
hipek8 Oct 11, 2024
087ba90
Fix data not JSON-serializable
hipek8 Oct 21, 2024
3b8929b
Merge pull request #3854 from allegro/fix-not-json-serializable-data-…
hipek8 Oct 23, 2024
c33ead2
Updated changelog for 20241023.1 version.
hipek8 Oct 23, 2024
ba59dd0
Fix virtual server - hypervisor
hipek8 Oct 28, 2024
67392e4
Revert remove barcode from factory
hipek8 Oct 28, 2024
ada3e67
Fix virtual server - service env optional
hipek8 Oct 28, 2024
66518c2
Merge pull request #3855 from allegro/fix-virtual-servers
hipek8 Oct 28, 2024
d852902
Updated changelog for 20241028.1 version.
hipek8 Oct 28, 2024
4666797
Fix LDAP Groups sync
awieckowski Oct 29, 2024
49f2b06
Fix bulk edit for some models
hipek8 Oct 29, 2024
8d1a3d9
Merge pull request #3857 from allegro/fix-bulk-edit
hipek8 Oct 29, 2024
e8e1415
Merge pull request #3856 from awieckowski/fix-ldap-groups-sync
hipek8 Oct 29, 2024
0aab661
Updated changelog for 20241029.1 version.
hipek8 Oct 29, 2024
c435102
Fix method to get limit choices
hipek8 Oct 29, 2024
29bddfa
Increase max user department field length
awieckowski Oct 30, 2024
09ec852
Add missing migration
awieckowski Oct 30, 2024
03da535
Fix data center asset export not getting filter from request
hipek8 Oct 31, 2024
d52c3aa
Fix format to work with newer flake
hipek8 Oct 31, 2024
b198817
Fix prefetches
hipek8 Oct 31, 2024
04002d9
Make prefetches work for filtered and not filtered export
hipek8 Oct 31, 2024
9d3e255
loosen queries count constraint for export
hipek8 Oct 31, 2024
fb564e8
Merge pull request #3860 from allegro/fix-data-center-asset-export
hipek8 Nov 4, 2024
021b3e9
Updated changelog for 20241104.1 version.
hipek8 Nov 4, 2024
4927a0c
Fix ldap sync when bytes received
hipek8 Nov 4, 2024
a40a030
Merge pull request #3861 from allegro/fix-ldap-sync-bytes
hipek8 Nov 4, 2024
b088b04
Merge pull request #3859 from awieckowski/department_field_length
hipek8 Nov 4, 2024
4565808
Updated changelog for 20241104.2 version.
hipek8 Nov 4, 2024
9cf0ac0
Allow updating dchosts via dchost-list endpoint
hipek8 Nov 7, 2024
3e9a1c6
Fix browsable api
hipek8 Nov 7, 2024
b1a59b1
Fix flake
hipek8 Nov 7, 2024
830dc58
Add 404 if no serializer found for dc-hosts endpoint
hipek8 Nov 8, 2024
6a68d53
Merge pull request #3862 from allegro/fix-patch-dc-hosts
hipek8 Nov 8, 2024
530cac3
Updated changelog for 20241108.1 version.
hipek8 Nov 8, 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
  •  
  •  
  •  
269 changes: 269 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
---
name: CI

# NOTE(romcheg): Controls when the action will run. Triggers the workflow on
# push or pull request events but only for the ng branch
on:
push:
pull_request:
branches: [ ng ]

jobs:
code_style:
name: Code style
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Downgrade pip
run: pip3 install pip==19.3.1
- name: Cache pip dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('base.txt', 'dev.txt', 'docs.txt', 'hermes.txt', 'openstack.txt', 'prod.txt', 'prod_ldap.txt', '', 'test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Ralph's python dependencies
run: pip3 install -r "${GITHUB_WORKSPACE}/requirements/code_style.txt"

- name: Run flake8
run: make flake

missing_migrations:
name: Missing migrations
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
db-engine: ["psql", "mysql"]
env:
TEST_DB_ENGINE: ${{ matrix.db-engine }}
services:
postgres:
image: postgres:9.4.26
env:
POSTGRES_USER: ralph_ng
POSTGRES_PASSWORD: ralph_ng
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

# NOTE(romcheg): Running mysql image of a more recent version will cause user
# ralph_ng to not being able to create a test database.
mysql:
image: mysql:5.6.45
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: ralph_ng
MYSQL_PASSWORD: ralph_ng
MYSQL_DATABASE: ralph_ng
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Unshallow local copy
run: git fetch --prune --unshallow

- name: Install system packages
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev
env:
DEBIAN_FRONDEND: NONINTERACTIVE

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Downgrade pip
run: pip3 install pip==19.3.1

- name: Install Ralph
run: pip3 install "${GITHUB_WORKSPACE}"

- name: Cache pip dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('base.txt', 'code_style.txt', 'dev.txt', 'docs.txt', 'hermes.txt', 'openstack.txt', 'prod.txt', 'prod_ldap.txt', '', 'test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-

- name: Install Ralph's python dependencies
run: pip3 install -r "${GITHUB_WORKSPACE}/requirements/test.txt"

- name: Install PostgreSQL driver
if: ${{ matrix.db-engine == 'psql' }}
run: pip3 install psycopg2-binary

# Runs a set of commands using the runners shell
- name: Check missing migrations
run: "${GITHUB_WORKSPACE}/scripts/check_missing_migrations.sh"

settings_test:
name: Settings tests
runs-on: ubuntu-20.04

steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Unshallow local copy
run: git fetch --prune --unshallow

- name: Install system packages
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev
env:
DEBIAN_FRONDEND: NONINTERACTIVE

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

- name: Downgrade pip
run: pip3 install pip==19.3.1

- name: Install Ralph
run: pip3 install "${GITHUB_WORKSPACE}"

- name: Cache pip dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('base.txt', 'code_style.txt', 'dev.txt', 'docs.txt', 'hermes.txt', 'openstack.txt', 'prod.txt', 'prod_ldap.txt', '', 'test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-

- name: Install Ralph's python dependencies
run: |
pip3 install -r "${GITHUB_WORKSPACE}/requirements/test.txt"
pip3 install -r "${GITHUB_WORKSPACE}/requirements/openstack.txt"

- name: Test Ralph's settings
run: ./scripts/test_settings.sh prod test >/dev/null

python_tests:
name: Python tests
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.6]
db-engine: ["psql", "mysql"]
env:
TEST_DB_ENGINE: ${{ matrix.db-engine }}
DATABASE_USER: ralph_ng
DATABASE_PASSWORD: ralph_ng

services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s

postgres:
image: postgres:9.4.26
env:
POSTGRES_USER: ralph_ng
POSTGRES_PASSWORD: ralph_ng
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

# NOTE(romcheg): See the note regarging the mysql service above.
mysql:
image: mysql:5.6.45
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: ralph_ng
MYSQL_PASSWORD: ralph_ng
MYSQL_DATABASE: ralph_ng
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Unshallow local copy
run: git fetch --prune --unshallow

- name: Install system packages
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install libldap2-dev libsasl2-dev
env:
DEBIAN_FRONDEND: NONINTERACTIVE

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

- name: Downgrade pip
run: pip3 install pip==19.3.1

- name: Install Ralph
run: pip3 install "${GITHUB_WORKSPACE}"

- name: Cache pip dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('base.txt', 'code_style.txt', 'dev.txt', 'docs.txt', 'hermes.txt', 'openstack.txt', 'prod.txt', 'prod_ldap.txt', '', 'test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-

- name: Install Ralph's python dependencies
run: |
pip3 install -r "${GITHUB_WORKSPACE}/requirements/test.txt"
pip3 install -r "${GITHUB_WORKSPACE}/requirements/openstack.txt"

- name: Install PostgreSQL driver
if: ${{ matrix.db-engine == 'psql' }}
run: pip3 install psycopg2-binary

- name: Test ralph_dchp_agent using python-${{ matrix.python-version }}
run: python contrib/dhcp_agent/test.py

- name: Test Ralph with coverage using python-${{ matrix.python-version }}
run: make coverage
...
34 changes: 34 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish snapshot

on:
workflow_dispatch:
inputs:
branch:
description: 'For which branch build snapshot?'
required: true

jobs:
publish:

runs-on: ubuntu-latest
environment: ci

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}
- name: Publish docker snapshot
env:
RETRY_COUNT: 3
run: |
docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_PASSWORD }}
export RALPH_VERSION=$(shell ./get_version.sh show)
until [ "$RETRY_COUNT" -le 0 ]
do
make publish-docker-snapshot-image && break
RETRY_COUNT=$((RETRY_COUNT-1))
echo "==== Publish docker failed. Remaining retries: $RETRY_COUNT ===="
done
docker logout
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish

on:
release:
types: [ created ]

jobs:
publish:

runs-on: ubuntu-latest
environment: ci

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Verify github ref
run: |
TAG=$(echo "$GITHUB_REF" | grep -E -o '^refs\/tags\/[0-9]{8}\.[0-9]+$' || true)
if [[ -z "$TAG" ]]; then
>&2 echo "The \$GITHUB_REF does not point to a properly named tag."
exit 1
fi
- name: Build
run: make build-package
- name: Install packagecloud CLI
run: sudo gem install package_cloud
- name: Publish deb
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
run: package_cloud push allegro/ralph/ubuntu/bionic build/*.deb
- name: Publish docker
env:
WAIT_FOR_PACKAGECLOUD_DELAY: 10
RETRY_COUNT: 3
run: |
docker login --username ${{ secrets.DOCKER_HUB_USERNAME }} --password ${{ secrets.DOCKER_HUB_PASSWORD }}
export RALPH_VERSION=${GITHUB_REF#refs/*/}
until [ "$RETRY_COUNT" -le 0 ]
do
sleep $WAIT_FOR_PACKAGECLOUD_DELAY
make publish-docker-image && break
RETRY_COUNT=$((RETRY_COUNT-1))
echo "==== Publish docker failed. Remaining retries: $RETRY_COUNT ===="
done
docker logout
15 changes: 10 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
package-lock.json

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -60,11 +61,6 @@ src/ralph/settings/*local.py
src/ralph/cross_validator/settings_local.py
src/ralph/urls/*local.py

# Vagrant
vagrant/.vagrant
vagrant/Vagrantfile.local
vagrant/provision.local.sh

# mkdocs
site/

Expand All @@ -86,3 +82,12 @@ debian/ralph-core/*

# mypy
.mypy_cache/

# other
.python-version
tags
*.lock
.*.swp
.*.swo
.envrc
.direnv/
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

Loading