Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat: expose webhook link for azure devops in debug mode (#7593)

h3n4lfc9a2daad278
diff --git a/frontend/src/components/RepositoryForm.vue b/frontend/src/components/RepositoryForm.vue
index 288d1fbad8..82763417e4 100644
--- a/frontend/src/components/RepositoryForm.vue
+++ b/frontend/src/components/RepositoryForm.vue
@@ -2,10 +2,24 @@
<template>
<div class="space-y-4">
<div>
+ <div v-if="isDebug && getWebhookLink !== ''">
+ <label class="textlabel mt-2">
+ <i18n-t keypath="repository.our-webhook-link">
+ <template #webhookLink>
+ <a class="normal-link" :href="getWebhookLink" target="_blank">{{
+ getWebhookLink
+ }}</a>
+ </template>
+ </i18n-t>
+ </label>
+ </div>
<div class="flex flex-row space-x-2 items-center">
<label for="gitprovider" class="textlabel">
{{ $t("repository.git-provider") }}
</label>
+ <template v-if="vcsType === ExternalVersionControl_Type.AZURE_DEVOPS">
+ <img class="h-4 w-auto" src="../assets/azure-devops-logo.svg" />
+ </template>
<template v-if="vcsType === ExternalVersionControl_Type.GITLAB">
<img class="h-4 w-auto" src="../assets/gitlab-logo.svg" />
</template>
@@ -361,12 +375,14 @@
</template>
<script lang="ts" setup>
+import { storeToRefs } from "pinia";
import { reactive, PropType, computed } from "vue";
import { useI18n } from "vue-i18n";
import {
hasFeature,
useSubscriptionV1Store,
useDatabaseV1Store,
+ useActuatorV1Store,
} from "@/store";
import { ExternalRepositoryInfo, RepositoryConfig } from "@/types";
import { ExternalVersionControl_Type } from "@/types/proto/v1/externalvs_service";
@@ -553,6 +569,18 @@ const sampleSchemaPath = (
return result;
};
+const getWebhookLink = computed(() => {
+ if (props.vcsType === ExternalVersionControl_Type.AZURE_DEVOPS) {
+ const parts = props.repositoryInfo.externalId.split("/");
+ if (parts.length !== 3) {
+ return "";
+ }
+ const [organization, project, _] = parts;
+ return `https://dev.azure.com/${organization}/${project}/_settings/serviceHooks`;
+ }
+ return "";
+});
+
const fileOptionalPlaceholder = computed(() => {
const tags = [] as string[];
// Only allows {{ENV_ID}} to be an optional placeholder for non-tenant mode projects
@@ -597,4 +625,8 @@ const onSQLReviewCIToggle = (on: boolean) => {
state.showFeatureModal = true;
}
};
+
+const actuatorStore = useActuatorV1Store();
+
+const isDebug = storeToRefs(actuatorStore).isDebug;
</script>
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index f2f31f39c5..af9d08bc21 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1353,6 +1353,7 @@
}
},
"repository": {
+ "our-webhook-link": "The webhook created by Bytebase can be found at {webhookLink}.",
"branch-observe-file-change": "The branch where Bytebase observes the file change.",
"base-directory": "Base directory",
"base-directory-description": "The root directory where Bytebase observes the file change. If empty, then it observes the entire repository.",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index dad66b4d53..5eeb03e3a7 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1403,7 +1403,8 @@
"select-repository-attention-bitbucket": "Bytebase solo enumera los repositorios de Bitbucket en los que tienes permisos de administrador, lo que te permite configurar el webhook del repositorio para observar el evento de empuje de código.",
"select-repository-search": "Buscar repositorio",
"linked": "Repositorios vinculados",
- "select-repository-attention-azure-devops": "Bytebase solo enumera los repositorios de Azure DevOps en la organización a la que se otorga acceso a aplicaciones de terceros a través de OAuth. \nSi no ve el repositorio que desea, vaya a Organización -> Configuración de la organización -> Políticas para habilitar el acceso a aplicaciones de terceros."
+ "select-repository-attention-azure-devops": "Bytebase solo enumera los repositorios de Azure DevOps en la organización a la que se otorga acceso a aplicaciones de terceros a través de OAuth. \nSi no ve el repositorio que desea, vaya a Organización -> Configuración de la organización -> Políticas para habilitar el acceso a aplicaciones de terceros.",
+ "our-webhook-link": "El webhook creado por Bytebase se puede encontrar en {webhookLink}."
},
"workflow": {
"current-workflow": "Flujo de trabajo actual",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index b7434890d6..451c6462da 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1400,7 +1400,8 @@
"select-repository-attention-bitbucket": "Bytebase 仅列出您拥有管理员权限的 Bitbucket 仓库。因为只有拥有该权限,才能够配置仓库的 webhook 用来监听代码推送事件。",
"select-repository-search": "搜索仓库",
"linked": "关联的仓库",
- "select-repository-attention-azure-devops": "Bytebase 仅列出授予第三方应用程序通过 OAuth 访问的组织下的 Azure DevOps 存储库。\n如果您没有看到所需的存储库,请转到组织 -> 组织设置 -> 策略 以启用第三方应用程序访问。"
+ "select-repository-attention-azure-devops": "Bytebase 仅列出授予第三方应用程序通过 OAuth 访问的组织下的 Azure DevOps 存储库。\n如果您没有看到所需的存储库,请转到组织 -> 组织设置 -> 策略 以启用第三方应用程序访问。",
+ "our-webhook-link": "Bytebase 创建的 webhook 可以在 {webhookLink} 中找到。"
},
"workflow": {
"current-workflow": "当前工作流",