Skip to content

Update gitlab-rake geo:status to add sections for info

Keelan Lang requested to merge code-klang-update-geo-check-rake-formatting into master

What does this MR do and why?

I'm making a few changes to the gitlab-rake geo:status task to make it easier to find the info you want at-a-glance:

  1. Add a header and separator for replication status
  2. Add a header and separator for verification status
  3. "Moved" Name and URL into a section called "Node Information"
  4. Aligned Name and URL with other elements
  5. Added a new section header and separator called "Replication Information"
  6. Updated the GEO_STATUS_COLUMN_WIDTH variable to accommodate longer strings
  7. Adjusted the divider length to match the GEO_STATUS_COLUMN_WIDTH because I think it looks tidier
  8. Align section headers to GEO_STATUS_COLUMN_WIDTH, again because I think it looks tidier
  9. Move Replication Information to follow Node Information, so that "info" and "status" sections are together

I would also like help fixing a few things:

  • You can see in my example that the width for very long items, like "Dependency Proxy Manifests Verified", breaks the vertical alignment. I think we can probably fix this. I didn't realize GEO_STATUS_COLUMN_WIDTH is a magic number, so I updated it to 42 () since that corresponds to the longest string we use.
  • I'd like to align Name and URL to use the GEO_STATUS_COLUMN_WIDTH but I don't know if I can just slap .rjust(GEO_STATUS_COLUMN_WIDTH) on the end. I can do that, but it didn't work as expected. I followed the example of print_gitlab_version and did a print for the string followed by a puts for the value. There might be a better way of doing this, but boring solution and all that.

References

Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

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

Since this is text output, here's what it will look like. Note that some sections are colored, which is not reflected here.

current


Name: latte
URL: gitlab.example.com
-----------------------------------------------------
                   GitLab Version: 17.4.2-ee
                         Geo Role: Secondary
                    Health Status: Healthy
                      Lfs Objects: succeeded 2 / total 2 (100%)
              Merge Request Diffs: succeeded 0 / total 0 (0%)
                    Package Files: succeeded 0 / total 0 (0%)
         Terraform State Versions: succeeded 0 / total 0 (0%)
             Snippet Repositories: succeeded 0 / total 0 (0%)
          Group Wiki Repositories: succeeded 0 / total 0 (0%)
               Pipeline Artifacts: succeeded 0 / total 0 (0%)
                Pages Deployments: succeeded 0 / total 0 (0%)
                          Uploads: succeeded 2 / total 2 (100%)
                    Job Artifacts: succeeded 0 / total 0 (0%)
                  Ci Secure Files: succeeded 0 / total 0 (0%)
           Dependency Proxy Blobs: succeeded 0 / total 0 (0%)
       Dependency Proxy Manifests: succeeded 0 / total 0 (0%)
        Project Wiki Repositories: succeeded 2 / total 2 (100%)
   Design Management Repositories: succeeded 1 / total 1 (100%)
             Project Repositories: succeeded 2 / total 2 (100%)
             Lfs Objects Verified: succeeded 2 / total 2 (100%)
     Merge Request Diffs Verified: succeeded 0 / total 0 (0%)
           Package Files Verified: succeeded 0 / total 0 (0%)
Terraform State Versions Verified: succeeded 0 / total 0 (0%)
    Snippet Repositories Verified: succeeded 0 / total 0 (0%)
 Group Wiki Repositories Verified: succeeded 0 / total 0 (0%)
      Pipeline Artifacts Verified: succeeded 0 / total 0 (0%)
       Pages Deployments Verified: succeeded 0 / total 0 (0%)
                 Uploads Verified: succeeded 2 / total 2 (100%)
           Job Artifacts Verified: succeeded 0 / total 0 (0%)
         Ci Secure Files Verified: succeeded 0 / total 0 (0%)
  Dependency Proxy Blobs Verified: succeeded 0 / total 0 (0%)
Dependency Proxy Manifests Verified: succeeded 0 / total 0 (0%)
Project Wiki Repositories Verified: succeeded 2 / total 2 (100%)
Design Management Repositories Verified: succeeded 1 / total 1 (100%)
    Project Repositories Verified: succeeded 2 / total 2 (100%)
                    Sync Settings: Full
         Database replication lag: 0 seconds
  Last event ID seen from primary: 53 (6 days ago)
          Last event ID processed: 53 (6 days ago)
           Last status report was: 2 minutes ago

proposed

                          Node Information
------------------------------------------
                                    Name: latte
                                     URL: https://gitlab.example.com
                          GitLab Version: 17.4.2-ee
                                Geo Role: Secondary
                           Health Status: Healthy

                   Replication Information
------------------------------------------
                           Sync Settings: Full
                Database replication lag: 0 seconds
         Last event ID seen from primary: 53 (6 days ago)
                 Last event ID processed: 53 (6 days ago)
                  Last status report was: 1 minute ago

                        Replication Status
------------------------------------------
                             Lfs Objects: succeeded 2 / total 2 (100%)
                     Merge Request Diffs: succeeded 0 / total 0 (0%)
                           Package Files: succeeded 0 / total 0 (0%)
                Terraform State Versions: succeeded 0 / total 0 (0%)
                    Snippet Repositories: succeeded 0 / total 0 (0%)
                 Group Wiki Repositories: succeeded 0 / total 0 (0%)
                      Pipeline Artifacts: succeeded 0 / total 0 (0%)
                       Pages Deployments: succeeded 0 / total 0 (0%)
                                 Uploads: succeeded 2 / total 2 (100%)
                           Job Artifacts: succeeded 0 / total 0 (0%)
                         Ci Secure Files: succeeded 0 / total 0 (0%)
                  Dependency Proxy Blobs: succeeded 0 / total 0 (0%)
              Dependency Proxy Manifests: succeeded 0 / total 0 (0%)
               Project Wiki Repositories: succeeded 2 / total 2 (100%)
          Design Management Repositories: succeeded 1 / total 1 (100%)
                    Project Repositories: succeeded 2 / total 2 (100%)

                       Verification Status
------------------------------------------
                    Lfs Objects Verified: succeeded 2 / total 2 (100%)
            Merge Request Diffs Verified: succeeded 0 / total 0 (0%)
                  Package Files Verified: succeeded 0 / total 0 (0%)
       Terraform State Versions Verified: succeeded 0 / total 0 (0%)
           Snippet Repositories Verified: succeeded 0 / total 0 (0%)
        Group Wiki Repositories Verified: succeeded 0 / total 0 (0%)
             Pipeline Artifacts Verified: succeeded 0 / total 0 (0%)
              Pages Deployments Verified: succeeded 0 / total 0 (0%)
                        Uploads Verified: succeeded 2 / total 2 (100%)
                  Job Artifacts Verified: succeeded 0 / total 0 (0%)
                Ci Secure Files Verified: succeeded 0 / total 0 (0%)
         Dependency Proxy Blobs Verified: succeeded 0 / total 0 (0%)
     Dependency Proxy Manifests Verified: succeeded 0 / total 0 (0%)
      Project Wiki Repositories Verified: succeeded 2 / total 2 (100%)
 Design Management Repositories Verified: succeeded 1 / total 1 (100%)
           Project Repositories Verified: succeeded 2 / total 2 (100%)
Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Keelan Lang

Merge request reports

Loading