{"record":{"id":"47db4d8c627a47a8","repo":"SonarSource/sonarqube","slug":"devops-platform-s-is-not-supported-by-the-remed","errorCode":null,"errorMessage":"DevOps Platform '%s' is not supported by the Remediation Agent","messagePattern":"DevOps Platform '(.+?)' is not supported by the Remediation Agent","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":400,"severity":"error","filePath":"server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/permission/DopPermissionValidationService.java","lineNumber":131,"sourceCode":"    GitlabGlobalSettingsValidator gitlabGlobalSettingsValidator, AzureDevOpsValidator azureDevOpsValidator, System2 system2, Ticker cacheTicker) {\n    DopPermissionValidationService service = new DopPermissionValidationService(githubGlobalSettingsValidator, gitlabGlobalSettingsValidator,\n      azureDevOpsValidator, system2);\n    service.cache = buildCache(cacheTicker);\n    return service;\n  }\n\n  /**\n   * Checks the given DevOps Platform configuration against the Remediation Agent's required write permissions.\n   *\n   * @throws IllegalArgumentException if the configuration's platform is not supported (Bitbucket).\n   */\n  public DopPermissionCheck check(AlmSettingDto almSetting) {\n    return switch (almSetting.getAlm()) {\n      case GITHUB -> checkGithub(almSetting);\n      case GITLAB -> checkGitlab(almSetting);\n      case AZURE_DEVOPS -> checkAzure(almSetting);\n      case BITBUCKET, BITBUCKET_CLOUD ->\n        throw new IllegalArgumentException(\"DevOps Platform '\" + almSetting.getAlm() + \"' is not supported by the Remediation Agent\");\n    };\n  }\n\n  /**\n   * Checks several configurations in parallel and returns the results in the same order as the input. Each individual\n   * check is time-bounded by the ALM client's connect/read timeouts; running them concurrently keeps the total close to\n   * the slowest single platform. Uses a virtual thread per check rather than a fixed pool — these calls are blocking\n   * I/O, not CPU-bound, and there are at most a handful of supported platforms per instance, so there's no pool sizing\n   * to tune and no thread reuse to lose by not sharing an executor across calls. All settings must be supported\n   * platforms (see {@link #check(AlmSettingDto)}).\n   */\n  public List<DopPermissionCheck> checkAll(List<AlmSettingDto> almSettings) {\n    return mapInParallel(almSettings, this::check);\n  }\n\n  /**\n   * Cached counterpart to {@link #check(AlmSettingDto)}. A cache hit performs no external call. Concurrent misses for\n   * the same configuration are coalesced into a single live check (Guava {@code Cache.get(key, Callable)} semantics).","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/SonarSource/sonarqube/blob/184c821202192afc1c599fc912d0889b69fffa53/server/sonar-webserver-common/src/main/java/org/sonar/server/common/almsettings/permission/DopPermissionValidationService.java#L113-L149","documentation":"DopPermissionValidationService.check only supports GitHub, GitLab and Azure DevOps when checking whether the Remediation Agent may access a DevOps platform. BitBucket (server) and BitBucket Cloud configurations are explicitly rejected with this IllegalArgumentException. It is a deliberate unsupported-operation guard, not a configuration corruption.","triggerScenarios":"Calling the Remediation Agent permission check (via check()/result endpoint) with an AlmSettingDto whose alm() is BITBUCKET or BITBUCKET_CLOUD.","commonSituations":"Tenant configured BitBucket integration and then enabled/queried the Remediation Agent; API client iterates over all ALM settings including BitBucket without filtering by supported platform.","solutions":["Filter ALM settings to GITHUB/GITLAB/AZURE_DEVOPS before invoking the check","Use a supported DevOps platform configuration for Remediation Agent checks","Handle IllegalArgumentException per-setting so one unsupported integration doesn't fail a batch check"],"exampleFix":"// before\nfor (AlmSettingDto dto : almSettings) { results.add(service.check(dto)); }\n// after\nfor (AlmSettingDto dto : almSettings) {\n  if (dto.getAlm() == BITBUCKET || dto.getAlm() == BITBUCKET_CLOUD) continue;\n  results.add(service.check(dto));\n}","handlingStrategy":"type-guard","validationCode":"Set<Alm> SUPPORTED = Set.of(GITHUB, GITLAB, AZURE_DEVOPS);\nif (!SUPPORTED.contains(almSetting.getAlm())) throw new IllegalArgumentException(\"Remediation Agent unsupported: \" + almSetting.getAlm());","typeGuard":"boolean isRemediationAgentSupported(AlmSettingDto dto) {\n  return dto != null && EnumSet.of(GITHUB, GITLAB, AZURE_DEVOPS).contains(dto.getAlm());\n}","tryCatchPattern":"try {\n  check = service.check(almSetting);\n} catch (IllegalArgumentException e) {\n  // unsupported platform (BitBucket) — mark as N/A, not a failure\n  check = DopPermissionCheck.unsupported(almSetting.getAlm());\n}","preventionTips":["Filter ALM settings by supported platforms before Remediation Agent calls","Track feature-platform support matrix when new integrations ship","Write tests covering each Alm enum value for any switch over alm()"],"tags":["devops-platform","unsupported-operation","bitbucket","remediation-agent"],"backgroundTag":"unsupported-operation","analyzedSha":"184c821202192afc1c599fc912d0889b69fffa53","analyzedAt":"2026-09-09T12:23:51.573Z","contentChangedAt":"2026-09-09T12:23:51.573Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}