GraceDB Client merge requestshttps://git.ligo.org/computing/gracedb/client/-/merge_requests2023-04-18T17:08:09Zhttps://git.ligo.org/computing/gracedb/client/-/merge_requests/76Update default scitoken scope2023-04-18T17:08:09ZDuncan Macleodduncan.macleod@ligo.orgUpdate default scitoken scopeThis MR closes #35+.This MR closes #35+.Critical Path O4 Developmenthttps://git.ligo.org/computing/gracedb/client/-/merge_requests/69Remove all use of six2023-09-07T01:59:03ZDuncan Macleodduncan.macleod@ligo.orgRemove all use of sixThis MR replaces all use of `six` with standard python3 syntax.This MR replaces all use of `six` with standard python3 syntax.O4 Debugging and Improvementshttps://git.ligo.org/computing/gracedb/client/-/merge_requests/68Remove use of mock package2023-09-06T02:25:58ZDuncan Macleodduncan.macleod@ligo.orgRemove use of mock packageThis MR replaces any protected imports of `unittest.mock` with regular imports, and replaces any use of the third-party `mock` package throughout.This MR replaces any protected imports of `unittest.mock` with regular imports, and replaces any use of the third-party `mock` package throughout.O4 Debugging and Improvementshttps://git.ligo.org/computing/gracedb/client/-/merge_requests/67Remove unnecessary requirement on safe-netrc2023-09-06T02:13:09ZDuncan Macleodduncan.macleod@ligo.orgRemove unnecessary requirement on safe-netrcThis MR removes an unnecessary dependency on `safe-netrc`; this is a first-class requirement of `igwn-auth-utils` now.This MR removes an unnecessary dependency on `safe-netrc`; this is a first-class requirement of `igwn-auth-utils` now.O4 Debugging and Improvementshttps://git.ligo.org/computing/gracedb/client/-/merge_requests/29Fix broken file upload in Python 32018-09-13T18:50:23ZTito Dal CantonFix broken file upload in Python 3Here I try to fix #11 myself. It works:
```
$ gracedb upload G7330 1219568639.528.png test
Server returned 201
```Here I try to fix #11 myself. It works:
```
$ gracedb upload G7330 1219568639.528.png test
Server returned 201
```Readiness for second OPA testTanner PrestegardTanner Prestegardhttps://git.ligo.org/computing/gracedb/client/-/merge_requests/23Superevents2018-09-19T20:26:13ZTanner PrestegardSupereventsAdding methods for accessing, creating, and manipulating superevents. Updating current methods to function for both events and superevents.Adding methods for accessing, creating, and manipulating superevents. Updating current methods to function for both events and superevents.Readiness for second OPA testTanner PrestegardTanner Prestegardhttps://git.ligo.org/computing/gracedb/client/-/merge_requests/89catch decoding error (barf) and return message to user2024-03-10T21:36:07ZAlexander Pacecatch decoding error (barf) and return message to userhttps://git.ligo.org/computing/helpdesk/-/issues/5596https://git.ligo.org/computing/helpdesk/-/issues/5596https://git.ligo.org/computing/gracedb/client/-/merge_requests/88Removing __future__ imports left over from Python 22023-12-04T22:48:31ZDaniel WysockiRemoving __future__ imports left over from Python 2Removing some `from __future__` imports which haven't been relevant since Python 2 support was dropped.Removing some `from __future__` imports which haven't been relevant since Python 2 support was dropped.Daniel WysockiDaniel Wysockihttps://git.ligo.org/computing/gracedb/client/-/merge_requests/87Fixes to docs and introduction of doctest2023-12-04T23:25:22ZDaniel WysockiFixes to docs and introduction of doctest- Added a new unit test that runs all code examples using `doctest`
- This required mocking up `GraceDb` (to avoid making actual requests, except for fetching some initial data, which it restricts to `gracedb-test`) and `builtins.open`...- Added a new unit test that runs all code examples using `doctest`
- This required mocking up `GraceDb` (to avoid making actual requests, except for fetching some initial data, which it restricts to `gracedb-test`) and `builtins.open` (to pretend files like `/path/to/fake/file.xml` were real)
- Fixed many of the code examples which were either stuck on Python 2 syntax or just wrong
- Removed `from io import open` in `rest.py`
- In Python 2 the built-in `open` was different from `io.open`. Now they are aliases.
Some important caveats:
- A number of examples are not actually run, using the `doctest:+SKIP` directive through a trailing in-line comment. This is a potential area for future improvement, but probably fine as-is. Things currently being skipped:
- Expected HTTP status codes and response bodies did not match the example, given that they were mocked up to do nothing.
- The `GraceDb.files()` method would have required a bit more mocking, so I skipped instead
- Any markup files (e.g., our Sphinx docs) are not run with doctest. This can be added in the future, but would require
1. Adding the [`doctest` Sphinx extension](https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html)
2. Adding the `.. doctest::` directive before each example
3. Figuring out some way to run these tests with our mocked `GraceDb` class and `builtins.open` (probably possible through Sphinx's `conf.py`
- I did still read over all of the code examples in markup files and confirmed there are no visible errors, including function signature mistakes, though I did not actually run these examples.
- Each `doctest` example is potentially creating a new `GraceDb` session, if it calls `GraceDb`. We're already doing this in the other unit tests, so it's probably not a huge amount of extra overhead, but there are quite a few of these so we should be careful that we're not negatively impacting service performance.
- We still use the `GraceDb.camelCase` versions of methods, which are backwards compatible aliases to our newer, preferred `GraceDb.snake_case` versions. We probably want to change all of these to avoid encouraging use of old names. We could even cause the unit test to fail if an alias is used instead of the original name.Daniel WysockiDaniel Wysockihttps://git.ligo.org/computing/gracedb/client/-/merge_requests/86Downgrading version of Python used by RTD2023-09-12T03:43:58ZDaniel WysockiDowngrading version of Python used by RTDJumping from 3.7 to 3.9 didn't work because of deprecated features in
RTD's config. The old feature set should still support 3.8, so this
is downgrading to that for now.Jumping from 3.7 to 3.9 didn't work because of deprecated features in
RTD's config. The old feature set should still support 3.8, so this
is downgrading to that for now.Daniel WysockiDaniel Wysockihttps://git.ligo.org/computing/gracedb/client/-/merge_requests/85Using Python 3.9 in RTD builds2023-09-12T03:18:50ZDaniel WysockiUsing Python 3.9 in RTD buildsDaniel WysockiDaniel Wysockihttps://git.ligo.org/computing/gracedb/client/-/merge_requests/84fix syntax error2023-09-07T02:32:18ZAlexander Pacefix syntax errorintroduced in: https://git.ligo.org/computing/gracedb/client/-/merge_requests/69introduced in: https://git.ligo.org/computing/gracedb/client/-/merge_requests/69https://git.ligo.org/computing/gracedb/client/-/merge_requests/83remove old python versions from testing, add new ones2023-09-06T06:06:43ZAlexander Paceremove old python versions from testing, add new onesfixes https://git.ligo.org/computing/gracedb/client/-/issues/42fixes https://git.ligo.org/computing/gracedb/client/-/issues/42https://git.ligo.org/computing/gracedb/client/-/merge_requests/82modify the list of retriable status codes, and open up the list of allowed me...2023-09-08T03:00:58ZAlexander Pacemodify the list of retriable status codes, and open up the list of allowed methodsfixes: https://git.ligo.org/computing/gracedb/client/-/issues/41fixes: https://git.ligo.org/computing/gracedb/client/-/issues/41https://git.ligo.org/computing/gracedb/client/-/merge_requests/81Always exit with code 0 from flake82023-09-05T07:35:30ZDuncan Macleodduncan.macleod@ligo.orgAlways exit with code 0 from flake8This MR patches the `syntax` CI job config to pass the `--exit-zero` option to `flake8` so that the job only fails if `flake8` crashes, not if it finds lint. Lint will be reported in the [code quality widget](https://git.ligo.org/help/ci...This MR patches the `syntax` CI job config to pass the `--exit-zero` option to `flake8` so that the job only fails if `flake8` crashes, not if it finds lint. Lint will be reported in the [code quality widget](https://git.ligo.org/help/ci/testing/code_quality.html#merge-request-widget) on the merge request.https://git.ligo.org/computing/gracedb/client/-/merge_requests/80Fix lint complaints about type comparisons2023-09-06T01:55:22ZDuncan Macleodduncan.macleod@ligo.orgFix lint complaints about type comparisonsThis MR fixes lint complaints from `flake8` to do with exact type comparisons, replacing all with calls to `isinstance`.This MR fixes lint complaints from `flake8` to do with exact type comparisons, replacing all with calls to `isinstance`.https://git.ligo.org/computing/gracedb/client/-/merge_requests/79Add BuildRequires: python3-devel in the RPM spec file2023-09-07T01:54:13ZDuncan Macleodduncan.macleod@ligo.orgAdd BuildRequires: python3-devel in the RPM spec fileThis MR patches the RPM `.spec` file to include `BuildRequires: python3-devel`, as recommended by the [Fedora packaging guide](https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_buildrequire_python3_devel).This MR patches the RPM `.spec` file to include `BuildRequires: python3-devel`, as recommended by the [Fedora packaging guide](https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_buildrequire_python3_devel).https://git.ligo.org/computing/gracedb/client/-/merge_requests/78Update to igwn-auth-utils 1.0.02023-09-07T11:48:48ZDuncan Macleodduncan.macleod@ligo.orgUpdate to igwn-auth-utils 1.0.0This MR fixes #39 by updating the `ligo.gracedb.client` module to work with `igwn-auth-utils-1.0.0`.This MR fixes #39 by updating the `ligo.gracedb.client` module to work with `igwn-auth-utils-1.0.0`.https://git.ligo.org/computing/gracedb/client/-/merge_requests/77Enable Client Retrying2023-04-18T17:08:08ZAlexander PaceEnable Client Retryingsee:
* https://git.ligo.org/computing/gracedb/server/-/issues/279#note_676287
* https://git.ligo.org/computing/gracedb/client/-/issues/37
I've tested this (so far) by triggering 502's on gracedb-dev1 (by forcibly restarting gunicor...see:
* https://git.ligo.org/computing/gracedb/server/-/issues/279#note_676287
* https://git.ligo.org/computing/gracedb/client/-/issues/37
I've tested this (so far) by triggering 502's on gracedb-dev1 (by forcibly restarting gunicorn), and also triggering `ConnectionError`s on gracedb-dev1 by logging in as root and restarting apache. Without the `Retry`, the code dies. With the `Retry`, it fully recovers.
It does look like there is another TLS renegotiation when the code reconnects, but I don't see another way around that.
Next step is to get it working with the certificate reloading, and then it should be good to go.https://git.ligo.org/computing/gracedb/client/-/merge_requests/75ligo-gracedb-2.10.02022-12-13T02:08:42ZAlexander Paceligo-gracedb-2.10.0Changes:
* label superevents/events when creating logs
* testing fixes
* packaging changesChanges:
* label superevents/events when creating logs
* testing fixes
* packaging changes