Skip to content

🙌 OpenHands: AI-Driven Development

feat(automations): offer the built-in integration before issue-to-PR templates (#17868)

Hiep Lecbcdfcef1f5c
diff --git a/__tests__/components/automations/recommended-automations.test.tsx b/__tests__/components/automations/recommended-automations.test.tsx
index e2e141b6a4..32411b9c54 100644
--- a/__tests__/components/automations/recommended-automations.test.tsx
+++ b/__tests__/components/automations/recommended-automations.test.tsx
@@ -156,22 +156,33 @@ function settingsWithGithubMcp() {
}
/**
- * Activates the cloud backend with the given native git providers enabled and
- * serves `settings` through the real settings hook (the local cases mock the
- * hook), so these cases exercise the services the hooks rely on instead.
+ * Activates the cloud backend with the given native git providers (and,
+ * optionally, the built-in Jira and Linear integrations) enabled and serves
+ * `settings` through the real settings hook (the local cases mock the hook),
+ * so these cases exercise the services the hooks rely on instead.
*/
async function activateCloudBackend({
providersConfigured = [],
+ jiraEnabled = false,
+ linearEnabled = false,
settings = {},
}: {
providersConfigured?: string[];
+ jiraEnabled?: boolean;
+ linearEnabled?: boolean;
settings?: object;
} = {}) {
setRegisteredBackends([cloudBackend]);
setActiveSelection({ backendId: cloudBackend.id });
server.use(
http.get("*/api/v1/web-client/config", () =>
- HttpResponse.json({ providers_configured: providersConfigured }),
+ HttpResponse.json({
+ providers_configured: providersConfigured,
+ feature_flags: {
+ enable_jira: jiraEnabled,
+ enable_linear: linearEnabled,
+ },
+ }),
),
);
vi.spyOn(SettingsService, "getSettings").mockResolvedValue(
@@ -1014,6 +1025,167 @@ describe("recommended automations", () => {
expect(mockCreateConversationMutate).not.toHaveBeenCalled();
});
+ it.each([
+ ["github-issue-to-pr", "GitHub", { providersConfigured: ["github"] }],
+ ["gitlab-issue-to-mr", "GitLab", { providersConfigured: ["gitlab"] }],
+ ["jira-issue-to-pr", "Jira", { jiraEnabled: true }],
+ ["jira-issue-to-gitlab-mr", "Jira", { jiraEnabled: true }],
+ ["jira-issue-to-bitbucket-pr", "Jira", { jiraEnabled: true }],
+ ["linear-issue-to-github-pr", "Linear", { linearEnabled: true }],
+ ["linear-issue-to-gitlab-mr", "Linear", { linearEnabled: true }],
+ ["linear-issue-to-bitbucket-pr", "Linear", { linearEnabled: true }],
+ ])(
+ "offers the built-in integration before setting up %s when the instance enables %s",
+ async (automationId, integrationName, instance) => {
+ // Arrange
+ await activateCloudBackend(instance);
+ renderLauncher({ withBackendProvider: true });
+
+ // Act
+ fireEvent.click(
+ await screen.findByTestId(
+ `recommended-automation-card-${automationId}`,
+ ),
+ );
+
+ // Assert
+ expect(
+ await screen.findByTestId("built-in-integration-choice-modal"),
+ ).toHaveTextContent(
+ `AUTOMATION_SETUP_CHOICE$BUILT_IN_TITLE:${integrationName}`,
+ );
+ expect(mockNavigate).not.toHaveBeenCalled();
+ expect(screen.queryByTestId("mcp-install-modal")).not.toBeInTheDocument();
+ },
+ );
+
+ it("opens the instance's integrations settings when the built-in integration is chosen", async () => {
+ // Arrange
+ const openSpy = vi.spyOn(window, "open").mockImplementation(() => null);
+ await activateCloudBackend({ jiraEnabled: true });
+ renderLauncher({ withBackendProvider: true });
+ fireEvent.click(
+ await screen.findByTestId("recommended-automation-card-jira-issue-to-pr"),
+ );
+
+ // Act
+ fireEvent.click(
+ await screen.findByTestId("built-in-integration-choice-use-built-in"),
+ );
+
+ // Assert
+ expect(openSpy).toHaveBeenCalledWith(
+ "https://staging.all-hands.dev/settings/integrations",
+ "_blank",
+ "noopener,noreferrer",
+ );
+ expect(
+ screen.queryByTestId("built-in-integration-choice-modal"),
+ ).not.toBeInTheDocument();
+ expect(screen.queryByTestId("mcp-install-modal")).not.toBeInTheDocument();
+ expect(mockCreateConversationMutate).not.toHaveBeenCalled();
+ });
+
+ it("connects the integration through its MCP server when the polling automation is chosen", async () => {
+ // Arrange
+ await activateCloudBackend({ providersConfigured: ["gitlab"] });
+ renderLauncher({ withBackendProvider: true });
+ fireEvent.click(
+ await screen.findByTestId(
+ "recommended-automation-card-gitlab-issue-to-mr",
+ ),
+ );
+
+ // Act
+ fireEvent.click(
+ await screen.findByTestId("built-in-integration-choice-continue-polling"),
+ );
+
+ // Assert
+ const modal = await screen.findByTestId("mcp-install-modal");
+ expect(modal).toHaveAttribute("data-marketplace-id", "gitlab");
+ expect(
+ within(modal).queryByTestId("mcp-install-tab-native"),
+ ).not.toBeInTheDocument();
+ expect(
+ within(modal).queryByTestId("mcp-native-panel"),
+ ).not.toBeInTheDocument();
+ expect(
+ screen.queryByTestId("built-in-integration-choice-modal"),
+ ).not.toBeInTheDocument();
+ });
+
+ it("connects a git provider through its MCP server for a template without a setup choice", async () => {
+ // Arrange
+ await activateCloudBackend({ providersConfigured: ["github"] });
+ renderLauncher({ withBackendProvider: true });
+
+ // Act
+ fireEvent.click(
+ await screen.findByTestId(
+ "recommended-automation-card-github-repo-monitor",
+ ),
+ );
+
+ // Assert
+ const modal = await screen.findByTestId("mcp-install-modal");
+ expect(modal).toHaveAttribute("data-marketplace-id", "github");
+ expect(
+ within(modal).queryByTestId("mcp-install-tab-native"),
+ ).not.toBeInTheDocument();
+ expect(
+ within(modal).queryByTestId("mcp-native-panel"),
+ ).not.toBeInTheDocument();
+ expect(
+ screen.queryByTestId("built-in-integration-choice-modal"),
+ ).not.toBeInTheDocument();
+ });
+
+ it("launches nothing when the setup choice is dismissed", async () => {
+ // Arrange
+ await activateCloudBackend({ providersConfigured: ["github"] });
+ renderLauncher({ withBackendProvider: true });
+ fireEvent.click(
+ await screen.findByTestId(
+ "recommended-automation-card-github-issue-to-pr",
+ ),
+ );
+
+ // Act
+ fireEvent.click(
+ await screen.findByTestId("built-in-integration-choice-modal-close"),
+ );
+
+ // Assert
+ expect(
+ screen.queryByTestId("built-in-integration-choice-modal"),
+ ).not.toBeInTheDocument();
+ expect(mockNavigate).not.toHaveBeenCalled();
+ });
+
+ it("sets up an issue-to-PR template directly when the instance has no built-in integration for it", async () => {
+ // Arrange
+ await activateCloudBackend();
+ renderLauncher({ withBackendProvider: true });
+
+ // Act
+ fireEvent.click(
+ await screen.findByTestId(
+ "recommended-automation-card-github-issue-to-pr",
+ ),
+ );
+
+ // Assert
+ await waitFor(() =>
+ expect(mockNavigate).toHaveBeenCalledWith(
+ "/automations/new/github-issue-to-pr",
+ ),
+ );
+ expect(
+ screen.queryByTestId("built-in-integration-choice-modal"),
+ ).not.toBeInTheDocument();
+ });
+
it("shows a natively connected integration as connected on its card", () => {
// Arrange & Act
render(
diff --git a/src/api/cloud/settings-service.api.ts b/src/api/cloud/settings-service.api.ts
index 127dd56feb..7bde0a975d 100644
--- a/src/api/cloud/settings-service.api.ts
+++ b/src/api/cloud/settings-service.api.ts
@@ -229,16 +229,29 @@ export async function fetchCloudConversationSettingsSchema(): Promise<unknown> {
});
}
-/**
- * The git providers whose native (OAuth) integration this cloud instance has
- * enabled — what its Settings > Integrations page offers to connect.
- */
-export async function fetchCloudProvidersConfigured(): Promise<Provider[]> {
+/** What this cloud instance's Settings > Integrations page offers to connect. */
+export interface CloudIntegrationsConfig {
+ /** The git providers whose native (OAuth) integration is enabled. */
+ providersConfigured: Provider[];
+ /** Whether the built-in Jira Cloud integration is enabled. */
+ isJiraEnabled: boolean;
+ /** Whether the built-in Linear integration is enabled. */
+ isLinearEnabled: boolean;
+}
+
+export async function fetchCloudIntegrationsConfig(): Promise<CloudIntegrationsConfig> {
const backend = getActiveCloudBackend();
- const config = await callCloudProxy<{ providers_configured?: Provider[] }>({
+ const config = await callCloudProxy<{
+ providers_configured?: Provider[];
+ feature_flags?: { enable_jira?: boolean; enable_linear?: boolean };
+ }>({
backend,
method: "GET",
path: "/api/v1/web-client/config",
});
- return config.providers_configured ?? [];
+ return {
+ providersConfigured: config.providers_configured ?? [],
+ isJiraEnabled: config.feature_flags?.enable_jira === true,
+ isLinearEnabled: config.feature_flags?.enable_linear === true,
+ };
}
diff --git a/src/components/features/automations/built-in-integration-choice-modal.tsx b/src/components/features/automations/built-in-integration-choice-modal.tsx
new file mode 100644
index 0000000000..410f03b99b
--- /dev/null
+++ b/src/components/features/automations/built-in-integration-choice-modal.tsx
@@ -0,0 +1,179 @@
+import { useTranslation } from "react-i18next";
+import {
+ ArrowRight,
+ CircleCheck,
+ Clock,
+ Link2,
+ Settings,
+ SlidersHorizontal,
+} from "lucide-react";
+import type { IntegrationCatalogEntry } from "@openhands/extensions/integrations";
+import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";
+import { ModalCloseButton } from "#/components/shared/modals/modal-close-button";
+import { BrandButton } from "#/components/features/settings/brand-button";
+import { McpLogoBadge } from "#/components/features/mcp-logo-badge";
+import { BrandBadge } from "#/components/shared/badge";
+import { I18nKey } from "#/i18n/declaration";
+import { cn } from "#/utils/utils";
+import { modalTitleLgClassName } from "#/utils/modal-classes";
+
+interface BuiltInIntegrationChoiceModalProps {
+ /** The built-in integration that already covers the selected automation. */
+ integration: IntegrationCatalogEntry;
+ onClose: () => void;
+ /** Fired for the "Connect and use the integration" action. */
+ onUseBuiltIn: () => void;
+ /** Fired for the "Continue with polling setup" action. */
+ onContinuePolling: () => void;
+}
+
+/**
+ * Shown before an 'Issue to PR' automation is set up on a cloud instance whose
+ * built-in integration (Settings > Integrations) provides the same workflow:
+ * the user picks between that integration and the polling automation.
+ */
+export function BuiltInIntegrationChoiceModal({
+ integration,
+ onClose,
+ onUseBuiltIn,
+ onContinuePolling,
+}: BuiltInIntegrationChoiceModalProps) {
+ const { t } = useTranslation("openhands");
+ const { name } = integration;
+
+ const builtInFeatures = [
+ t(I18nKey.AUTOMATION_SETUP_CHOICE$BUILT_IN_FEATURE_READY),
+ t(I18nKey.AUTOMATION_SETUP_CHOICE$BUILT_IN_FEATURE_EVENT_DRIVEN),
+ t(I18nKey.AUTOMATION_SETUP_CHOICE$BUILT_IN_FEATURE_WORKFLOW),
+ ];
+ const pollingFeatures = [
+ {
+ Icon: Link2,
+ label: t(I18nKey.AUTOMATION_SETUP_CHOICE$POLLING_FEATURE_MCP, { name }),
+ },
+ {
+ Icon: Clock,
+ label: t(I18nKey.AUTOMATION_SETUP_CHOICE$POLLING_FEATURE_SCHEDULE),
+ },
+ {
+ Icon: SlidersHorizontal,
+ label: t(I18nKey.AUTOMATION_SETUP_CHOICE$POLLING_FEATURE_CUSTOMIZE),
+ },
+ ];
+
+ return (
+ <ModalBackdrop
+ onClose={onClose}
+ aria-label={t(I18nKey.AUTOMATION_SETUP_CHOICE$TITLE)}
+ >
+ <div
+ data-testid="built-in-integration-choice-modal"
+ className="relative flex w-full max-w-3xl flex-col rounded-xl border border-border bg-base-secondary"
+ >
+ <ModalCloseButton
+ onClose={onClose}
+ testId="built-in-integration-choice-modal-close"
+ />
+ <header className="flex-shrink-0 px-6 pb-4 pt-6">
+ <h2 className={cn("pr-6", modalTitleLgClassName)}>
+ {t(I18nKey.AUTOMATION_SETUP_CHOICE$TITLE)}
+ </h2>
+ <p className="mt-2 text-sm text-muted">
+ {t(I18nKey.AUTOMATION_SETUP_CHOICE$DESCRIPTION, { name })}
+ </p>
+ </header>
+ <div className="flex flex-col gap-3 px-6 pb-6 sm:flex-row">
+ <div
+ data-testid="built-in-integration-choice-option-built-in"
+ className="flex flex-1 flex-col gap-3 rounded-xl border border-primary bg-surface-raised p-4"
+ >
+ <div className="flex items-start justify-between gap-2">
+ <McpLogoBadge entry={integration} />
+ <BrandBadge className="shrink-0 whitespace-nowrap px-2.5 py-1 text-xs">
+ {t(I18nKey.SETTINGS$SKILLS_RECOMMENDED)}
+ </BrandBadge>
+ </div>
+ <div className="flex flex-col gap-1">
+ <h3 className="text-sm font-semibold text-contrast">
+ {t(I18nKey.AUTOMATION_SETUP_CHOICE$BUILT_IN_TITLE, { name })}
+ </h3>
+ <p className="text-xs leading-relaxed text-tertiary-light">
+ {t(I18nKey.AUTOMATION_SETUP_CHOICE$BUILT_IN_DESCRIPTION, {
+ name,
+ })}
+ </p>
+ </div>
+ <ul className="flex flex-col gap-2">
+ {builtInFeatures.map((feature) => (
+ <li
+ key={feature}
+ className="flex items-center gap-2 text-sm text-contrast"
+ >
+ <CircleCheck
+ className="size-4 shrink-0 text-primary"
+ aria-hidden
+ />
+ {feature}
+ </li>
+ ))}
+ </ul>
+ <BrandButton
+ type="button"
+ variant="primary"
+ className="mt-auto flex items-center justify-center gap-2"
+ testId="built-in-integration-choice-use-built-in"
+ onClick={onUseBuiltIn}
+ >
+ {t(I18nKey.AUTOMATION_SETUP_CHOICE$BUILT_IN_ACTION, { name })}
+ <ArrowRight className="size-4 shrink-0" aria-hidden />
+ </BrandButton>
+ </div>
+
+ <div
+ data-testid="built-in-integration-choice-option-polling"
+ className="flex flex-1 flex-col gap-3 rounded-xl border border-border bg-surface-raised p-4"
+ >
+ <McpLogoBadge
+ entry={null}
+ fallback={<Settings className="h-5 w-5" strokeWidth={2.25} />}
+ />
+ <div className="flex flex-col gap-1">
+ <h3 className="text-sm font-semibold text-contrast">
+ {t(I18nKey.AUTOMATION_SETUP_CHOICE$POLLING_TITLE)}
+ </h3>
+ <p className="text-xs leading-relaxed text-tertiary-light">
+ {t(I18nKey.AUTOMATION_SETUP_CHOICE$POLLING_DESCRIPTION, {
+ name,
+ })}
+ </p>
+ </div>
+ <ul className="flex flex-col gap-2">
+ {pollingFeatures.map(({ Icon, label }) => (
+ <li
+ key={label}
+ className="flex items-center gap-2 text-sm text-contrast"
+ >
+ <Icon
+ className="size-4 shrink-0 text-tertiary-light"
+ aria-hidden
+ />
+ {label}
+ </li>
+ ))}
+ </ul>
+ <BrandButton
+ type="button"
+ variant="tertiary"
+ className="mt-auto flex items-center justify-center gap-2"
+ testId="built-in-integration-choice-continue-polling"
+ onClick={onContinuePolling}
+ >
+ {t(I18nKey.AUTOMATION_SETUP_CHOICE$POLLING_ACTION)}
+ <ArrowRight className="size-4 shrink-0" aria-hidden />
+ </BrandButton>
+ </div>
+ </div>
+ </div>
+ </ModalBackdrop>
+ );
+}
diff --git a/src/components/features/automations/recommended-automations-launcher.tsx b/src/components/features/automations/recommended-automations-launcher.tsx
index e345dff868..a5c57a4884 100644
--- a/src/components/features/automations/recommended-automations-launcher.tsx
+++ b/src/components/features/automations/recommended-automations-launcher.tsx
@@ -36,6 +36,8 @@ import {
import { isResponderAutomation } from "#/utils/responder-deployment";
import { useAutomations } from "#/hooks/query/use-automations";
import { useNativeGitIntegrations } from "#/hooks/query/use-native-git-integrations";
+import { cloudIntegrationsUrl } from "#/utils/cloud-integrations-url";
+import { BuiltInIntegrationChoiceModal } from "./built-in-integration-choice-modal";
import { RecommendedAutomationsRail } from "./recommended-automations-rail";
import { RecommendedAutomationsSection } from "./recommended-automations-section";
import { ResponderDeploymentModal } from "./responder-deployment-modal";
@@ -64,6 +66,22 @@ function getRequiredEntries(automation: RecommendedAutomation) {
.filter((entry): entry is MarketplaceEntry => !!entry);
}
+/**
+ * The 'Issue to PR' automations a built-in integration (Settings >
+ * Integrations) already provides out of the box, keyed to that integration's
+ * catalog entry.
+ */
+const BUILT_IN_INTEGRATION_ID_BY_AUTOMATION_ID: Record<string, string> = {
+ "github-issue-to-pr": "github",
+ "gitlab-issue-to-mr": "gitlab",
+ "jira-issue-to-pr": "jira",
+ "jira-issue-to-gitlab-mr": "jira",
+ "jira-issue-to-bitbucket-pr": "jira",
+ "linear-issue-to-github-pr": "linear",
+ "linear-issue-to-gitlab-mr": "linear",
+ "linear-issue-to-bitbucket-pr": "linear",
+};
+
export function RecommendedAutomationsLauncher({
query,
onLaunched,
@@ -85,6 +103,10 @@ export function RecommendedAutomationsLauncher({
useState<RecommendedAutomation | null>(null);
const [deploymentChoiceAutomation, setDeploymentChoiceAutomation] =
useState<RecommendedAutomation | null>(null);
+ const [builtInChoice, setBuiltInChoice] = useState<{
+ automation: RecommendedAutomation;
+ integration: MarketplaceEntry;
+ } | null>(null);
const [installQueue, setInstallQueue] = useState<MarketplaceEntry[]>([]);
const completedInstallRef = useRef(false);
const launchInFlightRef = useRef(false);
@@ -94,8 +116,12 @@ export function RecommendedAutomationsLauncher({
const isRail = variant === "rail";
const { data: automationsData, isLoading: isAutomationsLoading } =
useAutomations({ enabled: isRail });
- const { getNativeIntegration, isLoading: isNativeIntegrationsLoading } =
- useNativeGitIntegrations();
+ const {
+ getNativeIntegration,
+ isJiraEnabled,
+ isLinearEnabled,
+ isLoading: isNativeIntegrationsLoading,
+ } = useNativeGitIntegrations();
const installedMcpConfig = useMemo(
() =>
@@ -194,13 +220,28 @@ export function RecommendedAutomationsLauncher({
setInstallQueue(missingEntries);
};
+ const isBuiltInIntegrationEnabled = (entryId: string) => {
+ if (entryId === "jira") return isJiraEnabled;
+ if (entryId === "linear") return isLinearEnabled;
+ return getNativeIntegration(entryId) !== null;
+ };
+
+ // The built-in integration that already gives the user this automation's
+ // 'Issue to PR' workflow, when the cloud instance has it enabled.
+ const getBuiltInIntegration = (automation: RecommendedAutomation) => {
+ const entryId = BUILT_IN_INTEGRATION_ID_BY_AUTOMATION_ID[automation.id];
+ if (!entryId || !isBuiltInIntegrationEnabled(entryId)) return null;
+ return getMarketplaceEntryById(entryId, MCP_MARKETPLACE) ?? null;
+ };
+
const handleSelectAutomation = (automation: RecommendedAutomation) => {
if (
launchInFlightRef.current ||
createConversation.isPending ||
isCreatingConversation ||
installQueue.length > 0 ||
- deploymentChoiceAutomation !== null
+ deploymentChoiceAutomation !== null ||
+ builtInChoice !== null
) {
return;
}
@@ -216,9 +257,36 @@ export function RecommendedAutomationsLauncher({
return;
}
+ // A built-in integration already covers this workflow; let the user choose
+ // between connecting it and setting up the polling automation.
+ const builtInIntegration = getBuiltInIntegration(automation);
+ if (builtInIntegration) {
+ setBuiltInChoice({ automation, integration: builtInIntegration });
+ return;
+ }
+
proceedWithLocalLaunch(automation);
};
+ const handleBuiltInChoiceClose = () => {
+ setBuiltInChoice(null);
+ };
+
+ const handleUseBuiltInIntegration = () => {
+ setBuiltInChoice(null);
+ window.open(
+ cloudIntegrationsUrl(activeBackend.backend, activeBackend.orgId),
+ "_blank",
+ "noopener,noreferrer",
+ );
+ };
+
+ const handleContinuePollingSetup = () => {
+ const automation = builtInChoice?.automation;
+ setBuiltInChoice(null);
+ if (automation) proceedWithLocalLaunch(automation);
+ };
+
const handleDeploymentContinueLocal = async () => {
const automation = deploymentChoiceAutomation;
if (!automation || localSetupInFlightRef.current) return;
@@ -313,6 +381,16 @@ export function RecommendedAutomationsLauncher({
existingServers={installedMcpConfig}
onClose={cancelInstallFlow}
onSuccess={handleInstallSuccess}
+ mcpOnly
+ />
+ )}
+
+ {builtInChoice && (
+ <BuiltInIntegrationChoiceModal
+ integration={builtInChoice.integration}
+ onClose={handleBuiltInChoiceClose}
+ onUseBuiltIn={handleUseBuiltInIntegration}
+ onContinuePolling={handleContinuePollingSetup}
/>
)}
diff --git a/src/components/features/mcp-page/install-server-modal.tsx b/src/components/features/mcp-page/install-server-modal.tsx
index 6f9b596ee0..17007724ad 100644
--- a/src/components/features/mcp-page/install-server-modal.tsx
+++ b/src/components/features/mcp-page/install-server-modal.tsx
@@ -77,6 +77,11 @@ interface InstallServerModalProps {
existingServers: MCPServerConfig[];
onClose: () => void;
onSuccess?: (entry: MarketplaceEntry) => void;
+ /**
+ * When true, an entry that has an MCP option opens on its MCP form without
+ * offering the instance's native integration. Defaults to false.
+ */
+ mcpOnly?: boolean;
}
interface FieldState {
@@ -158,6 +163,7 @@ export function InstallServerModal({
existingServers,
onClose,
onSuccess,
+ mcpOnly = false,
}: InstallServerModalProps) {
const { t } = useTranslation("openhands");
const { mutate: addMcpServer, isPending: isAdding } = useAddMcpServer();
@@ -185,15 +191,19 @@ export function InstallServerModal({
// A git entry the cloud instance can also connect natively offers that as
// the recommended option next to the MCP server; an entry with no MCP
- // option (Bitbucket) offers only the native one.
+ // option (Bitbucket) offers only the native one. A caller that asked for the
+ // MCP server alone skips the native option whenever the entry has an MCP one.
const { getNativeIntegration, isLoading: isNativeIntegrationsLoading } =
useNativeGitIntegrations();
- const native = getNativeIntegration(entry.id);
+ const skipNative = mcpOnly && !!option;
+ const native = skipNative ? null : getNativeIntegration(entry.id);
// Until the instance's providers are known, a git entry cannot say whether
// it leads with the native option; showing the MCP form meanwhile would swap
// it out from under the user once the answer arrives.
const isResolvingNative =
- isNativeIntegrationsLoading && isNativeGitCandidate(entry.id);
+ !skipNative &&
+ isNativeIntegrationsLoading &&
+ isNativeGitCandidate(entry.id);
const [selectedConnection, setSelectedConnection] = React.useState<
"native" | "mcp"
>("native");
diff --git a/src/hooks/query/use-native-git-integrations.ts b/src/hooks/query/use-native-git-integrations.ts
index 737f2d2ddb..214feb98d3 100644
--- a/src/hooks/query/use-native-git-integrations.ts
+++ b/src/hooks/query/use-native-git-integrations.ts
@@ -1,6 +1,6 @@
import { useCallback } from "react";
import { useQuery } from "@tanstack/react-query";
-import { fetchCloudProvidersConfigured } from "#/api/cloud/settings-service.api";
+import { fetchCloudIntegrationsConfig } from "#/api/cloud/settings-service.api";
import { useActiveBackend } from "#/contexts/active-backend-context";
import { useUserProviders } from "#/hooks/use-user-providers";
import type { Provider } from "#/types/settings";
@@ -29,24 +29,28 @@ export function isNativeGitCandidate(entryId: string): boolean {
* option — on local backends, for non-git entries, and for providers the
* instance has not enabled. While `isLoading`, the instance's providers are
* not known yet and null means nothing: wait rather than decide on it.
+ * `isJiraEnabled` and `isLinearEnabled` are whether the instance offers the
+ * built-in Jira Cloud and Linear integrations there; they are not git
+ * connections, so they never satisfy an integration requirement.
*/
export function useNativeGitIntegrations() {
const { backend } = useActiveBackend();
const isCloud = backend.kind === "cloud";
const { providers: connectedProviders } = useUserProviders();
- const { data: configuredProviders, isLoading } = useQuery({
+ const { data: config, isLoading } = useQuery({
queryKey: [
"cloud-providers-configured",
backend.id,
backend.connectionRevision ?? 0,
],
- queryFn: fetchCloudProvidersConfigured,
+ queryFn: fetchCloudIntegrationsConfig,
enabled: isCloud,
staleTime: 1000 * 60 * 5,
retry: false,
meta: { disableToast: true },
});
+ const configuredProviders = config?.providersConfigured;
const getNativeIntegration = useCallback(
(entryId: string): NativeGitIntegration | null => {
@@ -59,5 +63,10 @@ export function useNativeGitIntegrations() {
[isCloud, configuredProviders, connectedProviders],
);
- return { getNativeIntegration, isLoading };
+ return {
+ getNativeIntegration,
+ isJiraEnabled: isCloud && config?.isJiraEnabled === true,
+ isLinearEnabled: isCloud && config?.isLinearEnabled === true,
+ isLoading,
+ };
}
diff --git a/src/i18n/translation.json b/src/i18n/translation.json
index 97e8e7c5de..071d619887 100644
--- a/src/i18n/translation.json
+++ b/src/i18n/translation.json
@@ -37433,6 +37433,244 @@
"zh-CN": "打开 OpenHands Cloud 集成",
"zh-TW": "開啟 OpenHands Cloud 整合"
},
+ "AUTOMATION_SETUP_CHOICE$TITLE": {
+ "ar": "اختر طريقة الإعداد",
+ "ca": "Tria la teva configuració",
+ "de": "Wählen Sie Ihre Einrichtung",
+ "en": "Choose your setup",
+ "es": "Elige tu configuración",
+ "fr": "Choisissez votre configuration",
+ "it": "Scegli la tua configurazione",
+ "ja": "セットアップ方法を選択",
+ "ko-KR": "설정 방식 선택",
+ "no": "Velg oppsett",
+ "pt": "Escolha a sua configuração",
+ "tr": "Kurulumunuzu seçin",
+ "uk": "Виберіть спосіб налаштування",
+ "zh-CN": "选择设置方式",
+ "zh-TW": "選擇設定方式"
+ },
+ "AUTOMATION_SETUP_CHOICE$DESCRIPTION": {
+ "ar": "تعمل مُستجيبات {{name}} على أفضل وجه عندما تتمكن من الاستماع إلى الأحداث باستمرار. اختر الإعداد الذي يناسب احتياجاتك.",
+ "ca": "Els responedors de {{name}} funcionen millor quan poden escoltar esdeveniments contínuament. Tria la configuració que s'adapti a les teves necessitats.",
+ "de": "{{name}}-Responder funktionieren am besten, wenn sie kontinuierlich auf Ereignisse warten können. Wählen Sie die Einrichtung, die zu Ihren Anforderungen passt.",
+ "en": "{{name}} responders work best when they can listen for events continuously. Choose the setup that works for your needs.",
+ "es": "Los respondedores de {{name}} funcionan mejor cuando pueden escuchar eventos de forma continua. Elige la configuración que se adapte a tus necesidades.",
+ "fr": "Les répondeurs {{name}} fonctionnent mieux lorsqu'ils peuvent écouter les événements en continu. Choisissez la configuration adaptée à vos besoins.",
+ "it": "I responder di {{name}} funzionano al meglio quando possono restare in ascolto degli eventi in modo continuo. Scegli la configurazione più adatta alle tue esigenze.",
+ "ja": "{{name}}のレスポンダーは、イベントを継続的に監視できるときに最も効果を発揮します。ニーズに合ったセットアップを選択してください。",
+ "ko-KR": "{{name}} 응답기는 이벤트를 지속적으로 수신할 수 있을 때 가장 잘 작동합니다. 필요에 맞는 설정을 선택하세요.",
+ "no": "{{name}}-respondere fungerer best når de kan lytte etter hendelser kontinuerlig. Velg oppsettet som passer dine behov.",
+ "pt": "Os respondedores do {{name}} funcionam melhor quando podem ouvir eventos continuamente. Escolha a configuração que atende às suas necessidades.",
+ "tr": "{{name}} yanıtlayıcıları, olayları sürekli dinleyebildiklerinde en iyi şekilde çalışır. İhtiyaçlarınıza uygun kurulumu seçin.",
+ "uk": "Відповідачі {{name}} працюють найкраще, коли можуть безперервно слухати події. Виберіть налаштування, яке відповідає вашим потребам.",
+ "zh-CN": "当能够持续监听事件时,{{name}} 响应程序的效果最佳。请选择符合你需求的设置方式。",
+ "zh-TW": "當能夠持續監聽事件時,{{name}} 回應程式的效果最佳。請選擇符合你需求的設定方式。"
+ },
+ "AUTOMATION_SETUP_CHOICE$BUILT_IN_TITLE": {
+ "ar": "استخدم تكامل {{name}} المدمج",
+ "ca": "Utilitza la integració integrada de {{name}}",
+ "de": "Integrierte {{name}}-Integration verwenden",
+ "en": "Use Built-In {{name}} Integration",
+ "es": "Usar la integración integrada de {{name}}",
+ "fr": "Utiliser l'intégration {{name}} intégrée",
+ "it": "Usa l'integrazione {{name}} integrata",
+ "ja": "組み込みの{{name}}連携を使用",
+ "ko-KR": "기본 제공 {{name}} 통합 사용",
+ "no": "Bruk innebygd {{name}}-integrasjon",
+ "pt": "Usar a integração nativa do {{name}}",
+ "tr": "Yerleşik {{name}} entegrasyonunu kullan",
+ "uk": "Використати вбудовану інтеграцію {{name}}",
+ "zh-CN": "使用内置的 {{name}} 集成",
+ "zh-TW": "使用內建的 {{name}} 整合"
+ },
+ "AUTOMATION_SETUP_CHOICE$BUILT_IN_DESCRIPTION": {
+ "ar": "الطريقة الأسرع والأبسط لإعداد مُستجيب {{name}}.",
+ "ca": "La manera més ràpida i senzilla de configurar un responedor de {{name}}.",
+ "de": "Der schnellste und einfachste Weg, einen {{name}}-Responder einzurichten.",
+ "en": "The fastest and simplest way to set up a {{name}} responder.",
+ "es": "La forma más rápida y sencilla de configurar un respondedor de {{name}}.",
+ "fr": "Le moyen le plus rapide et le plus simple de configurer un répondeur {{name}}.",
+ "it": "Il modo più rapido e semplice per configurare un responder di {{name}}.",
+ "ja": "{{name}}のレスポンダーをセットアップする最も速く簡単な方法です。",
+ "ko-KR": "{{name}} 응답기를 설정하는 가장 빠르고 간단한 방법입니다.",
+ "no": "Den raskeste og enkleste måten å sette opp en {{name}}-responder på.",
+ "pt": "A forma mais rápida e simples de configurar um respondedor do {{name}}.",
+ "tr": "Bir {{name}} yanıtlayıcısı kurmanın en hızlı ve en basit yolu.",
+ "uk": "Найшвидший і найпростіший спосіб налаштувати відповідач {{name}}.",
+ "zh-CN": "设置 {{name}} 响应程序最快、最简单的方式。",
+ "zh-TW": "設定 {{name}} 回應程式最快、最簡單的方式。"
+ },
+ "AUTOMATION_SETUP_CHOICE$BUILT_IN_FEATURE_READY": {
+ "ar": "جاهز للاستخدام فور الاتصال",
+ "ca": "Llest per utilitzar immediatament després de connectar",
+ "de": "Sofort nach dem Verbinden einsatzbereit",
+ "en": "Ready to use immediately after connecting",
+ "es": "Listo para usar inmediatamente después de conectar",
+ "fr": "Prêt à l'emploi dès la connexion",
+ "it": "Pronto all'uso subito dopo la connessione",
+ "ja": "接続後すぐに利用可能",
+ "ko-KR": "연결 후 바로 사용 가능",
+ "no": "Klar til bruk umiddelbart etter tilkobling",
+ "pt": "Pronto para usar imediatamente após conectar",
+ "tr": "Bağlandıktan hemen sonra kullanıma hazır",
+ "uk": "Готово до використання одразу після підключення",
+ "zh-CN": "连接后即可立即使用",
+ "zh-TW": "連線後即可立即使用"
+ },
+ "AUTOMATION_SETUP_CHOICE$BUILT_IN_FEATURE_EVENT_DRIVEN": {
+ "ar": "يعتمد على الأحداث لأسرع أوقات استجابة",
+ "ca": "Basat en esdeveniments per obtenir els temps de resposta més ràpids",
+ "de": "Ereignisgesteuert für schnellste Reaktionszeiten",
+ "en": "Event-driven for fastest response times",
+ "es": "Basado en eventos para los tiempos de respuesta más rápidos",
+ "fr": "Piloté par les événements pour des temps de réponse optimaux",
+ "it": "Basato su eventi per i tempi di risposta più rapidi",
+ "ja": "イベント駆動で最速の応答時間",
+ "ko-KR": "이벤트 기반으로 가장 빠른 응답 속도",
+ "no": "Hendelsesdrevet for raskest mulig responstid",
+ "pt": "Orientado a eventos para os tempos de resposta mais rápidos",
+ "tr": "En hızlı yanıt süreleri için olay tabanlı",
+ "uk": "Керується подіями для найшвидшого часу відповіді",
+ "zh-CN": "事件驱动,响应速度最快",
+ "zh-TW": "事件驅動,回應速度最快"
+ },
+ "AUTOMATION_SETUP_CHOICE$BUILT_IN_FEATURE_WORKFLOW": {
+ "ar": "سير عمل جاهز للاستخدام",
+ "ca": "Flux de treball llest per utilitzar",
+ "de": "Sofort einsatzbereiter Workflow",
+ "en": "Out-of-the-box workflow",
+ "es": "Flujo de trabajo listo para usar",
+ "fr": "Flux de travail prêt à l'emploi",
+ "it": "Flusso di lavoro pronto all'uso",
+ "ja": "すぐに使えるワークフロー",
+ "ko-KR": "바로 사용할 수 있는 워크플로",
+ "no": "Ferdig arbeidsflyt uten ekstra oppsett",
+ "pt": "Fluxo de trabalho pronto para uso",
+ "tr": "Kullanıma hazır iş akışı",
+ "uk": "Готовий до використання робочий процес",
+ "zh-CN": "开箱即用的工作流",
+ "zh-TW": "開箱即用的工作流程"
+ },
+ "AUTOMATION_SETUP_CHOICE$BUILT_IN_ACTION": {
+ "ar": "اتصل واستخدم تكامل {{name}}",
+ "ca": "Connecta i utilitza la integració de {{name}}",
+ "de": "{{name}}-Integration verbinden und verwenden",
+ "en": "Connect and use {{name}} Integration",
+ "es": "Conectar y usar la integración de {{name}}",
+ "fr": "Connecter et utiliser l'intégration {{name}}",
+ "it": "Connetti e usa l'integrazione {{name}}",
+ "ja": "{{name}}連携に接続して使用",
+ "ko-KR": "{{name}} 통합 연결 및 사용",
+ "no": "Koble til og bruk {{name}}-integrasjonen",
+ "pt": "Conectar e usar a integração do {{name}}",
+ "tr": "{{name}} entegrasyonunu bağla ve kullan",
+ "uk": "Підключити та використати інтеграцію {{name}}",
+ "zh-CN": "连接并使用 {{name}} 集成",
+ "zh-TW": "連線並使用 {{name}} 整合"
+ },
+ "AUTOMATION_SETUP_CHOICE$POLLING_TITLE": {
+ "ar": "إعداد أتمتة الاستطلاع",
+ "ca": "Configura una automatització de sondeig",
+ "de": "Polling-Automatisierung einrichten",
+ "en": "Setup Polling Automation",
+ "es": "Configurar una automatización de sondeo",
+ "fr": "Configurer une automatisation par interrogation",
+ "it": "Configura un'automazione con polling",
+ "ja": "ポーリング自動化をセットアップ",
+ "ko-KR": "폴링 자동화 설정",
+ "no": "Sett opp polling-automatisering",
+ "pt": "Configurar uma automação de polling",
+ "tr": "Yoklama otomasyonu kur",
+ "uk": "Налаштувати автоматизацію з опитуванням",
+ "zh-CN": "设置轮询自动化",
+ "zh-TW": "設定輪詢自動化"
+ },
+ "AUTOMATION_SETUP_CHOICE$POLLING_DESCRIPTION": {
+ "ar": "استخدم اتصال MCP لـ {{name}} وأنشئ أتمتة مخصصة تعمل وفق جدول زمني.",
+ "ca": "Utilitza una connexió MCP de {{name}} i crea una automatització personalitzada que s'executi segons una programació.",
+ "de": "Verwenden Sie eine {{name}}-MCP-Verbindung und erstellen Sie eine eigene Automatisierung, die nach Zeitplan ausgeführt wird.",
+ "en": "Use a {{name}} MCP connection and create a custom automation that runs on a schedule.",
+ "es": "Usa una conexión MCP de {{name}} y crea una automatización personalizada que se ejecute según una programación.",
+ "fr": "Utilisez une connexion MCP {{name}} et créez une automatisation personnalisée qui s'exécute selon une planification.",
+ "it": "Usa una connessione MCP di {{name}} e crea un'automazione personalizzata eseguita secondo una pianificazione.",
+ "ja": "{{name}}のMCP接続を使用して、スケジュールで実行されるカスタム自動化を作成します。",
+ "ko-KR": "{{name}} MCP 연결을 사용하여 일정에 따라 실행되는 사용자 지정 자동화를 만듭니다.",
+ "no": "Bruk en {{name}} MCP-tilkobling og opprett en tilpasset automatisering som kjører etter en tidsplan.",
+ "pt": "Use uma conexão MCP do {{name}} e crie uma automação personalizada que é executada de acordo com um agendamento.",
+ "tr": "Bir {{name}} MCP bağlantısı kullanın ve bir zamanlamaya göre çalışan özel bir otomasyon oluşturun.",
+ "uk": "Використайте MCP-підключення {{name}} і створіть власну автоматизацію, що працює за розкладом.",
+ "zh-CN": "使用 {{name}} MCP 连接,创建按计划运行的自定义自动化。",
+ "zh-TW": "使用 {{name}} MCP 連線,建立依排程執行的自訂自動化。"
+ },
+ "AUTOMATION_SETUP_CHOICE$POLLING_FEATURE_MCP": {
+ "ar": "يستخدم اتصال MCP لـ {{name}}",
+ "ca": "Utilitza la connexió MCP de {{name}}",
+ "de": "Verwendet eine {{name}}-MCP-Verbindung",
+ "en": "Uses {{name}} MCP connection",
+ "es": "Usa la conexión MCP de {{name}}",
+ "fr": "Utilise une connexion MCP {{name}}",
+ "it": "Usa la connessione MCP di {{name}}",
+ "ja": "{{name}}のMCP接続を使用",
+ "ko-KR": "{{name}} MCP 연결 사용",
+ "no": "Bruker {{name}} MCP-tilkobling",
+ "pt": "Usa a conexão MCP do {{name}}",
+ "tr": "{{name}} MCP bağlantısını kullanır",
+ "uk": "Використовує MCP-підключення {{name}}",
+ "zh-CN": "使用 {{name}} MCP 连接",
+ "zh-TW": "使用 {{name}} MCP 連線"
+ },
+ "AUTOMATION_SETUP_CHOICE$POLLING_FEATURE_SCHEDULE": {
+ "ar": "يعتمد على الاستطلاع (يعمل كل بضع دقائق)",
+ "ca": "Basat en sondeig (s'executa cada pocs minuts)",
+ "de": "Polling-basiert (läuft alle paar Minuten)",
+ "en": "Polling based (runs every few minutes)",
+ "es": "Basado en sondeo (se ejecuta cada pocos minutos)",
+ "fr": "Basé sur l'interrogation (s'exécute toutes les quelques minutes)",
+ "it": "Basato su polling (eseguito ogni pochi minuti)",
+ "ja": "ポーリングベース(数分ごとに実行)",
+ "ko-KR": "폴링 기반(몇 분마다 실행)",
+ "no": "Polling-basert (kjører med noen minutters mellomrom)",
+ "pt": "Baseado em polling (executa a cada poucos minutos)",
+ "tr": "Yoklama tabanlı (birkaç dakikada bir çalışır)",
+ "uk": "На основі опитування (запускається кожні кілька хвилин)",
+ "zh-CN": "基于轮询(每隔几分钟运行一次)",
+ "zh-TW": "以輪詢為基礎(每隔幾分鐘執行一次)"
+ },
+ "AUTOMATION_SETUP_CHOICE$POLLING_FEATURE_CUSTOMIZE": {
+ "ar": "يتطلب منك التخصيص",
+ "ca": "Requereix que el personalitzis",
+ "de": "Erfordert eigene Anpassung",
+ "en": "Requires you to customize",
+ "es": "Requiere que lo personalices",
+ "fr": "Nécessite une personnalisation de votre part",
+ "it": "Richiede una tua personalizzazione",
+ "ja": "カスタマイズが必要",
+ "ko-KR": "직접 사용자 지정 필요",
+ "no": "Krever at du tilpasser den selv",
+ "pt": "Requer que você personalize",
+ "tr": "Özelleştirmenizi gerektirir",
+ "uk": "Потребує власного налаштування",
+ "zh-CN": "需要你自行定制",
+ "zh-TW": "需要你自行自訂"
+ },
+ "AUTOMATION_SETUP_CHOICE$POLLING_ACTION": {
+ "ar": "المتابعة بإعداد الاستطلاع",
+ "ca": "Continua amb la configuració de sondeig",
+ "de": "Mit Polling-Einrichtung fortfahren",
+ "en": "Continue with polling setup",
+ "es": "Continuar con la configuración de sondeo",
+ "fr": "Continuer avec la configuration par interrogation",
+ "it": "Continua con la configurazione con polling",
+ "ja": "ポーリングのセットアップを続行",
+ "ko-KR": "폴링 설정으로 계속",
+ "no": "Fortsett med polling-oppsett",
+ "pt": "Continuar com a configuração de polling",
+ "tr": "Yoklama kurulumuyla devam et",
+ "uk": "Продовжити з налаштуванням опитування",
+ "zh-CN": "继续轮询设置",
+ "zh-TW": "繼續輪詢設定"
+ },
"BUTTON$COLLAPSE_DETAILS": {
"en": "Collapse details",
"zh-CN": "收起详情",