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

[feat] - Add Azure DevOps integration as a Git provider #7645

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4489339
Add Azure DevOps integration as a Git provider
openhands-agent Apr 1, 2025
c89d568
Add Azure DevOps integration support
openhands-agent Apr 1, 2025
2f065d0
feat
openhands-agent Apr 1, 2025
16d8bf2
Merge branch 'add-azure-devops-integration' of github.com:vinisdl/Ope…
vinisdl Apr 1, 2025
eb1aa13
Fix Azure DevOps authentication implementation and tests
openhands-agent Apr 1, 2025
8ae6533
Merge branch 'add-azure-devops-integration' of github.com:vinisdl/Ope…
vinisdl Apr 1, 2025
a519b8e
feat: adding project to URL
vinisdl Apr 1, 2025
26dcc49
Implement Azure DevOps organization and project configuration through UI
openhands-agent Apr 1, 2025
ac78ec0
Fix: Add Azure DevOps properties to settings mapping in useSettings hook
openhands-agent Apr 1, 2025
76fe031
Fix: Add Azure DevOps properties to mock user settings
openhands-agent Apr 1, 2025
b58ce24
feat: nav PAT settings
vinisdl Apr 1, 2025
271517f
fix: oh add new packages
vinisdl Apr 1, 2025
7f5fa22
Merge branch 'main' into add-azure-devops-integration
vinisdl Apr 1, 2025
56b7b5e
fix: save organization and project
vinisdl Apr 2, 2025
0ff4f6b
feat: get url repo
vinisdl Apr 2, 2025
b72c1a2
Merge branch 'main' into add-azure-devops-integration
vinisdl Apr 2, 2025
ac85264
refactor: add get_repo_url to git service for better organization and…
vinisdl Apr 3, 2025
cdf47bf
Merge branch 'main' into add-azure-devops-integration
vinisdl Apr 4, 2025
c570cb2
revert lock
vinisdl Apr 4, 2025
d96ce14
fix: settings post
vinisdl Apr 7, 2025
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
1 change: 1 addition & 0 deletions frontend/__tests__/routes/settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const toggleAdvancedSettings = async (user: UserEvent) => {
const mock_provider_tokens_are_set: Record<Provider, boolean> = {
github: true,
gitlab: false,
azuredevops: false,
};

describe("Settings Screen", () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/package-lock.json

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

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"react-icons": "^5.5.0",
"react-markdown": "^10.1.0",
"react-redux": "^9.2.0",
"react-router": "^7.4.0",
"react-router": "^7.4.0",
"react-syntax-highlighter": "^15.6.1",
"react-textarea-autosize": "^8.5.8",
"remark-gfm": "^4.0.1",
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/hooks/mutation/use-save-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const saveSettingsMutationFn = async (
enable_sound_notifications: settings.ENABLE_SOUND_NOTIFICATIONS,
user_consents_to_analytics: settings.user_consents_to_analytics,
provider_tokens: settings.provider_tokens,
azure_devops_org: settings.AZURE_DEVOPS_ORG,
azure_devops_project: settings.AZURE_DEVOPS_PROJECT,
};

await OpenHands.saveSettings(apiSettings);
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/hooks/query/use-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const getSettingsQueryFn = async () => {
ENABLE_SOUND_NOTIFICATIONS: apiSettings.enable_sound_notifications,
USER_CONSENTS_TO_ANALYTICS: apiSettings.user_consents_to_analytics,
PROVIDER_TOKENS: apiSettings.provider_tokens,
AZURE_DEVOPS_ORG: apiSettings.azure_devops_org,
AZURE_DEVOPS_PROJECT: apiSettings.azure_devops_project,
IS_NEW_USER: false,
};
};
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/i18n/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ export enum I18nKey {
STATUS$ERROR_LLM_SERVICE_UNAVAILABLE = "STATUS$ERROR_LLM_SERVICE_UNAVAILABLE",
STATUS$ERROR_LLM_INTERNAL_SERVER_ERROR = "STATUS$ERROR_LLM_INTERNAL_SERVER_ERROR",
STATUS$ERROR_LLM_OUT_OF_CREDITS = "STATUS$ERROR_LLM_OUT_OF_CREDITS",
STATUS$ERROR_LLM_CONTENT_POLICY_VIOLATION = "STATUS$ERROR_LLM_CONTENT_POLICY_VIOLATION",
STATUS$ERROR_RUNTIME_DISCONNECTED = "STATUS$ERROR_RUNTIME_DISCONNECTED",
STATUS$LLM_RETRY = "STATUS$LLM_RETRY",
AGENT_ERROR$BAD_ACTION = "AGENT_ERROR$BAD_ACTION",
Expand Down Expand Up @@ -407,4 +408,9 @@ export enum I18nKey {
GITLAB$GET_TOKEN = "GITLAB$GET_TOKEN",
GITLAB$OR_SEE = "GITLAB$OR_SEE",
COMMON$DOCUMENTATION = "COMMON$DOCUMENTATION",
AZURE$TOKEN_LABEL = "AZURE$TOKEN_LABEL",
AZURE$GET_TOKEN = "AZURE$GET_TOKEN",
AZURE$PERMISSIONS = "AZURE$PERMISSIONS",
AZURE$ORGANIZATION_LABEL = "AZURE$ORGANIZATION_LABEL",
AZURE$PROJECT_LABEL = "AZURE$PROJECT_LABEL",
}
101 changes: 88 additions & 13 deletions frontend/src/i18n/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -5370,19 +5370,19 @@
"de": "Beim Einrichten Ihrer Zahlungssitzung ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut."
},
"BILLING$CLAIM_YOUR_50": {
"en": "Add a credit card with Stripe to claim your $50. <b>We won't charge you without asking first!</b>",
"ja": "Stripeでクレジットカードを追加して$50を獲得。<b>事前の確認なしで請求することはありません!</b>",
"zh-CN": "添加 Stripe 信用卡以领取 $50。<b>我们不会在未经您同意的情况下收费!</b>",
"zh-TW": "添加 Stripe 信用卡以領取 $50。<b>我們不會在未經您同意的情況下收費!</b>",
"ko-KR": "Stripe에 신용카드를 추가하여 $50를 받으세요. <b>사전 동의 없이 요금이 청구되지 않습니다!</b>",
"no": "Legg til et kredittkort med Stripe for å få $50. <b>Vi belaster deg ikke uten å spørre først!</b>",
"it": "Aggiungi una carta di credito con Stripe per ottenere $50. <b>Non ti addebiteremo nulla senza chiedere prima!</b>",
"pt": "Adicione um cartão de crédito com Stripe para receber $50. <b>Não cobraremos sem perguntar primeiro!</b>",
"es": "Añade una tarjeta de crédito con Stripe para reclamar tus $50. <b>¡No te cobraremos sin preguntarte primero!</b>",
"ar": "أضف بطاقة ائتمان مع Stripe للحصول على 50$. <b>لن نقوم بالخصم دون إذن مسبق!</b>",
"fr": "Ajoutez une carte de crédit avec Stripe pour obtenir 50$. <b>Nous ne vous facturerons pas sans vous demander d'abord !</b>",
"tr": "50$ almak için Stripe ile kredi kartı ekleyin. <b>Önce sormadan ücret almayacağız!</b>",
"de": "Fügen Sie eine Kreditkarte mit Stripe hinzu, um $50 zu erhalten. <b>Wir belasten Sie nicht ohne vorherige Zustimmung!</b>"
"en": "Add a credit card with Stripe to claim your $50. We won't charge you without asking first!",
"ja": "Stripeでクレジットカードを追加して$50を獲得。事前の確認なしで請求することはありません!",
"zh-CN": "添加 Stripe 信用卡以领取 $50。我们不会在未经您同意的情况下收费!",
"zh-TW": "添加 Stripe 信用卡以領取 $50。我們不會在未經您同意的情況下收費!",
"ko-KR": "Stripe에 신용카드를 추가하여 $50를 받으세요. 사전 동의 없이 요금이 청구되지 않습니다!",
"no": "Legg til et kredittkort med Stripe for å få $50. Vi belaster deg ikke uten å spørre først!",
"it": "Aggiungi una carta di credito con Stripe per ottenere $50. Non ti addebiteremo nulla senza chiedere prima!",
"pt": "Adicione um cartão de crédito com Stripe para receber $50. Não cobraremos sem perguntar primeiro!",
"es": "Añade una tarjeta de crédito con Stripe para reclamar tus $50. ¡No te cobraremos sin preguntarte primero!",
"ar": "أضف بطاقة ائتمان مع Stripe للحصول على 50$. لن نقوم بالخصم دون إذن مسبق!",
"fr": "Ajoutez une carte de crédit avec Stripe pour obtenir 50$. Nous ne vous facturerons pas sans vous demander d'abord !",
"tr": "50$ almak için Stripe ile kredi kartı ekleyin. Önce sormadan ücret almayacağız!",
"de": "Fügen Sie eine Kreditkarte mit Stripe hinzu, um $50 zu erhalten. Wir belasten Sie nicht ohne vorherige Zustimmung!"
},
"BILLING$PROCEED_TO_STRIPE": {
"en": "Add Billing Info",
Expand Down Expand Up @@ -6088,5 +6088,80 @@
"fr": "documentation",
"tr": "belgelendirme",
"de": "Dokumentation"
},
"AZURE$TOKEN_LABEL": {
"en": "Azure Token",
"ja": "Azureトークン",
"zh-CN": "Azure令牌",
"zh-TW": "Azure權杖",
"ko-KR": "Azure 토큰",
"no": "Azure-token",
"it": "Token di Azure",
"pt": "Token do Azure",
"es": "Token de Azure",
"ar": "رمز Azure",
"fr": "Jeton Azure",
"tr": "Azure Jetonu",
"de": "Azure-Token"
},
"AZURE$GET_TOKEN": {
"en": "Generate a Personal Access Token (PAT) on",
"ja": "個人用アクセストークン (PAT) を生成する",
"zh-CN": "在以下位置生成个人访问令牌 (PAT)",
"zh-TW": "在以下位置生成個人訪問權杖 (PAT)",
"ko-KR": "개인 액세스 토큰(PAT) 생성하기",
"no": "Generer en personlig tilgangstoken (PAT) på",
"it": "Genera un token di accesso personale (PAT) su",
"pt": "Gerar um token de acesso pessoal (PAT) em",
"es": "Generar un token de acceso personal (PAT) en",
"ar": "إنشاء رمز وصول شخصي (PAT) على",
"fr": "Générer un jeton d'accès personnel (PAT) sur",
"tr": "Kişisel Erişim Anahtarı (PAT) oluştur",
"de": "Generieren Sie ein persönliches Zugriffstoken (PAT) auf"
},
"AZURE$PERMISSIONS": {
"en": "with Code (Read & Write) and User Profile (Read) scopes.",
"ja": "スコープはコード (読み取りと書き込み)とユーザープロフィール (読み取り)を指定してください。",
"zh-CN": "范围为代码 (读取和写入)和用户配置文件 (读取)。",
"zh-TW": "範圍為代碼 (讀取和寫入)和用戶配置文件 (讀取)。",
"ko-KR": "코드(읽기 및 쓰기) 및 사용자 프로필(읽기) 범위로.",
"no": "med Kode (Les og skriv) og Brukerprofil (Les)-omfang.",
"it": "con ambito Codice (Lettura e Scrittura) e Profilo Utente (Lettura).",
"pt": "com escopos Código (Ler e Escrever) e Perfil do Usuário (Ler).",
"es": "con ámbitos de Código (Leer y Escribir) y Perfil de Usuario (Leer).",
"ar": "مع الرمز (القراءة والكتابة) وملف تعريف المستخدم (القراءة) النطاقات.",
"fr": "avec les portées Code (Lecture et Écriture) et Profil Utilisateur (Lecture).",
"tr": "Kod (Okuma ve Yazma) ve Kullanıcı Profili (Okuma) kapsamları ile.",
"de": "mit Code (Lesen und Schreiben) und Benutzerprofil (Lesen)-Bereichen."
},
"AZURE$ORGANIZATION_LABEL": {
"en": "Organization",
"ja": "組織",
"zh-CN": "组织",
"zh-TW": "組織",
"ko-KR": "조직",
"no": "Organisasjon",
"it": "Organizzazione",
"pt": "Organização",
"es": "Organización",
"ar": "منظمة",
"fr": "Organisation",
"tr": "Kuruluş",
"de": "Organisation"
},
"AZURE$PROJECT_LABEL": {
"en": "Project",
"ja": "プロジェクト",
"zh-CN": "项目",
"zh-TW": "專案",
"ko-KR": "프로젝트",
"no": "Prosjekt",
"it": "Progetto",
"pt": "Projeto",
"es": "Proyecto",
"ar": "مشروع",
"fr": "Projet",
"tr": "Proje",
"de": "Projekt"
}
}
8 changes: 7 additions & 1 deletion frontend/src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const MOCK_DEFAULT_USER_SETTINGS: ApiSettings | PostApiSettings = {
enable_sound_notifications: DEFAULT_SETTINGS.ENABLE_SOUND_NOTIFICATIONS,
user_consents_to_analytics: DEFAULT_SETTINGS.USER_CONSENTS_TO_ANALYTICS,
provider_tokens: DEFAULT_SETTINGS.PROVIDER_TOKENS,
azure_devops_org: DEFAULT_SETTINGS.AZURE_DEVOPS_ORG,
azure_devops_project: DEFAULT_SETTINGS.AZURE_DEVOPS_PROJECT,
};

const MOCK_USER_PREFERENCES: {
Expand Down Expand Up @@ -198,7 +200,11 @@ export const handlers = [
if (!settings) return HttpResponse.json(null, { status: 404 });

if (Object.keys(settings.provider_tokens_set).length > 0)
settings.provider_tokens_set = { github: false, gitlab: false };
settings.provider_tokens_set = {
github: false,
gitlab: false,
azuredevops: false,
};

return HttpResponse.json(settings);
}),
Expand Down
Loading
Loading