Skip to content

Conversation

@denizs
Copy link
Member

@denizs denizs commented Aug 15, 2024

This PR migrates the project to our new unified platform APIs hosted under /api/v2, by

  • Unifying API clients which we previously had separated due to different and inconsistent pagination schemes.
  • Changing the authentication scheme to Bearer (from Token)
  • Moving from numeric ids for Sites to uuids

Moreover, this PR fixes a bug in datetime_before_today_strategy that caused flaky test results.

How to review
Commit by commit. I've done my best to keep commits atomic and semantic.

Closes

@denizs denizs force-pushed the major/migrate-to-platform-apis branch 2 times, most recently from 9c8c207 to 9c3bb7c Compare August 16, 2024 10:23
@denizs denizs changed the title Migrate to platform apis Migrate to platform APIs Aug 16, 2024
@denizs denizs force-pushed the major/migrate-to-platform-apis branch from 9c3bb7c to cd246ba Compare August 16, 2024 10:25
@denizs denizs force-pushed the major/migrate-to-platform-apis branch from cd246ba to 62bf4cd Compare August 16, 2024 10:28
@denizs denizs marked this pull request as ready for review August 16, 2024 10:52
@github-actions
Copy link

github-actions bot commented Aug 16, 2024

Coverage results

Update on 2025-05-05 14:38:06.962550955 +0000

This is the coverage report for commit 0c06385

Name                                                               Stmts   Miss  Cover   Missing
------------------------------------------------------------------------------------------------
.tox/py/lib/python3.12/site-packages/enlyze/__init__.py                4      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/api_client/client.py      65      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/api_client/models.py      85      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/auth.py                   13      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/client.py                105      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/constants.py               7      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/errors.py                  4      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/iterable_tools.py          7      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/models.py                117      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/schema.py                 25      0   100%
.tox/py/lib/python3.12/site-packages/enlyze/validators.py             38      0   100%
------------------------------------------------------------------------------------------------
TOTAL                                                                470      0   100%

2 empty files skipped.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the synthesis of the previously single client prior to the introduction of Production Runs.

@denizs denizs requested review from cipherself and daniel-k and removed request for cipherself August 16, 2024 11:36
Copy link
Member

@daniel-k daniel-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't reviewed it yet, just noticed that coverage is missing for one line:

Name                                                               Stmts   Miss  Cover   Missing
------------------------------------------------------------------------------------------------
.tox/py/lib/python3.12/site-packages/enlyze/api_client/client.py      64      1    98%   149

@daniel-k daniel-k linked an issue Sep 6, 2024 that may be closed by this pull request
@denizs denizs requested review from cipherself and daniel-k April 24, 2025 11:21
denizs and others added 11 commits April 29, 2025 12:36
Co-authored-by: Daniel Krebs <daniel-k@users.noreply.github.com>
Co-authored-by: Daniel Krebs <daniel-k@users.noreply.github.com>
when this PR was submitted, the production run's machine field
used to be an expanded subset of the machines endpoint featuring
the machine's uuid and name field.
After our refactor to a uuid reference of `machine`, MachineBase
has become obsolete.
@denizs denizs requested a review from daniel-k April 29, 2025 15:29
Copy link
Member

@daniel-k daniel-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing my comments so far. What about these two?

@denizs denizs requested review from daniel-k and removed request for cipherself May 5, 2025 14:55
@denizs denizs merged commit bfc00b7 into master May 5, 2025
12 checks passed
@denizs denizs deleted the major/migrate-to-platform-apis branch May 5, 2025 15:49
denizs added a commit that referenced this pull request May 5, 2025
denizs added a commit that referenced this pull request May 5, 2025
daniel-k pushed a commit that referenced this pull request May 13, 2025
daniel-k added a commit that referenced this pull request May 13, 2025
daniel-k added a commit that referenced this pull request May 13, 2025
This PR fixes issues we overlooked when merging #47. It depends on #54
so that we can review the fixes in isolation and don't get distracted
with code that has already been approved.

- remove `Site.address`: we don't publish this property anymore since
`v2`
- refactor `get_timeseries()` to use `POST` with slightly changed schema
in `v2`

Closes #45
daniel-k added a commit that referenced this pull request May 26, 2025
In both #47 and #55 we have missed breaking changes in the production
runs endpoint of the v2 API:

- production runs don't contain the product resource anymore, but only a
reference (UUID)
- product and production order "code" was renamed to "external id"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to /api/v2

3 participants