Commit Graph

5126 Commits

Author SHA1 Message Date
Zuul 7df6a7d1d6 Merge "Catch specific exception when validating time zone" 2024-03-15 07:58:37 +00:00
Stephen Finucane 20d29d8a76 Add job to test with SQLAlchemy master (2.x)
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I7974f46bbecf56f208f172f3fe70da0f92c1a409
2024-03-11 13:58:54 +00:00
Stephen Finucane 947c7b4ffd db: Replace use of Engine.execute() method
Resolve the following RemovedIn20Warning warning:

  The Engine.execute() method is considered legacy as of the 1.x
  series of SQLAlchemy and will be removed in 2.0.

This also allows us to resolve the following RemovedIn20Warning warning:

  The current statement is being autocommitted using implicit
  autocommit, which will be removed in SQLAlchemy 2.0. Use the .begin()
  method of Engine or Connection in order to use an explicit transaction
  for DML and DDL statements.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I46f3277ea17e814e7b631750b2739f25e4395e22
2024-03-11 13:58:49 +00:00
Stephen Finucane 9a66301aef tests: Enable SQLAlchemy 2.0 deprecation warnings
Well, sort of. We enable them but immediately filter out the ones we're
actually seeing, the rationale being that we can address these in a
piecemeal fashion without the risk of introducing new issues.

There's a lot more to be done here. However, the work done in oslo.db
[1], nova [2], cinder [2] etc. should provide a guide for how to resolve
the outstanding issues.

We also take the opportunity to silence some rather annoying warnings
from webob and oslo_policy that are to be fixed later.

[1] https://review.opendev.org/q/topic:sqlalchemy-20+project:openstack/oslo.db
[2] https://review.opendev.org/q/topic:sqlalchemy-20+project:openstack/nova
[3] https://review.opendev.org/q/topic:sqlalchemy-20+project:openstack/cinder

Change-Id: I666cddbd2aef13c55118ea523b5e40bb924faf15
2024-03-11 13:58:41 +00:00
Stephen Finucane 90076472ac Configure 'cache_ok' for TypeDecorator implementation
Both the JSONEncodedDict and TimestampUTC can be safely used in a cache
key. Set 'cache_ok' to indicate this. This resolves the following
warnings:

  SAWarning: TypeDecorator TimestampUTC() will not produce a cache key
  because the ``cache_ok`` attribute is not set to True.  This can have
  significant performance implications including some performance
  degradations in comparison to prior SQLAlchemy versions.  Set this
  attribute to True if this type object's state is safe to use in a
  cache key, or False to disable this warning. (Background on this error
  at: https://sqlalche.me/e/14/cprf)

  SAWarning: TypeDecorator JSONEncodedDict() will not produce a cache
  key because the ``cache_ok`` attribute is not set to True.  This can
  have significant performance implications including some performance
  degradations in comparison to prior SQLAlchemy versions.  Set this
  attribute to True if this type object's state is safe to use in a
  cache ke y, or False to disable this warning. (Background on this
  error at: https://sqlalche.me/e/14/cprf)

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I589a0e378e155dcb181e6b1a9cca7aae4cad5349
2024-03-11 13:58:36 +00:00
Stephen Finucane 3bd47b2b50 db: Don't pass strings to 'Connection.execute'
Resolve the following RemovedIn20Warning warning:

  Passing a string to Connection.execute() is deprecated and will be
  removed in version 2.0.  Use the text() construct, or the
  Connection.exec_driver_sql() method to invoke a driver-level SQL
  string.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ic4518ca1a5aea94a72c9dc3e4393eb970b55c3dd
2024-03-11 13:58:30 +00:00
Stephen Finucane 45e0eaaa61 db: Remove use of autocommit
This is no longer necessary.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: If34b4511dbbd95598f4370eb7b28585d153cf118
2024-03-11 13:58:24 +00:00
Stephen Finucane b710d3fdad db: Replace use of LegacyEngineFacade
We aren't passing context objects around, hence this looks more like
ironic's use of oslo.db than e.g. nova or cinder. Nothing complicated
though.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ia0368cc128d495011776e80a27af04776e876fa9
2024-03-11 13:31:06 +00:00
Zuul 64e0f7c895 Merge "Bump hacking" 2024-02-21 07:40:04 +00:00
Zuul 8e7f091144 Merge "Replace md5 with oslo version" 2024-02-17 06:59:11 +00:00
Takashi Kajinami f1e87fadd4 Ensure [telemetry_services] alarm_backend is set properly
... in PostgreSQL job.

Change-Id: I5c150eaac2f7bd885ac973d7527da4cba3cdf214
2024-02-14 11:09:20 +00:00
Zuul e47e4ac7f9 Merge "tox: Drop envdir" 2024-02-06 11:15:58 +00:00
Dr. Jens Harbott e223ac14a7 Fix releasenotes build af yoga moved to unmaintained
The stable/yoga branch has been deleted and replaced with the
unmaintained/yoga branch, update the reno config accordingly.

Change-Id: I2c76cc06f371a284eb3f5d30523add0b7f77b157
2024-02-02 17:41:38 +01:00
Takashi Kajinami 925048f471 tox: Drop envdir
tox now always recreates an env although the env is shared using envdir
options.
~~~
$ tox -e genpolicy
genpolicy: recreate env because env type changed from
{'name': 'genconfig', 'type': 'VirtualEnvRunner'} to
{'name': 'genpolicy', 'type': 'VirtualEnvRunner'}
~~~

According to the maintainer of tox, this functionality is not intended
to be supported.
https://github.com/tox-dev/tox/issues/425#issuecomment-1011944293

Change-Id: I8b4f588bfc38aa078bca243ee2ef38f84a92f62d
2024-02-02 23:45:51 +09:00
Takashi Kajinami fd87af8719 Replace md5 with oslo version
This follows what was already done in the other projects like [1].

In FIPS mode, md5 is allowed only in non-security contexts. This
change disables the security context in the md5 call to determine
the hash for workload partitioning, because this usage does not
involve any security risks.

[1] 8027d907109b6b3c96623f9793aff752cec8ed12

Change-Id: I7d622a6e7d324a765760819c024295b57990f95c
2024-01-31 08:01:46 +00:00
Takashi Kajinami d8b3f58c0c Bump hacking
hacking 3.0.x is too old.

Change-Id: I2bbe8b45596f4530284e1ba5946fc3fa238649a7
2024-01-27 22:22:47 +09:00
Takashi Kajinami d2c2e1b671 Catch specific exception when validating time zone
... instead of the generic Exception to avoid hiding unexpected errors.

Change-Id: I5200e097bec2e0bd43f25a3c457391b10f913930
2024-01-27 20:21:16 +09:00
Zuul 3d49da3ce6 Merge "Update python classifier in setup.cfg" 2024-01-11 06:01:00 +00:00
Zuul a61215e5be Merge "Dump loaded options during start up" 2024-01-09 06:46:34 +00:00
Jaromir Wysoglad 16ea9ee168 Add GITREPO for aodhclient
Calling git_clone_by_name without the GITREPO set doesn't work
correctly.

Change-Id: I449189431564b983f044c3a2bca2407f5a1a11c1
2024-01-04 08:44:15 -05:00
Ghanshyam Mann 64b937b882 Update python classifier in setup.cfg
As per the current release tested runtime, we test
python version from 3.8 to 3.11 so updating the
same in python classifier in setup.cfg

Change-Id: I3cd0d2e4ce5bffd6af3cce480a5de09860f5d3f7
2024-01-04 01:09:23 -08:00
Takashi Kajinami d6416e32e4 doc: Drop DJANGO_SETTINGS_MODULE environment
... because django is not relevant to aodh.

Change-Id: I23baadd4c69de2b1f0fac335ddc48bb5e3ec971f
2023-12-18 21:03:28 +09:00
Takashi Kajinami ac365555f4 Dump loaded options during start up
... so that operators can review effective values (except for secret
information such as password) from the log.

Change-Id: Ic094df537b5f7333be38c249cdec59a10d2e2660
2023-11-28 13:26:26 +00:00
Erno Kuvaja 59a43ef35a Move functional tests to tempest_plugin
Remove pifpaf and dependencies to gnocchi for tox test runs.

Remove redundant gabbi tests.

Move wsme & query unit tests from fuctional to unit test folder where
they belong.

Remove integration tests which has been covered in the new tempest
cases in the depends on patch.

Remove run-tests.sh in favour of just calling stestr.

Depends-On: https://review.opendev.org/c/openstack/telemetry-tempest-plugin/+/901838
Change-Id: I5b33cba27dfcb2bbdf12c9bc6b28ecff9aa18d93
2023-11-28 08:57:16 +00:00
Zuul 38495d63cf Merge "tests: Remove duplicate fixture config" 2023-11-27 09:01:48 +00:00
Zuul 5f11352008 Merge "setup: Remove unused dependencies" 2023-11-27 09:01:47 +00:00
Stephen Finucane c2f3f7c0c1 setup: Re-add Python version classifiers
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I808e6166975882cf22279ee9045d572bc2bf70d2
2023-11-16 14:53:59 +00:00
Stephen Finucane 4008f65a1c tests: Remove duplicate fixture config
This is already done in the 'aodh.tests.functional.db.TestBase' base
class.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I33e40cdb00620dc67e214f181068d4a024aa1447
2023-11-16 14:52:35 +00:00
Stephen Finucane 6c032153bf setup: Remove unused dependencies
None of oslo.context, debtcollector or testresources are used by aodh.
Remove them, along with the warnings about requirements order that no
longer applies with the "new" dependency resolver introduced in pip
20.3.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I37a1ffe9c9617262eb5e40fc3ad1b02277a11513
2023-11-16 14:52:35 +00:00
Stephen Finucane 9ebb2452c6 setup: Remove sqlalchemy extra dep
This is already listed in requirements.txt so it's not necessary to
repeat it here.

We also remove the Python version classifiers since they're noise:
'python_requires' does this for us in a machine-readable manner
nowadays.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ia2c8a5792c175fb0a8762e61ff76383119251cdd
2023-11-16 14:52:08 +00:00
Zuul 197440c3c8 Merge "Add Prometheus evaluator" 2023-11-07 16:02:59 +00:00
Martin Mágr f932265290 Add Prometheus evaluator
This patch adds threshold evaluator for Prometheus metrics.
Alarms are based on Prometheus query only. The library
python-observabilityclient is used for querying Prometheus.

Co-authored-by: Jaromír Wysoglad <jwysogla@redhat.com>
Depends-On: Ie7477e0b11479449f7f13c7a784737ac70059964
Change-Id: I72e124cca4398b78f7ed12e1db3f66bdbfcb196e
2023-11-07 06:22:28 +00:00
Zuul 99df2a40bf Merge "Remove python2 shebang from some files" 2023-11-07 02:15:05 +00:00
Takashi Kajinami 0ca1452bed Remove python2 shebang from some files
... because these are not actually necessary.

Change-Id: I11622a2a2dbf8ff7b5a32bfa3bea380be12bb1d0
2023-11-04 15:18:54 +00:00
Jaromir Wysoglad 76d367be56 Fix py311 job
The py311 job has currently trouble locating mysqld.
On debian the mysqld binary is installed to /usr/sbin,
but on debian /usr/sbin isn't in PATH by default.
This patch appends /usr/sbin to PATH.

Change-Id: I89b2631f38e6a7292d6e58b4ddee6f7fdfc6fa9f
2023-10-04 10:06:32 -04:00
Zuul ccf41cefef Merge "Fix bindep.txt for python 3.11 job(Debian Bookworm)" 2023-10-02 20:39:40 +00:00
Zuul a9fbc1cd88 Merge "tox: Remove unnecessary configuration" 2023-10-02 11:52:49 +00:00
Zuul c19cb61f46 Merge "Use devstack helper for installation" 2023-09-27 12:11:58 +00:00
Zuul b7f9d2b21d Merge "Disable GLOBAL_VENV" 2023-09-25 11:46:54 +00:00
Zuul e8194d9d9e Merge "Update master for stable/2023.2" 2023-09-25 08:08:52 +00:00
Erno Kuvaja ab29096236 Revert "Fix docs job"
The actual cause is been solved here
Depends-on: https://review.opendev.org/c/openstack/requirements/+/896195

This reverts commit 2a2958bd63.

Change-Id: I29123962edc4b0e1423dbbf1b2705a4692adbf6c
2023-09-22 16:18:15 +01:00
Takashi Kajinami a55d9620e9 Use devstack helper for installation
... to make sure the destination is selected according to some
environment variables in devstack.

Change-Id: I1de8dbf693a7109b4fcceea98eab9f0782f7bd4a
2023-09-22 13:14:13 +00:00
Takashi Kajinami 8de7585f37 Disable GLOBAL_VENV
Devstack recently introduced the functionality to use a single venv [1]
but some devstack plugins in telemetry project are not compatible with
this change.

This disables the option as a short term workaround.

[1] https://review.opendev.org/c/openstack/devstack/+/558930

Change-Id: Ic300c90a19ca348b8316e63190e60b67f6b73ad3
Story: 2010912
Related-Bug: 2031639
Related-Bug: 2034891
2023-09-22 13:13:55 +00:00
Stephen Finucane 2a2958bd63 Fix docs job
aodh is relying on WSME, which is effectively no longer maintained.
We're waiting on a new release to fix compatibility with Sphinx 5.0
(!!!). While we wait for this, monkey patch the fix in and allow us to
unblock the gate.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Ia1fe3ac109973a3414911f3fa0ab4a3106a9e2b5
2023-09-21 15:22:26 +01:00
Stephen Finucane 29b88f5db5 tox: Remove unnecessary configuration
tox 4 is Python 3-only. We don't need to configure a basepython now.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I539cdad868fe930a4cf660ed23290b05294292e0
2023-09-21 12:53:04 +01:00
OpenStack Release Bot aee785e86d Update master for stable/2023.2
Add file to the reno documentation build to show release notes for
stable/2023.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.2.

Sem-Ver: feature
Change-Id: I77620d621e4de842415b4fd5b5bc40863d84550d
2023-09-15 14:10:20 +00:00
Ghanshyam Mann 6c3e3df3b2 Fix bindep.txt for python 3.11 job(Debian Bookworm)
Python 3.11 job run on Debian Bookworm which does
not the mysql pkg for example, mariadb-server, libmysqlclient-dev
instead they have mariadb. Updating bindep.txt file
to adjust the pkgs as per Debian bookworm.

Change-Id: I29c476b4da2a0b0fda5c0d42df8470b801cc224c
2023-09-06 16:51:58 -05:00
OpenStack Proposal Bot 763bb40185 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I3a2ac4493ccf509dbce9ce05784754626d29a7e9
2023-05-11 03:51:51 +00:00
Zuul 94dc273712 Merge "Add check-requirements job" 2023-05-10 21:06:28 +00:00
Zuul 87c60bbf2f Merge "Remove "test" extra deps from setup.cfg" 2023-05-10 15:21:33 +00:00