feat: hide sast scan when no account

Description

Hide SAST scan sidebar, command and disable save on scan when no active account exists.

Related Issues

Resolves #1741 (closed)

How has this been tested?

  1. Enable the feature flags in settings.json

    "gitlab.securityScans.enabled": true,
    "gitlab.featureFlags.remoteSecurityScans": true

    ⚠️ If "gitlab.featureFlags.singleAccount": true is set, please set it to false. This will cause the config to miss projectPath which is required for the security scan.

  2. Run the extension

  3. Remove GitLab account if any.

  4. Check there is

    • no GITLAB REMOTE SCAN (SAST) in the Workflow sidebar
    • saving doesn't trigger the scan (no notification sent to $/gitlab/security/remoteSecurityScan)
    • can't find Run Remote Scan (SAST) in the command palette

Screenshots (if appropriate)

No Active Account hides SAST Scan.mov

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes

Merge request reports

Loading