Skip to content

Commit

Permalink
Merge pull request #566 from ARGOeu/devel
Browse files Browse the repository at this point in the history
## [3.4.9] - 2023-08-03
  • Loading branch information
kkoumantaros authored Aug 3, 2023
2 parents 85cacf8 + 7c7cccc commit ca80af5
Show file tree
Hide file tree
Showing 23 changed files with 3,319 additions and 2,468 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
# Changelog

## [3.4.8] - 2023-07-06
## [3.4.9] - 2023-08-03

### Added

* ARGO-4358 Add command validation to probe candidate API view
* ARGO-4359 Add service type field to probe candidate model
* ARGO-4360 Add devel UI URL field to probe candidate model
* ARGO-4361 Add production UI URL field to probe candidate model

### Fixed

* ARGO-4363 Configure setup.py to include new DB backup script into wheel package

### Changed

* ARGO-4362 Simplify db backup in POEM
* ARGO-4354 Remove internal metrics from token protected YUM repos API view

## [3.4.8] - 2023-07-06

### Added

* ARGO-3573 Introduce negation feature for topology entity filter
* ARGO-3574 Introduce wildcard specification for topology entity filter
* ARGO-4241 Mark that tenant is combined tenant
* ARGO-4242 Option to combine two existing profiles from different tenants
* ARGO-4276 API endpoints to integrate probes to the Monitoring service
* ARGO-4318 View in POEM for probe candidates

### Fixed

* ARGO-4230 Error not displayed on metric override page
Expand Down
21 changes: 21 additions & 0 deletions bin/poem-backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

source /etc/profile.d/venv_poem.sh;
workon poem;

export PYTHONIOENCODING=utf-8

tenants=($(poem-manage poem_list_tenants));

for tenant in "${tenants[@]}"
do
if [[ $tenant == "all" ]]
then
schema="public"
filename=$VIRTUAL_ENV/var/db_backups/poem-db-backup-public_$(date "+%Y-%m-%d").json
else
schema=$(echo "$tenant" | awk '{print tolower($0)}')
filename=$VIRTUAL_ENV/var/db_backups/poem-db-backup-$schema\_$(date "+%Y-%m-%d").json
fi
eval poem-db -p -n "$schema" -f "$filename"
done
2 changes: 1 addition & 1 deletion cron/poem-db_backup
Original file line number Diff line number Diff line change
@@ -1 +1 @@
30 3 * * * postgres source /etc/profile.d/venv_poem.sh; workon poem; export LD_LIBRARY_PATH=/opt/rh/rh-postgresql10/root/usr/lib64:$LD_LIBRARY_PATH; export PATH=/opt/rh/rh-postgresql10/root/usr/bin:$PATH; pg_dump postgres > $VIRTUAL_ENV/var/db_backups/poem-db-backup-$(date "+\%Y-\%m-\%d")
30 3 * * * root /home/pyvenv/poem/bin/poem-backup
1 change: 1 addition & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ services:
- ../bin/poem-genseckey:$VENV/bin/poem-genseckey
- ../bin/poem-tenant:$VENV/bin/poem-tenant
- ../bin/poem-token:$VENV/bin/poem-token
- ../bin/poem-backup:$VENV/bin/poem-backup
networks:
app_net:
ipv4_address: 172.19.0.2
Expand Down
5 changes: 5 additions & 0 deletions poem/Poem/api/internal_views/probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ def get(self, request, cid=None):
"command": candidate.command,
"contact": candidate.contact,
"status": candidate.status.name,
"service_type": candidate.service_type if
candidate.service_type else "",
"created":
candidate.created.strftime("%Y-%m-%d %H:%M:%S"),
"last_update":
Expand Down Expand Up @@ -412,6 +414,8 @@ def get(self, request, cid=None):
"command": candidate.command,
"contact": candidate.contact,
"status": candidate.status.name,
"service_type": candidate.service_type if
candidate.service_type else "",
"created":
candidate.created.strftime("%Y-%m-%d %H:%M:%S"),
"last_update":
Expand Down Expand Up @@ -443,6 +447,7 @@ def put(self, request):
candidate.status = poem_models.ProbeCandidateStatus.objects.get(
name=request.data["status"]
)
candidate.service_type = request.data["service_type"]
candidate.save()

return Response(status=status.HTTP_201_CREATED)
Expand Down
26 changes: 19 additions & 7 deletions poem/Poem/api/tests/test_probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4313,7 +4313,8 @@ def setUp(self) -> None:
command="/usr/libexec/argo/probes/test/test-probe -H <hostname> "
"-t <timeout> --test",
contact="[email protected]",
status=status_testing
status=status_testing,
service_type="test.service.type"
)
self.candidate2 = poem_models.ProbeCandidate.objects.create(
name="some-probe",
Expand Down Expand Up @@ -4350,6 +4351,7 @@ def test_get_probe_candidates_list_superuser(self):
"-H <hostname> -t <timeout> --test --flag1 --flag2",
"contact": "[email protected]",
"status": "submitted",
"service_type": "",
"created":
self.candidate2.created.strftime("%Y-%m-%d %H:%M:%S"),
"last_update": self.candidate2.last_update.strftime(
Expand All @@ -4367,6 +4369,7 @@ def test_get_probe_candidates_list_superuser(self):
" -t <timeout> --test",
"contact": "[email protected]",
"status": "testing",
"service_type": "test.service.type",
"created":
self.candidate1.created.strftime("%Y-%m-%d %H:%M:%S"),
"last_update": self.candidate1.last_update.strftime(
Expand Down Expand Up @@ -4403,6 +4406,7 @@ def test_get_probe_candidate_by_id_superuser(self):
" -t <timeout> --test",
"contact": "[email protected]",
"status": "testing",
"service_type": "test.service.type",
"created":
self.candidate1.created.strftime("%Y-%m-%d %H:%M:%S"),
"last_update":
Expand Down Expand Up @@ -4450,7 +4454,8 @@ def test_put_probe_candidate_superuser(self):
"command": "/usr/libexec/argo/probes/test/new-probe -H <hostname> "
"-t <timeout> --test",
"contact": "[email protected]",
"status": "deployed"
"status": "deployed",
"service_type": "some.service.type"
}
content, content_type = encode_data(data)
request = self.factory.put(self.url, content, content_type=content_type)
Expand Down Expand Up @@ -4481,6 +4486,7 @@ def test_put_probe_candidate_superuser(self):
)
self.assertEqual(candidate.contact, "[email protected]")
self.assertEqual(candidate.status.name, "deployed")
self.assertEqual(candidate.service_type, "some.service.type")

def test_put_probe_candidate_regular_user(self):
data = {
Expand All @@ -4493,7 +4499,8 @@ def test_put_probe_candidate_regular_user(self):
"command": "/usr/libexec/argo/probes/test/new-probe -H <hostname> "
"-t <timeout> --test",
"contact": "[email protected]",
"status": "deployed"
"status": "deployed",
"service_type": "some.service.type"
}
content, content_type = encode_data(data)
request = self.factory.put(self.url, content, content_type=content_type)
Expand Down Expand Up @@ -4528,6 +4535,7 @@ def test_put_probe_candidate_regular_user(self):
)
self.assertEqual(candidate.contact, "[email protected]")
self.assertEqual(candidate.status.name, "testing")
self.assertEqual(candidate.service_type, "test.service.type")

def test_put_probe_candidate_nonexisting_id_superuser(self):
data = {
Expand All @@ -4540,7 +4548,8 @@ def test_put_probe_candidate_nonexisting_id_superuser(self):
"command": "/usr/libexec/argo/probes/test/new-probe -H <hostname> "
"-t <timeout> --test",
"contact": "[email protected]",
"status": "deployed"
"status": "deployed",
"service_type": "some.service.type"
}
content, content_type = encode_data(data)
request = self.factory.put(self.url, content, content_type=content_type)
Expand All @@ -4560,7 +4569,8 @@ def test_put_probe_candidate_nonexisting_id_regular_user(self):
"command": "/usr/libexec/argo/probes/test/new-probe -H <hostname> "
"-t <timeout> --test",
"contact": "[email protected]",
"status": "deployed"
"status": "deployed",
"service_type": "some.service.type"
}
content, content_type = encode_data(data)
request = self.factory.put(self.url, content, content_type=content_type)
Expand All @@ -4583,7 +4593,8 @@ def test_put_probe_candidate_nonexisting_status_superuser(self):
"command": "/usr/libexec/argo/probes/test/new-probe -H <hostname> "
"-t <timeout> --test",
"contact": "[email protected]",
"status": "nonexisting"
"status": "nonexisting",
"service_type": "some.service.type"
}
content, content_type = encode_data(data)
request = self.factory.put(self.url, content, content_type=content_type)
Expand All @@ -4605,7 +4616,8 @@ def test_put_probe_candidate_nonexisting_status_regular_user(self):
"command": "/usr/libexec/argo/probes/test/new-probe -H <hostname> "
"-t <timeout> --test",
"contact": "[email protected]",
"status": "nonexisting"
"status": "nonexisting",
"service_type": "some.service.type"
}
content, content_type = encode_data(data)
request = self.factory.put(self.url, content, content_type=content_type)
Expand Down
Loading

0 comments on commit ca80af5

Please sign in to comment.