Skip to content

feat(integrations): Update example integration for api pipeline#113350

Merged
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/feat-integrations-update-example-integration-for-api-pipeline
Apr 21, 2026
Merged

feat(integrations): Update example integration for api pipeline#113350
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/feat-integrations-update-example-integration-for-api-pipeline

Conversation

@evanpurkhiser

Copy link
Copy Markdown
Member

No description provided.

@evanpurkhiser
evanpurkhiser requested review from a team as code owners April 17, 2026 20:11
@evanpurkhiser
evanpurkhiser requested review from a team and removed request for a team April 17, 2026 20:11
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 17, 2026
@github-actions

github-actions Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Backend Test Failures

Failures on fa2a8af in this run:

tests/sentry/integrations/web/test_organization_integration_setup.py::OrganizationIntegrationSetupTest::test_allow_integration_with_all_features_disabled_but_one_unregisteredlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/web/test_organization_integration_setup.py:71: in test_allow_integration_with_all_features_disabled_but_one_unregistered
    self.test_basic_flow()
tests/sentry/integrations/web/test_organization_integration_setup.py:34: in test_basic_flow
    resp = self.client.get(self.path)
.venv/lib/python3.13/site-packages/django/test/client.py:1124: in get
    response = super().get(
.venv/lib/python3.13/site-packages/django/test/client.py:475: in get
    return self.generic(
.venv/lib/python3.13/site-packages/django/test/client.py:671: in generic
    return self.request(**r)
.venv/lib/python3.13/site-packages/django/test/client.py:1087: in request
    self.check_exception(response)
.venv/lib/python3.13/site-packages/django/test/client.py:802: in check_exception
    raise exc_value
.venv/lib/python3.13/site-packages/django/core/handlers/exception.py:55: in inner
    response = get_response(request)
.venv/lib/python3.13/site-packages/django/core/handlers/base.py:197: in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
.venv/lib/python3.13/site-packages/django/views/generic/base.py:105: in view
    return self.dispatch(request, *args, **kwargs)
src/sentry/silo/base.py:157: in override
    return original_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/utils/decorators.py:48: in _wrapper
    return bound_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/views/decorators/csrf.py:65: in _view_wrapper
    return view_func(request, *args, **kwargs)
src/sentry/web/frontend/base.py:475: in dispatch
    return self.handle(request, *args, **kwargs)
src/sentry/integrations/web/organization_integration_setup.py:29: in handle
    return pipeline.current_step()
src/sentry/pipeline/base.py:184: in current_step
    return self.finish_pipeline()
src/sentry/integrations/pipeline.py:234: in finish_pipeline
    data = self.provider.build_integration(self.state.data)
src/sentry/integrations/example/integration.py:264: in build_integration
    return {"external_id": state["name"]}
E   KeyError: 'name'
tests/sentry/integrations/web/test_organization_integration_setup.py::OrganizationIntegrationSetupTest::test_regular_provider_unaffected_by_requires_feature_flag_checklog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/web/test_organization_integration_setup.py:96: in test_regular_provider_unaffected_by_requires_feature_flag_check
    resp = self.client.get(self.path)
.venv/lib/python3.13/site-packages/django/test/client.py:1124: in get
    response = super().get(
.venv/lib/python3.13/site-packages/django/test/client.py:475: in get
    return self.generic(
.venv/lib/python3.13/site-packages/django/test/client.py:671: in generic
    return self.request(**r)
.venv/lib/python3.13/site-packages/django/test/client.py:1087: in request
    self.check_exception(response)
.venv/lib/python3.13/site-packages/django/test/client.py:802: in check_exception
    raise exc_value
.venv/lib/python3.13/site-packages/django/core/handlers/exception.py:55: in inner
    response = get_response(request)
.venv/lib/python3.13/site-packages/django/core/handlers/base.py:197: in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
.venv/lib/python3.13/site-packages/django/views/generic/base.py:105: in view
    return self.dispatch(request, *args, **kwargs)
src/sentry/silo/base.py:157: in override
    return original_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/utils/decorators.py:48: in _wrapper
    return bound_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/views/decorators/csrf.py:65: in _view_wrapper
    return view_func(request, *args, **kwargs)
src/sentry/web/frontend/base.py:475: in dispatch
    return self.handle(request, *args, **kwargs)
src/sentry/integrations/web/organization_integration_setup.py:29: in handle
    return pipeline.current_step()
src/sentry/pipeline/base.py:184: in current_step
    return self.finish_pipeline()
src/sentry/integrations/pipeline.py:234: in finish_pipeline
    data = self.provider.build_integration(self.state.data)
src/sentry/integrations/example/integration.py:264: in build_integration
    return {"external_id": state["name"]}
E   KeyError: 'name'
tests/sentry/integrations/web/test_organization_integration_setup.py::OrganizationIntegrationSetupTest::test_allow_integration_with_all_features_enabledlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/web/test_organization_integration_setup.py:51: in test_allow_integration_with_all_features_enabled
    self.test_basic_flow()
tests/sentry/integrations/web/test_organization_integration_setup.py:34: in test_basic_flow
    resp = self.client.get(self.path)
.venv/lib/python3.13/site-packages/django/test/client.py:1124: in get
    response = super().get(
.venv/lib/python3.13/site-packages/django/test/client.py:475: in get
    return self.generic(
.venv/lib/python3.13/site-packages/django/test/client.py:671: in generic
    return self.request(**r)
.venv/lib/python3.13/site-packages/django/test/client.py:1087: in request
    self.check_exception(response)
.venv/lib/python3.13/site-packages/django/test/client.py:802: in check_exception
    raise exc_value
.venv/lib/python3.13/site-packages/django/core/handlers/exception.py:55: in inner
    response = get_response(request)
.venv/lib/python3.13/site-packages/django/core/handlers/base.py:197: in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
.venv/lib/python3.13/site-packages/django/views/generic/base.py:105: in view
    return self.dispatch(request, *args, **kwargs)
src/sentry/silo/base.py:157: in override
    return original_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/utils/decorators.py:48: in _wrapper
    return bound_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/views/decorators/csrf.py:65: in _view_wrapper
    return view_func(request, *args, **kwargs)
src/sentry/web/frontend/base.py:475: in dispatch
    return self.handle(request, *args, **kwargs)
src/sentry/integrations/web/organization_integration_setup.py:29: in handle
    return pipeline.current_step()
src/sentry/pipeline/base.py:184: in current_step
    return self.finish_pipeline()
src/sentry/integrations/pipeline.py:234: in finish_pipeline
    data = self.provider.build_integration(self.state.data)
src/sentry/integrations/example/integration.py:264: in build_integration
    return {"external_id": state["name"]}
E   KeyError: 'name'
tests/sentry/integrations/web/test_organization_integration_setup.py::OrganizationIntegrationSetupTest::test_allow_integration_with_one_feature_enabledlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/web/test_organization_integration_setup.py:60: in test_allow_integration_with_one_feature_enabled
    self.test_basic_flow()
tests/sentry/integrations/web/test_organization_integration_setup.py:34: in test_basic_flow
    resp = self.client.get(self.path)
.venv/lib/python3.13/site-packages/django/test/client.py:1124: in get
    response = super().get(
.venv/lib/python3.13/site-packages/django/test/client.py:475: in get
    return self.generic(
.venv/lib/python3.13/site-packages/django/test/client.py:671: in generic
    return self.request(**r)
.venv/lib/python3.13/site-packages/django/test/client.py:1087: in request
    self.check_exception(response)
.venv/lib/python3.13/site-packages/django/test/client.py:802: in check_exception
    raise exc_value
.venv/lib/python3.13/site-packages/django/core/handlers/exception.py:55: in inner
    response = get_response(request)
.venv/lib/python3.13/site-packages/django/core/handlers/base.py:197: in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
.venv/lib/python3.13/site-packages/django/views/generic/base.py:105: in view
    return self.dispatch(request, *args, **kwargs)
src/sentry/silo/base.py:157: in override
    return original_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/utils/decorators.py:48: in _wrapper
    return bound_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/views/decorators/csrf.py:65: in _view_wrapper
    return view_func(request, *args, **kwargs)
src/sentry/web/frontend/base.py:475: in dispatch
    return self.handle(request, *args, **kwargs)
src/sentry/integrations/web/organization_integration_setup.py:29: in handle
    return pipeline.current_step()
src/sentry/pipeline/base.py:184: in current_step
    return self.finish_pipeline()
src/sentry/integrations/pipeline.py:234: in finish_pipeline
    data = self.provider.build_integration(self.state.data)
src/sentry/integrations/example/integration.py:264: in build_integration
    return {"external_id": state["name"]}
E   KeyError: 'name'
tests/sentry/integrations/web/test_organization_integration_setup.py::OrganizationIntegrationSetupTest::test_basic_flowlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/web/test_organization_integration_setup.py:34: in test_basic_flow
    resp = self.client.get(self.path)
.venv/lib/python3.13/site-packages/django/test/client.py:1124: in get
    response = super().get(
.venv/lib/python3.13/site-packages/django/test/client.py:475: in get
    return self.generic(
.venv/lib/python3.13/site-packages/django/test/client.py:671: in generic
    return self.request(**r)
.venv/lib/python3.13/site-packages/django/test/client.py:1087: in request
    self.check_exception(response)
.venv/lib/python3.13/site-packages/django/test/client.py:802: in check_exception
    raise exc_value
.venv/lib/python3.13/site-packages/django/core/handlers/exception.py:55: in inner
    response = get_response(request)
.venv/lib/python3.13/site-packages/django/core/handlers/base.py:197: in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
.venv/lib/python3.13/site-packages/django/views/generic/base.py:105: in view
    return self.dispatch(request, *args, **kwargs)
src/sentry/silo/base.py:157: in override
    return original_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/utils/decorators.py:48: in _wrapper
    return bound_method(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/views/decorators/csrf.py:65: in _view_wrapper
    return view_func(request, *args, **kwargs)
src/sentry/web/frontend/base.py:475: in dispatch
    return self.handle(request, *args, **kwargs)
src/sentry/integrations/web/organization_integration_setup.py:29: in handle
    return pipeline.current_step()
src/sentry/pipeline/base.py:184: in current_step
    return self.finish_pipeline()
src/sentry/integrations/pipeline.py:234: in finish_pipeline
    data = self.provider.build_integration(self.state.data)
src/sentry/integrations/example/integration.py:264: in build_integration
    return {"external_id": state["name"]}
E   KeyError: 'name'

@evanpurkhiser
evanpurkhiser force-pushed the evanpurkhiser/feat-integrations-update-example-integration-for-api-pipeline branch from bec3dfa to 5fe974e Compare April 20, 2026 15:45
@evanpurkhiser
evanpurkhiser force-pushed the evanpurkhiser/feat-integrations-update-example-integration-for-api-pipeline branch from 5fe974e to 20a4328 Compare April 20, 2026 15:49
Comment thread src/sentry/integrations/example/integration.py

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 20a4328. Configure here.


def build_integration(self, state: Mapping[str, Any]) -> IntegrationData:
return {"external_id": state["name"]}
return {"external_id": state.get("name", "example")}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Silent default masks missing pipeline state errors

Low Severity

The combination of get_pipeline_views() returning [] and build_integration using state.get("name", "example") means the legacy HTML setup path now silently auto-installs an integration with external_id="example" on any GET request — no user input required. Previously, the pipeline showed a form and state["name"] would fail-fast with a KeyError if the name wasn't bound. The silent fallback could mask real pipeline state binding failures in the API flow too, creating integrations with a hardcoded "example" external_id instead of surfacing the error.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 20a4328. Configure here.

@evanpurkhiser
evanpurkhiser force-pushed the evanpurkhiser/feat-integrations-update-example-integration-for-api-pipeline branch from 20a4328 to 5e6a694 Compare April 21, 2026 13:52
@evanpurkhiser
evanpurkhiser merged commit b755e96 into master Apr 21, 2026
57 checks passed
@evanpurkhiser
evanpurkhiser deleted the evanpurkhiser/feat-integrations-update-example-integration-for-api-pipeline branch April 21, 2026 19:39
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants