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

Enable self-serve portion of feature and monitor uptake #214

Open
Tracked by #153
azaslavsky opened this issue Nov 7, 2023 · 0 comments
Open
Tracked by #153

Enable self-serve portion of feature and monitor uptake #214

azaslavsky opened this issue Nov 7, 2023 · 0 comments

Comments

@azaslavsky
Copy link

azaslavsky commented Nov 7, 2023

This includes both a dashboard to track usage and some error reporting (via sentry, of course) so that we know when something is going wrong.

azaslavsky added a commit to getsentry/sentry that referenced this issue Nov 9, 2023
This also moves general backup tools into the `sentry backup` command,
so `sentry compare` is now spelled `sentry backup compare`.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 6, 2023
This is the first of 2 PRs to remove the `relocation:enabled` feature
flag, and replace it with the `relocation.enabled` option. This PR adds
the option, but leaves the feature flag untouched. Once this is picked
up by `getsentry`, the follow up PR removing the feature flag will roll
as well.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 6, 2023
This is the first of 2 PRs to remove the `relocation:enabled` feature
flag, and replace it with the `relocation.enabled` option. This PR adds
the option, but leaves the feature flag untouched. Once this is picked
up by `getsentry`, the follow up PR removing the feature flag will roll
as well.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 6, 2023
This completes the swap by changing the feature flag to be INTERNAL.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 6, 2023
This completes the swap by removing the now-unused feature flag.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 12, 2023
Add the public key download screen.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 12, 2023
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 13, 2023
Add the public key download screen.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 13, 2023
Previously, relocations were stored in the same filestore (local
directory, GCP/S3 bucket, etc) as all other Django-tracked files, but in
a special `/relocation` top-level directory. For operational reasons,
we've decided to move relocation data into an entirely separate store.
Thus, we make the following changes:

1. The `filestore` configuration now has an extra property,
   `filestore.relocation`. This closely mirrors the existing
   `filetore.options`: where the latter is used to configure the storage
   backend for regular Django-tracked files, this new config object does
   the same for the relocation bucket. A new storage getter called
   `get_relocation_storage` is created to provide access to this bespoke
   bucket in the same manner we use `get_storage` to directly access the
   main bucket today.
2. The `baseline-config.tar` and `colliding-users.tar` exports are no
   longer tracked in the Django FS. Instead, we write them directly to
   the new relocation bucket at creation time, and forego entering them
   into the DB-bakced filesystem altogether.
3. A new preprocessing step, `PREPROCESSING_TRANSFER`, is added directly
   after the completion of the scan. This copies the user-supplied
   `raw-relocation.tar` from the DB-backed filesystem into the
   relocation bucket. The `PREPROCESSING_COMPLETE` task is modified to
   just do a quick check ensuring that all necessary files are gettable
   by CloudBuild (ie, not only has the write finished, but they are
   available for read as well).

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 13, 2023
This PR introduces a `relocation.self-serve` option, but it is currently
unused. Future PRs will gate the self-serve UI on it, separating the
self-service toggle from the global feature toggle.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 14, 2023
Previously, relocations were stored in the same filestore (local
directory, GCP/S3 bucket, etc) as all other Django-tracked files, but in
a special `/relocation` top-level directory. For operational reasons,
we've decided to move relocation data into an entirely separate store.
Thus, we make the following changes:

1. The `filestore` configuration now has an extra property,
`filestore.relocation`. This closely mirrors the existing
`filetore.options`: where the latter is used to configure the storage
backend for regular Django-tracked files, this new config object does
the same for the relocation bucket. A new storage getter called
`get_relocation_storage` is created to provide access to this bespoke
bucket in the same manner we use `get_storage` to directly access the
main bucket today.
2. The `baseline-config.tar` and `colliding-users.tar` exports are no
longer tracked in the Django FS. Instead, we write them directly to the
new relocation bucket at creation time, and forego entering them into
the DB-bakced filesystem altogether.
3. A new preprocessing step, `PREPROCESSING_TRANSFER`, is added directly
after the completion of the scan. This copies the user-supplied
`raw-relocation.tar` from the DB-backed filesystem into the relocation
bucket. The `PREPROCESSING_COMPLETE` task is modified to just do a quick
check ensuring that all necessary files are gettable by CloudBuild (ie,
not only has the write finished, but they are available for read as
well).

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 15, 2023
Superusers (aka admins) will no be able to hit the relocation endpoint
successfully in all deployments. The `relocation:enabled` flag, and the
`relocation.enabled` option that controls it, will instead refer only to
the self-serve endpoint, which will remain contained to the test region
for now.

This means that admins can now trigger relocations in any region for any
user, and are not throttled when they do so. Regular users may only
trigger relocations for themselves in regions where
`relocations.enabled` is set to `True`, and are subject to the global
daily throttles.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 15, 2023
Superusers (aka admins) will now be able to hit the relocation endpoint
successfully in all deployments. The `relocation:enabled` flag, and the
`relocation.enabled` option that controls it, will instead refer only to
the self-serve endpoint, which will remain contained to the test region
for now.

This means that admins can now trigger relocations in any region for any
user, and are not throttled when they do so. Regular users may only
trigger relocations for themselves in regions where
`relocations.enabled` is set to `True`, and are subject to the global
daily throttles.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 18, 2023
This makes the list a bit easier to render in the admin panel, and
minimizes the number of round trips to the server.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 19, 2023
…61969)

This makes the list a bit easier to render in the admin panel, and
minimizes the number of round trips to the server.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 21, 2023
This ensures that the current task is marked "done" in the database
before the next task is kicked off. Since this is handled by the
`retry_or_fail_relocation` context manager, all next task calls must be
moved outside of said context manager, becoming the very last procedures
completed in their owning task.

Because this change required genericizing over the "schedule the next
task" operation, all such operations have been converted in
`.apply_async()` calls, and a new `NextTask` class has been added to
track task invocations that we want to kick off at the end of the
current task.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 21, 2023
)

This ensures that the current task is marked "done" in the database
before the next task is kicked off. Since this is handled by the
`retry_or_fail_relocation` context manager, all next task calls must be
moved outside of said context manager, becoming the very last procedures
completed in their owning task.

Because this change required genericizing over the "schedule the next
task" operation, all such operations have been converted in
`.apply_async()` calls, and a new `NextTask` class has been added to
track task invocations that we want to kick off at the end of the
current task.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 21, 2023
We want the `owner` field of the POST API to be a username, not email.

An unused route is also removed.

Issue: getsentry/team-ospo#214
azaslavsky added a commit to getsentry/sentry that referenced this issue Dec 22, 2023
We want the `owner` field of the POST API to be a username, not email.

An unused route is also removed.

Issue: getsentry/team-ospo#214
trillville pushed a commit to getsentry/sentry that referenced this issue Jan 19, 2024
We want the `owner` field of the POST API to be a username, not email.

An unused route is also removed.

Issue: getsentry/team-ospo#214
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

No branches or pull requests

1 participant