Show correct alert when project's group is archived

What does this MR do and why?

Replace direct archived? checks with self_or_ancestors_archived? method across work item, issue, and merge request serializers to properly handle cases where projects belong to archived groups. This ensures consistent behavior when determining if a resource should be treated as archived based on its project or parent group status.

References

#551342 (closed)

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Enable the feature flag in Rails console: Feature.enable(:archive_group).
  2. Create a new group, then a new project under it and then a new issue and an MR under it.
  3. Then go the group settings -> Advanced -> Archive.
  4. The correct alter should be present as shown above on the issue and the MR page.
  5. Go to the master branch, and you'll see the old wrong alert as shown in the Before screenshot above.
  6. Also, run the following in https://gdk.test:3000/-/graphql-explorer and archived should be true:
{
  group(fullPath: "<archived-group-path>") {
    workItems(first: 1) {
      nodes {
        archived
      }
    }
  }
}

Output:

{
  "data": {
    "group": {
      "workItems": {
        "nodes": [
          {
            "archived": true
          }
        ]
      }
    }
  },
  "correlationId": "01K2ES7B7K0XEG9TSNCX15HW8A"
}

MR acceptance checklist

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

Related to #551342 (closed)

Merge request reports

Loading