Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesPull RequestsActionsSecurityInsightsSettings
✨ AI
More
Blame · Line-by-line history

ViewHealthAction.kt

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

ViewHealthAction.ktBlame48 lines · 1 contributor
0377886Claude1package com.gluecron.actions
2
3import com.gluecron.GluecronUtil
4import com.gluecron.settings.GluecronSettingsState
5import com.intellij.notification.NotificationType
6import com.intellij.openapi.actionSystem.AnAction
7import com.intellij.openapi.actionSystem.AnActionEvent
8import com.intellij.openapi.project.DumbAware
9
10/**
11 * Opens a browser tab showing the repository health / CI dashboard.
12 *
13 * URL pattern: {host}/{owner}/{repo}/health
14 *
15 * The health page aggregates:
16 * - GateTest scan results from the most recent push
17 * - CI/CD pipeline status
18 * - Branch protection rule compliance
19 * - Open PR count and review coverage
20 *
21 * This is the JetBrains equivalent of the VS Code "gluecron.viewHealth" command,
22 * and mirrors the /admin/deploys live step stream mentioned in the project docs.
23 */
24class ViewHealthAction : AnAction(), DumbAware {
25
26 override fun actionPerformed(e: AnActionEvent) {
27 val project = e.project ?: return
28 val settings = GluecronSettingsState.getInstance()
29
30 val (owner, repo) = GluecronUtil.detectOwnerRepo(project)
31 ?: run {
32 GluecronUtil.notify(
33 project,
34 "No Gluecron remote detected. Ensure the project has a git remote " +
35 "pointing to ${settings.host}.",
36 NotificationType.WARNING
37 )
38 return
39 }
40
41 val url = "${settings.host}/$owner/$repo/health"
42 GluecronUtil.openBrowser(url)
43 }
44
45 override fun update(e: AnActionEvent) {
46 e.presentation.isEnabledAndVisible = e.project != null
47 }
48}