version: 1
kind: HwlabWebProbeSentinelCicd
metadata:
  id: web-probe-sentinel-auth-session-switch-cicd
  owner: UniDesk
  specRef: PJ2026-01060508
sentinel:
  cicd:
    controlPlaneConfigRef: config/hwlab-node-control-plane.yaml#targets[0]
    source:
      repository: pikasTech/unidesk
      branch: master
      gitSshUrl: ssh://git@ssh.github.com:443/pikasTech/unidesk.git
      gitMirrorReadUrl: http://git-mirror-http.devops-infra.svc.cluster.local:8080/pikasTech/unidesk.git
      buildContext: .
      entrypoint: scripts/web-probe-sentinel-service.ts
      checkoutPaths:
        - scripts
        - config
        - config.json
        - src
        - package.json
        - bun.lock
        - bun.lockb
    sourceAuthority:
      mode: gitMirrorSnapshot
      resolver: k8s-git-mirror
      allowHostGit: false
      allowGithubDirectInPipeline: false
    sourceSnapshot:
      stageRefPrefix: refs/unidesk/snapshots/web-probe-sentinel/{branch}
      missingObjectPolicy: fail-fast
      refreshPolicy: sync-before-snapshot
      cacheRef: source.gitMirrorReadUrl
    builder:
      namespace: devops-infra
      sourceMode: sparse-git-checkout
      jobPrefix: web-probe-sentinel-auth-switch-publish
      gitSshSecretName: git-mirror-github-ssh
      activeDeadlineSeconds: 900
      ttlSecondsAfterFinished: 3600
    gitopsPath: deploy/gitops/node/d601/web-probe-sentinel-auth-switch
    argo:
      namespace: argocd
      projectName: hwlab-d601
      applicationName: hwlab-web-probe-sentinel-auth-switch
      repoURL: http://git-mirror-http.devops-infra.svc.cluster.local:8080/pikasTech/HWLAB.git
      targetRevision: v0.3-gitops
    image:
      repository: 127.0.0.1:5000/hwlab/web-probe-sentinel-auth-switch
      tagSource: source-commit
      baseImageRef: config/hwlab-node-control-plane.yaml#targets[0].tekton.toolsImage.output
      envRecipeRef: config/hwlab-web-probe-sentinel/runtime.auth-session-switch.yaml#sentinel.runtime
    maintenance:
      startCommand: sentinel maintenance start
      stopCommand: sentinel maintenance stop
    monitorWeb:
      frontendStack: vue3-vendored-browser-build
      runtimeMode: runner-served-bridge
      assetRoot: scripts/assets/web-probe-sentinel-monitor-web
      envReuse:
        mode: k8s-buildkit-and-ci-node-deps
        nodeDepsPath: /opt/hwlab-ci-node-deps/node_modules
      imageBuild:
        packageMode: copy-only-containerfile
        networkMode: host
        proxySource: node.networkProfile.imageBuildProxy
        contextIgnore: generated
        verifyPhase: pre-image-build
        buildkitState:
          mode: hostPath
          path: /var/lib/unidesk/web-probe-sentinel/buildkit-${nodeLower}
          type: DirectoryOrCreate
      gitMirror:
        source: source.gitMirrorReadUrl
        preSync: required
        postFlush: required
      ciBudget:
        maxSeconds: 120
    confirmWait:
      maxSeconds: 120
    publishCurrent:
      endToEndBudget:
        maxSeconds: 120
      stageBudgets:
        sourceSyncSeconds: 20
        sourceFetchSeconds: 20
        monitorWebVerifySeconds: 15
        imageBuildSeconds: 45
        gitopsSeconds: 15
        argoRuntimeSeconds: 30
        dashboardVerifySeconds: 30
      dashboard:
        enabled: true
        required: true
        viewport: 1440x900
        timeoutMs: 30000
        waitTimeoutMs: 60000
        commandTimeoutSeconds: 90
        fullPage: false
    targetValidation:
      scenarioId: workbench-auth-session-switch-2users
      maxSeconds: 300
      serviceUnavailablePolicy: structured-failure
