From b7c0b4eeb8952f102571c9de1b80a27833279c9b Mon Sep 17 00:00:00 2001 From: Jorge Braz Date: Tue, 7 Jul 2026 11:03:49 +0100 Subject: [PATCH 1/3] docs: document automatic cleanup on GitHub repository transfer TAROT-3749 GitHub only notifies the destination organization when a repository is transferred, so Codacy previously had no way to detect and remove it from the original organization. Document the new automatic cleanup behavior and its requirements (both orgs added to Codacy), including the common "archive org" use case. Co-Authored-By: Claude Sonnet 5 --- ...moved-my-repository-on-the-git-provider.md | 7 +++++- docs/organizations/managing-repositories.md | 22 ++++++++++++++++++- docs/organizations/what-are-organizations.md | 19 +++++++++------- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/docs/faq/repositories/i-moved-my-repository-on-the-git-provider.md b/docs/faq/repositories/i-moved-my-repository-on-the-git-provider.md index 201c2941f8..cdaa1d7577 100644 --- a/docs/faq/repositories/i-moved-my-repository-on-the-git-provider.md +++ b/docs/faq/repositories/i-moved-my-repository-on-the-git-provider.md @@ -1,6 +1,11 @@ # I moved my repository on the Git provider -Currently, Codacy doesn't automatically detect moves of repositories between two organizations. +If you moved a repository between organizations on **GitHub** (Cloud or Enterprise Cloud), and both the original and destination organizations are added to Codacy, Codacy automatically removes the repository from the original organization. See [Transferring a repository to another organization](../../organizations/managing-repositories.md#transferring-repository) for details. + +!!! note + Codacy only removes the repository from the original organization — it doesn't automatically add it to the destination organization. To keep analyzing the repository after the transfer, add it to the destination organization on Codacy yourself. + +For GitLab and Bitbucket, or if the original organization isn't added to Codacy, Codacy doesn't automatically detect moves of repositories between two organizations. To ensure that Codacy continues to analyze a repository that was moved to another organization on your Git provider: diff --git a/docs/organizations/managing-repositories.md b/docs/organizations/managing-repositories.md index 42b943a7e7..43b6175508 100644 --- a/docs/organizations/managing-repositories.md +++ b/docs/organizations/managing-repositories.md @@ -68,7 +68,26 @@ To follow or unfollow repositories on Codacy: You automatically **start following** a repository as soon as you access any page from that repository. For example, when you access the repository using a direct link on your Git provider UI. Conversely, you automatically **stop following** a repository as soon as you try accessing any page from that repository but you don't have permissions to see that repository anymore. - + +## Transferring a repository to another organization {: id="transferring-repository"} + +On GitHub, when you transfer a repository to a different organization, GitHub only notifies the **destination** organization about the transfer — the original organization doesn't receive any notification. Because of this, Codacy needs some information from both organizations to keep track of the repository. + +Codacy automatically removes the repository from its original organization when both of the following organizations are added to Codacy: + +- The **original** organization that the repository is being transferred from. +- The **destination** organization that the repository is being transferred to. + +!!! note + The destination organization doesn't need a paid plan or any repositories added to Codacy — simply [adding the organization to Codacy](what-are-organizations.md#adding-an-organization) so that the Codacy GitHub App is installed is enough for Codacy to detect the transfer. + + This is commonly used to set up a dedicated "archive" organization on GitHub, to which repositories are transferred when they're decommissioned, so that Codacy automatically cleans them up from their original organization. + + Codacy only removes the repository from its original organization — it doesn't automatically add it to the destination organization on Codacy. If you want to keep analyzing the repository after the transfer, you still need to add it to the destination organization on Codacy yourself. + +!!! important + This is currently supported for **GitHub Cloud** and **GitHub Enterprise Cloud** only. For GitLab and Bitbucket, or if the original organization isn't added to Codacy, [remove the repository manually](../faq/repositories/i-moved-my-repository-on-the-git-provider.md). + ## Finding your repositories with Segments {: id="provider-segments"} Codacy allows you to utilise [**Segments**](../segments) to categorize and filter repositories more effectively within the Codacy platform. @@ -84,3 +103,4 @@ Codacy allows you to utilise [**Segments**](../segments) to categorize and filte ## See also - [How to setup Segments?](../segments) - [Which metrics does Codacy calculate?](../faq/code-analysis/which-metrics-does-codacy-calculate.md) +- [How does Codacy support GitHub Enterprise?](../faq/general/how-does-codacy-support-github-enterprise.md) diff --git a/docs/organizations/what-are-organizations.md b/docs/organizations/what-are-organizations.md index d2de34d645..8c6931d2b2 100644 --- a/docs/organizations/what-are-organizations.md +++ b/docs/organizations/what-are-organizations.md @@ -31,14 +31,17 @@ If you update your organization or repository information on your Git provider, !!! note If an update to your organization name isn't automatically reflected on Codacy, navigate to the organization **Settings** page, tab **Profile**, and click the **Synchronize** button. -| Git provider | Rename repository | Change repository visibility | Delete repository | Rename organization or group | Remove member from organization or group | Delete organization or group | -|---|---|---|---|---|---|---| -| GitHub Cloud | Yes | Yes | Yes | Yes | Yes | Yes | -| GitHub Enterprise | Yes | Yes | Yes | Yes | Yes | Yes | -| GitLab Cloud | No | No | No | No | No | No | -| GitLab Enterprise | Yes | Yes | Yes | Yes | Yes | Yes | -| Bitbucket Cloud | Yes | Yes | No | No | No | No | -| Bitbucket Server | Yes | Yes | No | No | No | No | +| Git provider | Rename repository | Change repository visibility | Delete repository | Rename organization or group | Remove member from organization or group | Delete organization or group | Transfer repository to a different organization | +|---|---|---|---|---|---|---|---| +| GitHub Cloud | Yes | Yes | Yes | Yes | Yes | Yes | Yes* | +| GitHub Enterprise | Yes | Yes | Yes | Yes | Yes | Yes | Yes* | +| GitLab Cloud | No | No | No | No | No | No | No | +| GitLab Enterprise | Yes | Yes | Yes | Yes | Yes | Yes | No | +| Bitbucket Cloud | Yes | Yes | No | No | No | No | No | +| Bitbucket Server | Yes | Yes | No | No | No | No | No | + +!!! note + \* Only when both the original and destination organizations are added to Codacy. See [Transferring a repository to another organization](managing-repositories.md#transferring-repository). Se also the [roles and permission mapping from the Git providers](roles-and-permissions-for-organizations.md). From bf8195938a8e1178ecc7f590b385c67485f1e9f2 Mon Sep 17 00:00:00 2001 From: Jorge Braz Date: Tue, 7 Jul 2026 11:14:26 +0100 Subject: [PATCH 2/3] docs: remove the moved-repository FAQ page TAROT-3749 The manual GitLab/Bitbucket workaround it described doesn't belong on this page. Point the nav entry, old redirects, and the remaining cross-link to the existing removing-your-repository doc instead. Co-Authored-By: Claude Sonnet 5 --- .../i-moved-my-repository-on-the-git-provider.md | 15 --------------- docs/organizations/managing-repositories.md | 2 +- mkdocs.yml | 5 ++--- 3 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 docs/faq/repositories/i-moved-my-repository-on-the-git-provider.md diff --git a/docs/faq/repositories/i-moved-my-repository-on-the-git-provider.md b/docs/faq/repositories/i-moved-my-repository-on-the-git-provider.md deleted file mode 100644 index cdaa1d7577..0000000000 --- a/docs/faq/repositories/i-moved-my-repository-on-the-git-provider.md +++ /dev/null @@ -1,15 +0,0 @@ -# I moved my repository on the Git provider - -If you moved a repository between organizations on **GitHub** (Cloud or Enterprise Cloud), and both the original and destination organizations are added to Codacy, Codacy automatically removes the repository from the original organization. See [Transferring a repository to another organization](../../organizations/managing-repositories.md#transferring-repository) for details. - -!!! note - Codacy only removes the repository from the original organization — it doesn't automatically add it to the destination organization. To keep analyzing the repository after the transfer, add it to the destination organization on Codacy yourself. - -For GitLab and Bitbucket, or if the original organization isn't added to Codacy, Codacy doesn't automatically detect moves of repositories between two organizations. - -To ensure that Codacy continues to analyze a repository that was moved to another organization on your Git provider: - -1. Delete the repository from the original organization on Codacy, taking note of the settings for this repository -1. Add the repository to the new organization on Codacy and reconfigure the repository with the same settings as the original one - -If you can't find your repository in the original Codacy organization or if you need more help with this process, please contact us at . diff --git a/docs/organizations/managing-repositories.md b/docs/organizations/managing-repositories.md index 43b6175508..a3722b8506 100644 --- a/docs/organizations/managing-repositories.md +++ b/docs/organizations/managing-repositories.md @@ -86,7 +86,7 @@ Codacy automatically removes the repository from its original organization when Codacy only removes the repository from its original organization — it doesn't automatically add it to the destination organization on Codacy. If you want to keep analyzing the repository after the transfer, you still need to add it to the destination organization on Codacy yourself. !!! important - This is currently supported for **GitHub Cloud** and **GitHub Enterprise Cloud** only. For GitLab and Bitbucket, or if the original organization isn't added to Codacy, [remove the repository manually](../faq/repositories/i-moved-my-repository-on-the-git-provider.md). + This is currently supported for **GitHub Cloud** and **GitHub Enterprise Cloud** only. For GitLab and Bitbucket, or if the original organization isn't added to Codacy, [remove the repository manually](../repositories-configure/removing-your-repository.md). ## Finding your repositories with Segments {: id="provider-segments"} diff --git a/mkdocs.yml b/mkdocs.yml index 736489c3b7..e3abebfcaa 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -321,8 +321,8 @@ plugins: "hc/en-us/articles/360012973060-How-does-Codacy-support-Bitbucket-Cloud-.md": "faq/general/how-does-codacy-support-bitbucket-cloud.md" "hc/en-us/articles/360013142699.md": "repositories-configure/local-analysis/client-side-tools.md" "hc/en-us/articles/360013142699-Client-side-tools.md": "repositories-configure/local-analysis/client-side-tools.md" - "hc/en-us/articles/360013560819.md": "faq/repositories/i-moved-my-repository-on-the-git-provider.md" - "hc/en-us/articles/360013560819-I-moved-my-repository-on-the-Git-provider.md": "faq/repositories/i-moved-my-repository-on-the-git-provider.md" + "hc/en-us/articles/360013560819.md": "organizations/managing-repositories.md" + "hc/en-us/articles/360013560819-I-moved-my-repository-on-the-Git-provider.md": "organizations/managing-repositories.md" "hc/en-us/articles/360013926899.md": "faq/troubleshooting/why-arent-duplication-metrics-being-calculated.md" "hc/en-us/articles/360013926899-Why-aren-t-duplication-metrics-being-calculated-.md": "faq/troubleshooting/why-arent-duplication-metrics-being-calculated.md" "hc/en-us/articles/360015300100.md": "faq/general/how-does-codacy-support-gitlab-enterprise.md" @@ -669,7 +669,6 @@ nav: - Repositories: - faq/repositories/how-do-i-reanalyze-my-repository.md - faq/repositories/i-renamed-my-repository-on-the-git-provider.md - - faq/repositories/i-moved-my-repository-on-the-git-provider.md - Code analysis: - faq/code-analysis/which-metrics-does-codacy-calculate.md - faq/code-analysis/why-does-codacy-show-unexpected-coverage-changes.md From 04d19baf84e99bbec878dd4196668d2c71cbd4e8 Mon Sep 17 00:00:00 2001 From: Jorge Braz Date: Tue, 7 Jul 2026 11:25:35 +0100 Subject: [PATCH 3/3] docs: address review feedback on repo transfer cleanup docs TAROT-3749 The automatic cleanup actually fails to trigger when the destination organization isn't added to Codacy (that's what installs the app and lets the transfer webhook reach Codacy), not the original one, which is already guaranteed to exist since the repository is tracked there. Also fix the "GitHub Enterprise" row in the provider table: it refers to GitHub Enterprise Server, which is Codacy Self-hosted only and can't reach the Cloud-only transfer webhook handler, so it should read "No" rather than "Yes*". Fixes a pre-existing "Se also" typo nearby. Co-Authored-By: Claude Sonnet 5 --- docs/organizations/managing-repositories.md | 6 +++--- docs/organizations/what-are-organizations.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/organizations/managing-repositories.md b/docs/organizations/managing-repositories.md index a3722b8506..9ab047c3e7 100644 --- a/docs/organizations/managing-repositories.md +++ b/docs/organizations/managing-repositories.md @@ -75,8 +75,8 @@ On GitHub, when you transfer a repository to a different organization, GitHub on Codacy automatically removes the repository from its original organization when both of the following organizations are added to Codacy: -- The **original** organization that the repository is being transferred from. -- The **destination** organization that the repository is being transferred to. +- The **original** organization that the repository is being transferred from. Since the repository is already tracked on Codacy under this organization, this is normally already the case. +- The **destination** organization that the repository is being transferred to. This is usually the step you need to take: adding the destination organization to Codacy is what installs the Codacy GitHub App there, allowing Codacy to receive the transfer notification. !!! note The destination organization doesn't need a paid plan or any repositories added to Codacy — simply [adding the organization to Codacy](what-are-organizations.md#adding-an-organization) so that the Codacy GitHub App is installed is enough for Codacy to detect the transfer. @@ -86,7 +86,7 @@ Codacy automatically removes the repository from its original organization when Codacy only removes the repository from its original organization — it doesn't automatically add it to the destination organization on Codacy. If you want to keep analyzing the repository after the transfer, you still need to add it to the destination organization on Codacy yourself. !!! important - This is currently supported for **GitHub Cloud** and **GitHub Enterprise Cloud** only. For GitLab and Bitbucket, or if the original organization isn't added to Codacy, [remove the repository manually](../repositories-configure/removing-your-repository.md). + This is currently supported for **GitHub Cloud** and **GitHub Enterprise Cloud** only. For GitLab and Bitbucket, or if the destination organization isn't added to Codacy, [remove the repository manually](../repositories-configure/removing-your-repository.md). ## Finding your repositories with Segments {: id="provider-segments"} diff --git a/docs/organizations/what-are-organizations.md b/docs/organizations/what-are-organizations.md index 8c6931d2b2..28b2f2aa87 100644 --- a/docs/organizations/what-are-organizations.md +++ b/docs/organizations/what-are-organizations.md @@ -34,16 +34,16 @@ If you update your organization or repository information on your Git provider, | Git provider | Rename repository | Change repository visibility | Delete repository | Rename organization or group | Remove member from organization or group | Delete organization or group | Transfer repository to a different organization | |---|---|---|---|---|---|---|---| | GitHub Cloud | Yes | Yes | Yes | Yes | Yes | Yes | Yes* | -| GitHub Enterprise | Yes | Yes | Yes | Yes | Yes | Yes | Yes* | +| GitHub Enterprise | Yes | Yes | Yes | Yes | Yes | Yes | No | | GitLab Cloud | No | No | No | No | No | No | No | | GitLab Enterprise | Yes | Yes | Yes | Yes | Yes | Yes | No | | Bitbucket Cloud | Yes | Yes | No | No | No | No | No | | Bitbucket Server | Yes | Yes | No | No | No | No | No | !!! note - \* Only when both the original and destination organizations are added to Codacy. See [Transferring a repository to another organization](managing-repositories.md#transferring-repository). + \* Only for GitHub Cloud, including organizations added through GitHub Enterprise Cloud, and only when both the original and destination organizations are added to Codacy. See [Transferring a repository to another organization](managing-repositories.md#transferring-repository). -Se also the [roles and permission mapping from the Git providers](roles-and-permissions-for-organizations.md). +See also the [roles and permission mapping from the Git providers](roles-and-permissions-for-organizations.md). ## Deleting an organization