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

feat: upgrade to sentry 2024.02 and bump python to 3.11 #44

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

dlouzan
Copy link
Member

@dlouzan dlouzan commented Feb 21, 2024

No description provided.

@dlouzan dlouzan self-assigned this Feb 21, 2024
@dlouzan
Copy link
Member Author

dlouzan commented Feb 21, 2024

@max-wittig @nejch Any idea how to solve this problem on the pipeline? Apparently the egg format for extras is not supported anymore, so it's not installing the whole development dependencies suite:

pip3 install -e git+https://github.com/getsentry/[email protected]#egg=sentry[dev]

DEPRECATION: git+https://github.com/getsentry/[email protected]#egg=sentry[dev] contains an egg fragment with a non-PEP 508 name pip 25.0 will enforce this behaviour change. A possible replacement is to use the req @ url syntax, and remove the egg fragment. Discussion can be found at https://github.com/pypa/pip/issues/11617

Obtaining sentry[dev] from git+https://github.com/getsentry/[email protected]#egg=sentry[dev]
  Cloning https://github.com/getsentry/sentry.git (to revision 24.2.0) to ./venv/src/sentry
  Running command git clone --filter=blob:none --quiet https://github.com/getsentry/sentry.git /home/runner/work/sentry-auth-oidc/sentry-auth-oidc/venv/src/sentry
  Running command git checkout -q cfcff1f4fda857dcddc9401efb689b6af92a3214
  Resolved https://github.com/getsentry/sentry.git to commit cfcff1f4fda857dcddc9401efb689b6af92a3214
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'

WARNING: sentry 24.2.0 does not provide the extra 'dev'

@max-wittig
Copy link
Member

Seems like maybe we can just remove the extra part, like here: https://github.com/getsentry/sentry-plugins/blob/master/Makefile#L26

From the logs:
WARNING: sentry 24.2.0 does not provide the extra 'dev'

@dlouzan
Copy link
Member Author

dlouzan commented Feb 22, 2024

@max-wittig Yes, that's what I mentioned above, those extras sentry[dev] are not supported by the upstream config anymore.

I tried the following:

  • Install manually the three requirements files available upstream requirements-base.txt, requirements-dev.txt, requirements-getsentry.txt
  • This made the tests go further, but now they refuse to load the sentry code because they use mypy with pydantic, and some tests should be ignored. Sadly I do not know how to disable that on code that is part of a library.

Exception:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/z003h08t/Development/github/siemens/sentry-auth-oidc/venv/src/sentry/src/sentry/services/hybrid_cloud/rpc.py", line 243, in _create_signatures
INTERNALERROR>     signature = RpcMethodSignature(cls, base_method)

...

INTERNALERROR>   File "/Users/z003h08t/Development/github/siemens/sentry-auth-oidc/venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1115, in _typed_dict_schema
INTERNALERROR>     raise PydanticUserError(
INTERNALERROR> pydantic.errors.PydanticUserError: Please use `typing_extensions.TypedDict` instead of `typing.TypedDict` on Python < 3.12.
INTERNALERROR>
INTERNALERROR> For further information visit https://errors.pydantic.dev/2.5/u/typed-dict-version

Upstream they ignore these errors in pyproject.toml: https://github.com/getsentry/sentry/blob/cfcff1f4fda857dcddc9401efb689b6af92a3214/pyproject.toml#L615. I tried adding that config to our pyproject, but it seems to be ignored.

@nejch
Copy link
Member

nejch commented Feb 22, 2024

@dlouzan hmm why don't we track sentry in poetry as a git dependency instead? (not related to the last error). I'll clone this locally and play around a bit, maybe I missed something. Not sure it needs to even be tracked as a git dependency either, it's more likely they used that to develop in parallel with sentry itself.

Since upstream was archived as the code is now in sentry, we probably have more freedom here. We don't really need the Makefile imo (upstream never had poetry anyway).

@dlouzan
Copy link
Member Author

dlouzan commented Feb 22, 2024

@nejch Yes, that'd be a very good idea, we need to adapt this fully as upstream completely killed any kind of support for server-side plugins.

@dlouzan
Copy link
Member Author

dlouzan commented Feb 22, 2024

@nejch As discussed offline, in my last try locally I downloaded all three upstream requirements-base.txt, requirements-dev.txt and requirements-getsentry.txt and pip install-ed all three locally. That at least made dependencies look good locally, but then mypy/pydantic gets in the way.

@nejch
Copy link
Member

nejch commented Feb 22, 2024

@dlouzan I went with dev-frozen so this might be better, but let's see.

@nejch nejch force-pushed the feat/sentry-202402 branch 3 times, most recently from 1959492 to 50d8132 Compare February 22, 2024 17:33
@nejch nejch changed the title feat: upgrade to sentry 2024.02 and bump python to 3.10 feat: upgrade to sentry 2024.02 and bump python to 3.11 Feb 23, 2024
@nejch nejch force-pushed the feat/sentry-202402 branch 2 times, most recently from 742d7f0 to 868af12 Compare February 23, 2024 13:57
@nejch nejch force-pushed the feat/sentry-202402 branch from 868af12 to 8d69e57 Compare February 23, 2024 13:59
oidc/provider.py Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
tests/test_provider.py Show resolved Hide resolved
@nejch nejch marked this pull request as ready for review February 23, 2024 14:10
@nejch
Copy link
Member

nejch commented Feb 23, 2024

@dlouzan @max-wittig this should be ready for review now. Let me know what you think, I had to work around some upstream sentry stuff.

We could try to convince them to add their conftest stuff as a plugin so we can just include it here programmatically, but I think the existence of this repo shows that might not happen 🙂

Edit: also we should probably have this as a breaking change.

@max-wittig max-wittig merged commit f2e256d into master Feb 26, 2024
3 checks passed
@max-wittig max-wittig deleted the feat/sentry-202402 branch February 26, 2024 08:14
@dlouzan
Copy link
Member Author

dlouzan commented Feb 26, 2024

@nejch Great one! Did we mark it anywhere as breaking?

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.

3 participants