From cb0af76cade2866a5ae0a4c0a22d4c1676cb2f45 Mon Sep 17 00:00:00 2001 From: sanjeevz3009 Date: Sat, 24 Jan 2026 19:12:28 +0000 Subject: [PATCH 1/6] Add CODEOWNERS file and update copier.yml for code owner configuration --- .github/CODEOWNERS | 1 + copier.yml | 5 +++++ project_template/.github/CODEOWNERS | 1 + 3 files changed, 7 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 project_template/.github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..cf381f8 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @ONSdigital diff --git a/copier.yml b/copier.yml index 84b9ba5..4825274 100644 --- a/copier.yml +++ b/copier.yml @@ -54,6 +54,11 @@ repository_owner: help: "What is your repository owner? (e.g. your GitHub username)" default: "ONSdigital" +code_owner: + type: str + help: "What is your CODEOWNERS default? (e.g. @org/team or @username)" + default: "@{{ repository_owner }}" + repository_visibility: type: str help: "What is your repository visibility?" diff --git a/project_template/.github/CODEOWNERS b/project_template/.github/CODEOWNERS new file mode 100644 index 0000000..9f13ad5 --- /dev/null +++ b/project_template/.github/CODEOWNERS @@ -0,0 +1 @@ +* {{ code_owner }} From 76ec8ac869e84ba5a47b451b38cb145b690d4675 Mon Sep 17 00:00:00 2001 From: sanjeevz3009 Date: Sat, 24 Jan 2026 19:30:05 +0000 Subject: [PATCH 2/6] Recreate CODEOWNERS file from template with proper formatting --- project_template/.github/CODEOWNERS | 1 - project_template/.github/CODEOWNERS.jinja | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) delete mode 100644 project_template/.github/CODEOWNERS create mode 100644 project_template/.github/CODEOWNERS.jinja diff --git a/project_template/.github/CODEOWNERS b/project_template/.github/CODEOWNERS deleted file mode 100644 index 9f13ad5..0000000 --- a/project_template/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* {{ code_owner }} diff --git a/project_template/.github/CODEOWNERS.jinja b/project_template/.github/CODEOWNERS.jinja new file mode 100644 index 0000000..2af9897 --- /dev/null +++ b/project_template/.github/CODEOWNERS.jinja @@ -0,0 +1,3 @@ +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners + +* {{ code_owner }} From bdce022b9bce25fb17ab97d554226b50a4ebc821 Mon Sep 17 00:00:00 2001 From: sanjeevz3009 Date: Sat, 24 Jan 2026 19:56:04 +0000 Subject: [PATCH 3/6] Add documentation link to CODEOWNERS file --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index cf381f8..8e6722b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,3 @@ +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners + * @ONSdigital From 5afea50a7bc611bd2a2aca5ff879bc6e08d9d211 Mon Sep 17 00:00:00 2001 From: sanjeevz3009 Date: Sat, 24 Jan 2026 20:39:49 +0000 Subject: [PATCH 4/6] Update CODEOWNERS to specify the correct GitHub team --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8e6722b..76aaccb 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,3 @@ # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners -* @ONSdigital +* @ONSdigital/ons-python-template From 678e5a49d68b8be69971571e7f319a687796f690 Mon Sep 17 00:00:00 2001 From: sanjeevz3009 Date: Tue, 27 Jan 2026 17:45:36 +0000 Subject: [PATCH 5/6] Add validation for code owners input --- copier.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/copier.yml b/copier.yml index 4825274..1033e0e 100644 --- a/copier.yml +++ b/copier.yml @@ -57,7 +57,10 @@ repository_owner: code_owner: type: str help: "What is your CODEOWNERS default? (e.g. @org/team or @username)" - default: "@{{ repository_owner }}" + validator: >- + {% if not code_owner.startswith('@') %} + CODEOWNERS must start with '@' (e.g. @username or @org/team) + {% endif %} repository_visibility: type: str From 9958d284ca078414628a3527760b1e472a9f309f Mon Sep 17 00:00:00 2001 From: sanjeevz3009 Date: Tue, 27 Jan 2026 19:48:25 +0000 Subject: [PATCH 6/6] Fix formatting of CODEOWNERS file URLs for consistency --- .github/CODEOWNERS | 2 +- project_template/.github/CODEOWNERS.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 76aaccb..edb8991 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,3 @@ -# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners * @ONSdigital/ons-python-template diff --git a/project_template/.github/CODEOWNERS.jinja b/project_template/.github/CODEOWNERS.jinja index 2af9897..79042f9 100644 --- a/project_template/.github/CODEOWNERS.jinja +++ b/project_template/.github/CODEOWNERS.jinja @@ -1,3 +1,3 @@ -# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners * {{ code_owner }}