Skip to content
This repository was archived by the owner on Apr 26, 2020. It is now read-only.

Conversation

@petermein
Copy link
Contributor

@petermein petermein commented Jan 8, 2019

Sentry requires the content-type headers to accept certain api requests. I've added these headers to both requests.

Q A
Bug fix? Yes
New feature? No
BC breaks? No
Deprecations? No
Fixed tickets N/A

Do not forget to add notes about your changes to CHANGELOG.md

Already covert in the previous recipe message

@petermein petermein changed the title Added content type headers to sentry requests [Sentry] Added content type headers to sentry requests Jan 8, 2019
@antonmedv antonmedv merged commit f330fd5 into deployphp:master Jan 8, 2019
@flo-sch
Copy link

flo-sch commented Jan 19, 2019

NB: this (actually all the latest changes related to sentry API changes) breaks the recipe for self-hosted, non up-to-date sentry servers.

@antonmedv
Copy link
Member

Hmmm, how can we fix it and do not break?

@flo-sch do you use master brunch?

@flo-sch
Copy link

flo-sch commented Jan 19, 2019

Hey @antonmedv, I am very uncertain actually, since I do not know Sentry that much, neither their API changes (IMHO it is quite unfortunate that they do not version their API... Would make things quite easier for us).

Here, I refer to a ~2/3 years old, self-hosted version of Sentry that has never been updated apparently.
Since I am not in charge of it, I cannot do it myself, but it would probably be easy to update it...

Anyway, I noticed 2 errors:

  1. The Content-Type header, the old sentry denies requests with those two
    ->header('Content-Type: application/json')
    and
    ->header('Content-Type: application/json')
  2. The deployment $response['id'], no "id" key in the response for me: the recipe throws an Exception if if succeeds apparently
    if (!isset($response['id'], $response['environment'])) {

I do not see an easy solution for that, despite some way of versioning the recipe itself.
To be honest, I do not think it is worth focusing on that, it seems highly difficult to keep it up for everyone, maintenance wise, since sentry does not provide an API version.

In that case, I would rather stick to an older version of this recipe (requires to keep an old version of all recipes then?), or duplicate it internally if I have to.

But it could be nice to mention which version of Sentry this recipe works with, somewhere in the documentation?

@antonmedv
Copy link
Member

Yes, better docs is required. I'm looking towards this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants