DB and model changes for Sentry project selection dropdown
What does this MR do?
Last release we had added an integration with Sentry where the user can add his Sentry API URL (ex: http://sentry.example.com/api/0/projects/organization-slug/project-slug/) and token and we display a list of Sentry issues/errors.
This issue is to make it easier for the user to set their Sentry API URL. In this issue, we aim to add a project selection dropdown, so that the user only has to enter his Sentry API host (ex: http://sentry.example.com) and token, then we populate the dropdown with a list of Sentry Organizations and Sentry Projects that the user has access to, and they can choose the project whose issues they want us to display.
This MR contains the DB and model changes for the issue to create a sentry project selection dropdown.
This MR adds new columns in project_error_tracking_settings
table for project_name
and organization_name
. These names are required to display in the project selection dropdown.
There is no migration for existing integrations since the project_name and organization_name can be obtained from the api_url (http://sentry_host.com/api/0/projects/#{organization_slug}/#{project_slug}
). The names are derived from the corresponding slugs. This has the benefit of avoiding a data migration.
-
api_url
is alwaysNULL
or contains the full API URL of a project. -
organization_slug
andproject_slug
are NOT in separate columns, we always extract them from the URL. -
When we have
project_name
andorganization_name
from the Sentry API, we use those, otherwise we prettify the slugs we extracted in step 2.
When project_error_tracking_setting is exported, the token is excluded. This means that when the project_error_tracking_setting is imported, it cannot be immediately enabled since the token will be missing. For the above reason, the default value of the enabled column is changed to false.
null => false
for api_url column has been changed to allow nulls since api_url should be allowed to be empty when enabled is false.
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer