Skip to content

Commit ba1dfca

Browse files
authored
Add repo archiving policy to the GitHub process
Also covers adding and removal of associated Sonar projects.
1 parent 859ab57 commit ba1dfca

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

docs/guides/continuous_integration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ These tools are free to use for open source GitHub repositories.
3535

3636
### Maintainability and test coverage
3737

38-
Defra has a [SonarCloud](https://www.sonarsource.com/products/sonarcloud/) organisation, which should be used to perform static quality analysis checks on your code.
38+
Defra has a [SonarQube Cloud](https://www.sonarsource.com/products/sonarcloud/) organisation, which should be used to perform static quality analysis checks on your code.
3939
It provides a rating for the security, reliability and maintainability of your code and estimates the time it would take to deal with any technical debt.
4040

41-
You should include SonarCloud in your CI so that it flags problems it spots in your code, like duplication or complexity.
41+
You should include SonarQube Cloud in your CI so that it flags problems it spots in your code, like duplication or complexity.
4242

43-
You can also configure your build tool (like GitHub Actions) to report unit test coverage to SonarCloud.
44-
SonarCloud will then include your test coverage in its assessment of your code.
43+
You can also configure your build tool (like GitHub Actions) to report unit test coverage to SonarQube Cloud.
44+
It will then include your test coverage in its assessment of your code.
4545

46-
SonarCloud is free to use for open source GitHub repositories.
46+
SonarQube Cloud is free to use for open source GitHub repositories.
4747

4848
## CI with Jenkins
4949

docs/processes/github_access.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You're not required to set a profile picture, but changing it from the default G
1818
All projects at Defra must be created under one of the organisations within the Defra GitHub enterprise:
1919

2020
- [Defra](https://github.com/DEFRA) for development of digital services
21-
- [Defra Data Science Centre of Excellence](https://github.com/-Defra-Data-Science-Centre-of-Excellence) for data science
21+
- [Defra Data Science Centre of Excellence](https://github.com/Defra-Data-Science-Centre-of-Excellence) for data science
2222
- [Defra design team](https://github.com/defra-design) for prototype designs
2323
- [aphascience](https://github.com/aphascience) for scientific projects at APHA
2424

@@ -42,6 +42,18 @@ You should contact the organisation owners to create a new repository. They'll n
4242

4343
**Do not create repositories under your own user account!** Though repositories can be transferred at a later date, it is easier for everyone if they originate within our organisations.
4444

45+
## Analysing a repository with SonarQube Cloud
46+
47+
If your repository is in the Defra GitHub organisation, we have a SonarQube Cloud organisation that can be used to perform static analysis on your code.
48+
49+
You should put this in place, to ensure that you comply with [our standard for code quality checks](../standards/common_coding_standards.md/#all-code-is-checked-for-quality).
50+
51+
To request this, you can contact the organisation owners:
52+
53+
- use the #sonar-support channel on the Defra Digital Slack workspace
54+
55+
You will need to [sign in to SonarQube Cloud](https://sonarcloud.io/login) with your GitHub account before you can be added to the Defra SonarQube Cloud organisation.
56+
4557
## Administering a repository
4658

4759
If you are the administrator for a repository it's your responsibility to ensure the repo has been set up and maintained in accordance with the standards of the organisation.
@@ -52,8 +64,18 @@ However you choose to manage it, you must always ensure that your repository's *
5264

5365
If you will no longer be the administrator for a repository, you will need to identify a replacement and make them the administrator.
5466

67+
## Archiving repositories
68+
69+
When a repository that you administer is no longer being maintained, you should request that it be archived. This can be done by contacting the relevant organisation owners.
70+
71+
We typically archive repositories rather than deleting them, as the code they contain may still be of value.
72+
5573
Repositories without an administrator will be archived by the organisation owners.
5674

75+
Repositories that have been inactive for 24 months or more will be archived by the organisation owners.
76+
77+
If an archived repository has an associated SonarQube Cloud project then that will be deleted by the organisation owners. Projects will also be deleted if they haven't been analysed for 24 months or more.
78+
5779
## Access removal
5880

5981
Each month, the administrators of our Defra GitHub enterprise will run a report to identify any [dormant users](https://docs.github.com/en/enterprise-cloud@latest/admin/managing-accounts-and-repositories/managing-users-in-your-enterprise/managing-dormant-users) who have not been active for six months and provide the list to each of the organisation owners in the enterprise.

docs/standards/common_coding_standards.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The path to reuse starts with module/namespacing. When the need for reuse is con
8787

8888
All repos are connected to a quality analysis tool and the tool's maximum quality rating is maintained.
8989

90-
All repos on GitHub and Azure Repos are connected to our SonarCloud organisation and the Defra standard quality gate is met.
90+
All repos on GitHub and Azure Repos are connected to our SonarQube Cloud organisation and the Defra standard quality gate is met.
9191

9292
### All code is checked for security
9393

@@ -115,4 +115,4 @@ Amended to add standard on code licencing in April 2025.
115115

116116
## Significant changes
117117

118-
SonarCloud was adopted as our standard quality analysis tool on 1 April 2020.
118+
SonarCloud (now known as SonarQube Cloud) was adopted as our standard quality analysis tool on 1 April 2020.

0 commit comments

Comments
 (0)