Ignore issues/MRs when the project is archived
In gitlab-org/quality/triage-ops!213 (closed), we performed a mass-migration of team labels to stage/group labels for the whole https://gitlab.com/gitlab-org group.
In doing that, some issues (e.g. gitlab-org/gitlab-ci-yml#83 (closed)) weren't updated because their project is archived (e.g. https://gitlab.com/gitlab-org/gitlab-ci-yml). The issue itself isn't locked according to the API:
{
"id": 14415577,
"iid": 83,
"project_id": 1209837,
"title": "--version flag - Auto-DevOps.gitlab-ci.yml",
"description": "https://gitlab.com/gitlab-org/gitlab-ci-yml/blame/master/Auto-DevOps.gitlab-ci.yml#L608\n\nAny idea why `--version` flag is used here ? @nolith @mayra\\-cabrera @DylanGriffith ?\n\nThe auto-deploy-app chart wouldn't have this version `\"$CI_PIPELINE_ID-$CI_JOB_ID\"`\n\n```\nhelm help upgrade\n\nFlags:\n--version string specify the exact chart version to use. If this is not specified, the latest version is used\n```",
"state": "closed",
"created_at": "2018-09-24T04:39:38.341Z",
"updated_at": "2018-09-24T11:48:01.716Z",
"closed_at": "2018-09-24T11:22:16.116Z",
"closed_by": {
"id": 120073,
"name": "Dylan Griffith",
"username": "DylanGriffith",
"state": "active",
"avatar_url": "https://assets.gitlab-static.net/uploads/-/system/user/avatar/120073/avatar.png",
"web_url": "https://gitlab.com/DylanGriffith"
},
"labels": [
"Configure",
"auto devops"
],
"milestone": {
"id": 567670,
"iid": 19,
"group_id": 9970,
"title": "11.4",
"description": "",
"state": "closed",
"created_at": "2018-06-14T17:31:41.249Z",
"updated_at": "2018-12-20T06:49:55.749Z",
"due_date": "2018-10-22",
"start_date": "2018-09-08",
"web_url": "https://gitlab.com/groups/gitlab-org/-/milestones/19"
},
"assignees": [
{
"id": 2535118,
"name": "Thong Kuah",
"username": "tkuah",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/f7b51bdd49a4914d29504d7ff4c3f7b9?s=80&d=identicon",
"web_url": "https://gitlab.com/tkuah"
}
],
"author": {
"id": 2535118,
"name": "Thong Kuah",
"username": "tkuah",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/f7b51bdd49a4914d29504d7ff4c3f7b9?s=80&d=identicon",
"web_url": "https://gitlab.com/tkuah"
},
"assignee": {
"id": 2535118,
"name": "Thong Kuah",
"username": "tkuah",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/f7b51bdd49a4914d29504d7ff4c3f7b9?s=80&d=identicon",
"web_url": "https://gitlab.com/tkuah"
},
"user_notes_count": 6,
"merge_requests_count": 1,
"upvotes": 0,
"downvotes": 0,
"due_date": null,
"confidential": false,
"discussion_locked": null,
"web_url": "https://gitlab.com/gitlab-org/gitlab-ci-yml/issues/83",
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": null,
"human_total_time_spent": null
},
"task_completion_status": {
"count": 0,
"completed_count": 0
},
"has_tasks": false,
"_links": {
"self": "https://gitlab.com/api/v4/projects/1209837/issues/83",
"notes": "https://gitlab.com/api/v4/projects/1209837/issues/83/notes",
"award_emoji": "https://gitlab.com/api/v4/projects/1209837/issues/83/award_emoji",
"project": "https://gitlab.com/api/v4/projects/1209837"
},
"subscribed": false,
"weight": null
}
but the project is archived:
{
"id": 1209837,
"description": "This project has been deprecated and the templates have been moved to https://gitlab.com/gitlab-org/gitlab-ce/tree/master/lib/gitlab/ci/templates",
"name": "GitLab CI Yml - Deprecated",
"name_with_namespace": "GitLab.org / GitLab CI Yml - Deprecated",
"path": "gitlab-ci-yml",
"path_with_namespace": "gitlab-org/gitlab-ci-yml",
"created_at": "2016-05-20T21:02:35.623Z",
"default_branch": "master",
"tag_list": [],
"ssh_url_to_repo": "git@gitlab.com:gitlab-org/gitlab-ci-yml.git",
"http_url_to_repo": "https://gitlab.com/gitlab-org/gitlab-ci-yml.git",
"web_url": "https://gitlab.com/gitlab-org/gitlab-ci-yml",
"readme_url": "https://gitlab.com/gitlab-org/gitlab-ci-yml/blob/master/README.md",
"avatar_url": "https://gitlab.com/gitlab-org/gitlab-ci-yml/-/avatar",
"star_count": 422,
"forks_count": 142,
"last_activity_at": "2019-04-12T13:35:14.415Z",
"namespace": {
"id": 9970,
"name": "GitLab.org",
"path": "gitlab-org",
"kind": "group",
"full_path": "gitlab-org",
"parent_id": null,
"avatar_url": "/uploads/-/system/group/avatar/9970/logo-extra-whitespace.png",
"web_url": "https://gitlab.com/groups/gitlab-org"
},
"_links": {
"self": "https://gitlab.com/api/v4/projects/1209837",
"issues": "https://gitlab.com/api/v4/projects/1209837/issues",
"merge_requests": "https://gitlab.com/api/v4/projects/1209837/merge_requests",
"repo_branches": "https://gitlab.com/api/v4/projects/1209837/repository/branches",
"labels": "https://gitlab.com/api/v4/projects/1209837/labels",
"events": "https://gitlab.com/api/v4/projects/1209837/events",
"members": "https://gitlab.com/api/v4/projects/1209837/members"
},
"empty_repo": false,
"archived": true,
"visibility": "public",
"resolve_outdated_diff_discussions": null,
"container_registry_enabled": false,
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": false,
"jobs_enabled": true,
"snippets_enabled": false,
"issues_access_level": "enabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"wiki_access_level": "disabled",
"builds_access_level": "enabled",
"snippets_access_level": "disabled",
"shared_runners_enabled": true,
"lfs_enabled": true,
"creator_id": 87854,
"import_status": "none",
"import_error": null,
"open_issues_count": 24,
"runners_token": "94fjny8tfudP7no8F8i-",
"ci_default_git_depth": null,
"public_jobs": true,
"build_git_strategy": "fetch",
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"build_coverage_regex": "Coverage:\\s(\\d+)",
"ci_config_path": "",
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"request_access_enabled": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"printing_merge_request_link_enabled": true,
"merge_method": "merge",
"auto_devops_enabled": false,
"auto_devops_deploy_strategy": "continuous",
"permissions": {
"project_access": null,
"group_access": null
},
"repository_storage": "nfs-file04",
"approvals_before_merge": 0,
"mirror": false,
"external_authorization_classification_label": "",
"packages_enabled": null
}
gitlab-triage
should probably ignore those resources when their project is archived.
Edited by Rémy Coutable