# SPEC: PJ2026-01060703 CI/CD branch follower draft-2026-07-03-p0-branch-follower
apiVersion: unidesk.pikapython.com/v1alpha1
kind: CicdBranchFollowerRegistry
metadata:
  id: unidesk-cicd-branch-followers
  owner: UniDesk
  specRef: PJ2026-01060703
  version: draft-2026-07-03-p0-branch-follower

controller:
  namespace: devops-infra
  kubeRoute: JD01:k3s
  fieldManager: unidesk-cicd-branch-follower
  serviceAccountName: unidesk-cicd-branch-follower
  deploymentName: unidesk-cicd-branch-follower
  configMapName: unidesk-cicd-branch-follower-config
  stateConfigMapName: unidesk-cicd-branch-follower-state
  leaseName: unidesk-cicd-branch-follower
  image: 127.0.0.1:5000/hwlab/hwlab-ci-node-tools:node22-alpine-bun-v1
  labels:
    app.kubernetes.io/name: unidesk-cicd-branch-follower
    app.kubernetes.io/component: cicd-control-plane
    app.kubernetes.io/part-of: unidesk
  source:
    repository: pikasTech/unidesk
    branch: master
    gitMirrorReadUrl: http://git-mirror-http.devops-infra.svc.cluster.local:8080/pikasTech/unidesk.git
    gitMirrorCachePvcName: hwlab-git-mirror-cache
    githubSsh:
      secretName: git-mirror-github-ssh
      privateKeySecretKey: ssh-privatekey
      proxyHost: 10.42.0.1
      proxyPort: 10808
    sourceAuthority:
      mode: gitMirrorSnapshot
      resolver: k8s-git-mirror
      allowHostGit: false
      allowHostWorkspace: false
      allowGithubDirectInPipeline: false
    sourceSnapshot:
      stageRefPrefix: refs/unidesk/snapshots/unidesk-controller/{branch}
      missingObjectPolicy: fail-fast
      refreshPolicy: sync-before-snapshot
  loop:
    intervalSeconds: 30
    reconcileTimeoutSeconds: 110
    leaseDurationSeconds: 140
    terminationGracePeriodSeconds: 30
  budgets:
    applyWaitSeconds: 120
    statusSeconds: 35
    runOnceSeconds: 120
    reconcileJobTtlSeconds: 600
    reconcileJobBackoffLimit: 0
    reconcileJobDeadlineGraceSeconds: 30
    reconcileTransportGraceSeconds: 20
    nativeTransportGraceSeconds: 10
    nativePollIntervalSeconds: 2

followers:
  - id: hwlab-jd01-v03
    enabled: false
    deliveryAuthority: retired-readonly
    adapter: hwlab-node-runtime
    description: Retired for GH-1557; HWLAB v0.3 JD01 runtime CI is driven by Gitea mirror -> Pipelines-as-Code -> Tekton -> ArgoCD.
    source:
      repository: pikasTech/HWLAB
      branch: v0.3
      branchRef: config/hwlab-node-lanes.yaml#lanes.v03.sourceBranch
      authorityRef: config/platform-infra/gitea.yaml#sourceAuthority.repositories
      snapshotPrefix: refs/unidesk/snapshots/gitea-actions/hwlab-node-runtime/v0.3
      snapshotRef: config/platform-infra/gitea.yaml#sourceAuthority.repositories
    target:
      node: JD01
      lane: v03
      namespace: hwlab-v03
      configRefs:
        lane: config/hwlab-node-lanes.yaml#lanes.v03
        target: config/hwlab-node-lanes.yaml#lanes.v03.targets.JD01
        pipeline: config/hwlab-node-lanes.yaml#lanes.v03.targets.JD01.pipeline
        pipelineRunPrefix: config/hwlab-node-lanes.yaml#lanes.v03.targets.JD01.pipelineRunPrefix
        runtimeNamespace: config/hwlab-node-lanes.yaml#lanes.v03.targets.JD01.runtime.namespace
    budgets:
      endToEndSeconds: 120
      statusSeconds: 35
      triggerSeconds: 120
      sourceSyncSeconds: 20
      controlPlaneRefreshSeconds: 45
      capabilityJobTtlSeconds: 600
      capabilityJobBackoffLimit: 0
    commands:
      plan:
        argv: ["bun", "scripts/cli.ts", "hwlab", "nodes", "control-plane", "trigger-current", "--node", "JD01", "--lane", "v03", "--dry-run", "--raw"]
        timeoutSeconds: 35
      status:
        argv: ["bun", "scripts/cli.ts", "hwlab", "nodes", "control-plane", "status", "--node", "JD01", "--lane", "v03", "--raw"]
        timeoutSeconds: 35
      trigger:
        argv: ["bun", "scripts/cli.ts", "hwlab", "nodes", "control-plane", "trigger-current", "--node", "JD01", "--lane", "v03", "--confirm", "--wait", "--raw"]
        timeoutSeconds: 120
      events:
        argv: ["bun", "scripts/cli.ts", "hwlab", "nodes", "control-plane", "status", "--node", "JD01", "--lane", "v03", "--full"]
        timeoutSeconds: 35
      logs:
        argv: ["bun", "scripts/cli.ts", "hwlab", "nodes", "control-plane", "status", "--node", "JD01", "--lane", "v03", "--full"]
        timeoutSeconds: 35
    nativeStatus:
      source:
        gitMirrorReadUrl: http://git-mirror-http.devops-infra.svc.cluster.local:8080/pikasTech/HWLAB.git
        gitMirrorNamespace: devops-infra
        gitMirrorDeployment: git-mirror-http
        repoPath: /cache/pikasTech/HWLAB.git
      tekton:
        namespace: hwlab-ci
        pipelineRunPrefix: hwlab-jd01-v03-ci-poll
      argo:
        namespace: argocd
        application: hwlab-node-v03
      runtime:
        namespace: hwlab-v03
        workloads:
          - kind: Deployment
            name: hwlab-cloud-api
            sourceCommit:
              labels: ["hwlab.pikastech.local/source-commit", "hwlab.pikastech.local/gitops-render-source-commit"]
              annotations: ["hwlab.pikastech.local/source-commit", "hwlab.pikastech.local/gitops-render-source-commit"]
              podLabels: ["hwlab.pikastech.local/source-commit", "hwlab.pikastech.local/gitops-render-source-commit"]
              podAnnotations: ["hwlab.pikastech.local/source-commit", "hwlab.pikastech.local/gitops-render-source-commit", "hwlab.pikastech.local/boot-commit"]
              env: ["HWLAB_COMMIT_ID"]
    drillDown:
      taskRunTimeoutSeconds: 20
      logsTailLines: 120
      maxLogBytes: 24000
      maxMessageBytes: 1200
      maxContainers: 6
    closeout:
      checks: ["sourceSnapshot", "pipelineRun", "gitMirrorPostFlush", "gitops", "argo", "runtime", "publicHealth"]

  - id: agentrun-jd01-v02
    enabled: false
    deliveryAuthority: retired-readonly
    adapter: agentrun-yaml-lane
    description: Retired for GH-1552; AgentRun v0.2 JD01 CI is driven by Gitea webhook -> Pipelines-as-Code -> Tekton.
    source:
      repository: pikasTech/agentrun
      branch: v0.2
      branchRef: config/agentrun.yaml#controlPlane.lanes.jd01-v02.source.branch
      authorityRef: config/agentrun.yaml#controlPlane.lanes.jd01-v02.source.sourceAuthority
      snapshotPrefix: refs/unidesk/snapshots/agentrun-yaml-lane/v0.2
      snapshotRef: config/agentrun.yaml#controlPlane.lanes.jd01-v02.source.sourceSnapshot.stageRefPrefix
    target:
      node: JD01
      lane: jd01-v02
      namespace: agentrun-v02
      configRefs:
        lane: config/agentrun.yaml#controlPlane.lanes.jd01-v02
        source: config/agentrun.yaml#controlPlane.lanes.jd01-v02.source
        runtime: config/agentrun.yaml#controlPlane.lanes.jd01-v02.runtime
        pipeline: config/agentrun.yaml#controlPlane.lanes.jd01-v02.ci.pipeline
        pipelineRunPrefix: config/agentrun.yaml#controlPlane.lanes.jd01-v02.ci.pipelineRunPrefix
        argoApplication: config/agentrun.yaml#controlPlane.lanes.jd01-v02.gitops.argoApplication
    budgets:
      endToEndSeconds: 120
      statusSeconds: 35
      triggerSeconds: 120
      sourceSyncSeconds: 20
      controlPlaneRefreshSeconds: 20
      capabilityJobTtlSeconds: 600
      capabilityJobBackoffLimit: 0
    commands:
      plan:
        argv: ["bun", "scripts/cli.ts", "agentrun", "control-plane", "trigger-current", "--node", "JD01", "--lane", "jd01-v02", "--dry-run", "--raw"]
        timeoutSeconds: 35
      status:
        argv: ["bun", "scripts/cli.ts", "agentrun", "control-plane", "status", "--node", "JD01", "--lane", "jd01-v02", "--raw"]
        timeoutSeconds: 35
      trigger:
        argv: ["bun", "scripts/cli.ts", "agentrun", "control-plane", "trigger-current", "--node", "JD01", "--lane", "jd01-v02", "--confirm", "--wait", "--raw"]
        timeoutSeconds: 120
      events:
        argv: ["bun", "scripts/cli.ts", "agentrun", "control-plane", "status", "--node", "JD01", "--lane", "jd01-v02", "--full"]
        timeoutSeconds: 35
      logs:
        argv: ["bun", "scripts/cli.ts", "agentrun", "control-plane", "status", "--node", "JD01", "--lane", "jd01-v02", "--full"]
        timeoutSeconds: 35
    nativeStatus:
      source:
        gitMirrorReadUrl: http://git-mirror-http.devops-infra.svc.cluster.local:8080/pikasTech/agentrun.git
        gitMirrorNamespace: devops-infra
        gitMirrorDeployment: git-mirror-http
        repoPath: /cache/pikasTech/agentrun.git
      tekton:
        namespace: agentrun-ci
        pipelineRunPrefix: agentrun-jd01-v02-ci
      argo:
        namespace: argocd
        application: agentrun-jd01-v02
      runtime:
        namespace: agentrun-v02
        workloads:
          - kind: Deployment
            name: agentrun-mgr
            sourceCommit:
              annotations: ["agentrun.pikastech.local/source-commit"]
              podAnnotations: ["agentrun.pikastech.local/source-commit"]
              env: ["AGENTRUN_SOURCE_COMMIT", "AGENTRUN_BOOT_COMMIT"]
    drillDown:
      taskRunTimeoutSeconds: 20
      logsTailLines: 120
      maxLogBytes: 24000
      maxMessageBytes: 1200
      maxContainers: 6
    closeout:
      checks: ["sourceSnapshot", "pipelineRun", "gitops", "argo", "manager", "runtimeHealth"]

  - id: web-probe-sentinel-master
    enabled: false
    deliveryAuthority: retired-readonly
    adapter: web-probe-sentinel-cicd
    description: Historical follower retired by GH-1555. Active path is Gitea mirror -> Pipelines-as-Code -> Tekton -> ArgoCD; do not re-enable branch-follower/Gitea Actions/act_runner fallback.
    source:
      repository: pikasTech/unidesk
      branch: master
      branchRef: config/hwlab-web-probe-sentinel/profiles.yaml#nodes.JD01.sentinels.jd01-web-probe-sentinel.cicd.source.branch
      authorityRef: config/hwlab-web-probe-sentinel/profiles.yaml#nodes.JD01.sentinels.jd01-web-probe-sentinel.cicd.sourceAuthority
      snapshotPrefix: refs/unidesk/snapshots/web-probe-sentinel/master
      snapshotRef: config/hwlab-web-probe-sentinel/profiles.yaml#nodes.JD01.sentinels.jd01-web-probe-sentinel.cicd.sourceSnapshot.stageRefPrefix
    target:
      node: JD01
      lane: v03
      namespace: hwlab-v03
      sentinel: jd01-web-probe-sentinel
      configRefs:
        sentinel: config/hwlab-web-probe-sentinel/profiles.yaml#nodes.JD01.sentinels.jd01-web-probe-sentinel.sentinel
        cicd: config/hwlab-web-probe-sentinel/profiles.yaml#nodes.JD01.sentinels.jd01-web-probe-sentinel.cicd
        monitorRoot: config/hwlab-node-lanes.yaml#lanes.v03.targets.JD01.observability.webProbe.monitorRoot
    budgets:
      endToEndSeconds: 120
      statusSeconds: 35
      triggerSeconds: 120
      sourceSyncSeconds: 20
      controlPlaneRefreshSeconds: 20
      capabilityJobTtlSeconds: 600
      capabilityJobBackoffLimit: 0
    commands:
      plan:
        argv: ["bun", "scripts/cli.ts", "web-probe", "sentinel", "publish-current", "--node", "JD01", "--lane", "v03", "--sentinel", "jd01-web-probe-sentinel", "--dry-run", "--raw"]
        timeoutSeconds: 35
      status:
        argv: ["bun", "scripts/cli.ts", "web-probe", "sentinel", "control-plane", "status", "--node", "JD01", "--lane", "v03", "--sentinel", "jd01-web-probe-sentinel", "--raw"]
        timeoutSeconds: 35
      trigger:
        argv: ["bun", "scripts/cli.ts", "web-probe", "sentinel", "publish-current", "--node", "JD01", "--lane", "v03", "--sentinel", "jd01-web-probe-sentinel", "--confirm", "--wait", "--raw"]
        timeoutSeconds: 120
      events:
        argv: ["bun", "scripts/cli.ts", "web-probe", "sentinel", "control-plane", "status", "--node", "JD01", "--lane", "v03", "--sentinel", "jd01-web-probe-sentinel", "--full"]
        timeoutSeconds: 35
      logs:
        argv: ["bun", "scripts/cli.ts", "web-probe", "sentinel", "report", "--node", "JD01", "--lane", "v03", "--sentinel", "jd01-web-probe-sentinel", "--latest", "--view", "summary", "--raw"]
        timeoutSeconds: 35
    nativeStatus:
      source:
        gitMirrorReadUrl: http://git-mirror-http.devops-infra.svc.cluster.local:8080/pikasTech/unidesk.git
        gitMirrorNamespace: devops-infra
        gitMirrorDeployment: git-mirror-http
        repoPath: /cache/pikasTech/unidesk.git
      tekton:
        namespace: devops-infra
        pipelineRunPrefix: hwlab-web-probe-sentinel-jd01-web-probe-sentinel
      argo:
        namespace: argocd
        application: hwlab-web-probe-sentinel-jd01
      runtime:
        namespace: hwlab-v03
        workloads:
          - kind: Deployment
            name: hwlab-web-probe-sentinel-jd01
            sourceCommit:
              annotations: ["unidesk.ai/source-commit", "hwlab.pikastech.local/source-commit"]
              podAnnotations: ["unidesk.ai/source-commit", "hwlab.pikastech.local/source-commit"]
              env: ["UNIDESK_SOURCE_COMMIT", "WEB_PROBE_SENTINEL_SOURCE_COMMIT"]
    drillDown:
      taskRunTimeoutSeconds: 20
      logsTailLines: 120
      maxLogBytes: 24000
      maxMessageBytes: 1200
      maxContainers: 6
    closeout:
      checks: ["sourceMirror", "imageRegistry", "gitops", "argo", "runtimeHealthEndpoint", "dashboard", "report"]
