Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ data/
.artifacts/

# Generated bindings
/py/sentry_protos/*
# /py/sentry_protos/*
Copy link
Member

Choose a reason for hiding this comment

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

Why is this changing?

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 just so I can use this repository instead of the official package when building Sentry for testing purposes. If I don't include the generated code it doesn't work, but it will be undone in the final version!


# Generated documentation
/docs/build/*
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions proto/sentry_protos/taskbroker/v1/taskbroker.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,26 @@ service ConsumerService {

// Update the state of a task with execution results.
rpc SetTaskStatus(SetTaskStatusRequest) returns (SetTaskStatusResponse) {}

// Add a worker to the broker's inner worker pool.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Add a worker to the broker's inner worker pool.
// Register a worker as able to receive tasks from a broker.

rpc AddWorker(AddWorkerRequest) returns (AddWorkerResponse) {}

// Remove a worker from the broker's inner worker pool.
rpc RemoveWorker(RemoveWorkerRequest) returns (RemoveWorkerResponse) {}
}

message AddWorkerRequest {
string address = 1;
}

message AddWorkerResponse {}

message RemoveWorkerRequest {
string address = 1;
}

message RemoveWorkerResponse {}

message GetTaskRequest {
optional string namespace = 1;
}
Expand All @@ -104,6 +122,8 @@ message SetTaskStatusRequest {

// If fetch_next is provided, receive a new task in the response
optional FetchNextTask fetch_next_task = 3;

string address = 4;
Copy link
Member

Choose a reason for hiding this comment

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

What kind of address is this? A comment could help here.

Copy link
Member

Choose a reason for hiding this comment

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

This should be optional if you're adding it to the existing version. Otherwise it might break services that aren't sending this address through.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it. I think this is actually unnecessary, so it'll likely be gone in the final version anyways.

}

message SetTaskStatusResponse {
Expand Down
20 changes: 20 additions & 0 deletions proto/sentry_protos/taskworker/v1/taskworker.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
syntax = "proto3";

package sentry_protos.taskworker.v1;
Copy link
Member

Choose a reason for hiding this comment

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

Could we keep these in the taskbroker.v1 package? It is likely that these protos will change alongside those ones.

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes 👍


import "sentry_protos/taskbroker/v1/taskbroker.proto";

service WorkerService {
// Receives a task to execute.
rpc PushTask(PushTaskRequest) returns (PushTaskResponse) {}
}

message PushTaskRequest {
sentry_protos.taskbroker.v1.TaskActivation task = 1;
string callback_url = 2;
}

message PushTaskResponse {
bool added = 1;
uint32 queue_size = 2;
}
1 change: 1 addition & 0 deletions py/sentry_protos/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.4.10"
Copy link
Member

Choose a reason for hiding this comment

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

Until this point we've not included python generated code in the repository. Instead we generate the python bindings when building a packaged release.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yepp, this is temporary so that I can use this repository as the source for the sentry-protos package in sentry.

Empty file.
Empty file.
30 changes: 30 additions & 0 deletions py/sentry_protos/conduit/v1alpha/publish_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

90 changes: 90 additions & 0 deletions py/sentry_protos/conduit/v1alpha/publish_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""

import builtins
import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import google.protobuf.struct_pb2
import google.protobuf.timestamp_pb2
import sys
import typing

if sys.version_info >= (3, 10):
import typing as typing_extensions
else:
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _Phase:
ValueType = typing.NewType("ValueType", builtins.int)
V: typing_extensions.TypeAlias = ValueType

class _PhaseEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Phase.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
PHASE_UNSPECIFIED: _Phase.ValueType # 0
PHASE_START: _Phase.ValueType # 1
"""Initial event to establish stream"""
PHASE_DELTA: _Phase.ValueType # 2
"""Incremental updates"""
PHASE_END: _Phase.ValueType # 3
"""Clean stream termination"""
PHASE_ERROR: _Phase.ValueType # 4
"""Stream encountered an error"""

class Phase(_Phase, metaclass=_PhaseEnumTypeWrapper): ...

PHASE_UNSPECIFIED: Phase.ValueType # 0
PHASE_START: Phase.ValueType # 1
"""Initial event to establish stream"""
PHASE_DELTA: Phase.ValueType # 2
"""Incremental updates"""
PHASE_END: Phase.ValueType # 3
"""Clean stream termination"""
PHASE_ERROR: Phase.ValueType # 4
"""Stream encountered an error"""
global___Phase = Phase

@typing.final
class PublishRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

CHANNEL_ID_FIELD_NUMBER: builtins.int
MESSAGE_ID_FIELD_NUMBER: builtins.int
CLIENT_TIMESTAMP_FIELD_NUMBER: builtins.int
PHASE_FIELD_NUMBER: builtins.int
SEQUENCE_FIELD_NUMBER: builtins.int
PAYLOAD_FIELD_NUMBER: builtins.int
channel_id: builtins.str
"""Channel identifier for routing"""
message_id: builtins.str
"""Unique message identifier for deduplication and idempotency"""
phase: global___Phase.ValueType
"""Current phase of the streaming lifecycle"""
sequence: builtins.int
"""Monotonically increasing sequence number within a stream"""
@property
def client_timestamp(self) -> google.protobuf.timestamp_pb2.Timestamp:
"""Timestamp when client sent the event"""

@property
def payload(self) -> google.protobuf.struct_pb2.Struct:
"""Application-specific payload data"""

def __init__(
self,
*,
channel_id: builtins.str = ...,
message_id: builtins.str = ...,
client_timestamp: google.protobuf.timestamp_pb2.Timestamp | None = ...,
phase: global___Phase.ValueType = ...,
sequence: builtins.int = ...,
payload: google.protobuf.struct_pb2.Struct | None = ...,
) -> None: ...
def HasField(self, field_name: typing.Literal["client_timestamp", b"client_timestamp", "payload", b"payload"]) -> builtins.bool: ...
def ClearField(self, field_name: typing.Literal["channel_id", b"channel_id", "client_timestamp", b"client_timestamp", "message_id", b"message_id", "payload", b"payload", "phase", b"phase", "sequence", b"sequence"]) -> None: ...

global___PublishRequest = PublishRequest
29 changes: 29 additions & 0 deletions py/sentry_protos/conduit/v1alpha/publish_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings


GRPC_GENERATED_VERSION = '1.65.4'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.66.0'
SCHEDULED_RELEASE_DATE = 'August 6, 2024'
_version_not_supported = False

try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True

if _version_not_supported:
warnings.warn(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in sentry_protos/conduit/v1alpha/publish_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
RuntimeWarning
)
17 changes: 17 additions & 0 deletions py/sentry_protos/conduit/v1alpha/publish_pb2_grpc.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""

import abc
import collections.abc
import grpc
import grpc.aio
import typing

_T = typing.TypeVar("_T")

class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...

class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
...
Empty file.
Empty file.
Empty file.
206 changes: 206 additions & 0 deletions py/sentry_protos/kafka/events/v1/events_pb2.py

Large diffs are not rendered by default.

Loading
Loading