Skip to content
Snippets Groups Projects

Add an alert to warn about `gitops` keyword deprecation

What does this MR do and why?

This MR adds an alert on the Kubernetes clusters page to warn our users about the deprecation of the gitops keyword for the agent configuration.

We create a list of all agent configuration files that are present in the current project. Then, we request the raw files one by one and parse the response searching for the gitops keyword. We stop requesting files once the gitops keyword is found.

This way we can show the alert only to the users who are affected by the deprecation.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Screenshot_2024-02-01_at_23.43.08

How to set up and validate locally

  1. Visit Operate -> Kubernetes clusters page by clicking Connect a cluster button.
  2. Create a could of agents
  3. Add configuration files to the agents by creating the file under .gitlab/agents/<your-agent-name>/config.yaml
  4. Use gitops keyword in the yaml file, for example
    gitops:
      manifest_projects:
      - id: <your-project-path>
  5. Visit Operate -> Kubernetes clusters page again and verify the alert.

Related to #440179 (closed)

Merge request reports

Merged results pipeline #1166897160 passed

Pipeline: E2E GDK

#1166903977

    Pipeline: GitLab

    #1166904694

      Pipeline: Ruby 3.1 as-if-foss pipeline

      #1166902895

        Merged results pipeline passed for 1c5e2909

        Test coverage 81.52% (16.72%) from 2 jobs
        Approval is optional

        Merged by Andrew FontaineAndrew Fontaine 1 year ago (Feb 6, 2024 10:34pm UTC)

        Merge details

        • Changes merged into master with aac7c340 (commits were squashed).
        • Deleted the source branch.

        Pipeline #1166948291 passed

        Pipeline passed for aac7c340 on master

        Test coverage 64.84% (16.72%) from 2 jobs
        10 environments impacted.

        Activity

        Filter activity
        • Approvals
        • Assignees & reviewers
        • Comments (from bots)
        • Comments (from users)
        • Commits & branches
        • Edits
        • Labels
        • Lock status
        • Mentions
        • Merge request status
        • Tracking
      • Ilonah Pelaez approved this merge request

        approved this merge request

      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Please register or sign in to reply
        Loading