You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/safe-haven-services/code-management-mirroring-service.md
+56-4Lines changed: 56 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,32 +32,84 @@ Access must be requested from your Research Coordinator (RC). On being granted a
32
32
- Gitea URL
33
33
- Username
34
34
- Initial Password
35
+
- Whether egress mirroring is enabled
35
36
36
37
Gitea can be accessed from your VM desktop by opening a Web Browser and navigating to the provided URL. After logging in for the first time, you will be prompted to change your password.
37
38
38
39
Once logged-in, you will be presented with a dashboard showing recent activity in your organization. In Gitea, an "organization" is analagous to a project group, and you will be automatically granted access to the organization matching your TRE project identifier.
39
40
40
41
## Request a Repository
41
42
42
-
To request the creation of a repository in your organization, contact your RC and let them know the desired name. Multiple repositories may be created under each organization.
43
+
To request the creation of a repository in your organization, contact your RC and let them know the desired name and external mirror repository, if applicable. The external repository must be empty, as any existing content will be overwritten by the mirroring process.
43
44
44
45
Once created, your repository will be visible from your Gitea dashboard or under the "Explore" tab.
45
46
46
47
!!! note "Repository Permissions"
47
48
All members of an organization (TRE project) have full read/write access to each of its repositories, regardless of who requested its creation. This is the intended behaviour and will not be changed e.g., to restrict repository access to a subset of a TRE project's members. This is equivalent to the files in each `/safe_data/<project_id>` directory being accessible to all project members.
48
49
50
+
Multiple repositories may be created under each organization.
51
+
49
52
## Clone a Repository
50
53
51
54
SSH access is not enabled, so HTTPS must be used to clone repositories.
52
55
53
-
When running `git clone`, `git fetch`, and `git push`, you will be prompted for your Gitea username and password each time. For convenience, you may wish to generate an access token to avoid re-entering your credentials on each operation. To do this:
56
+
When running `git clone`, `git pull`, and `git push`, you will be prompted for your Gitea username and password each time. For convenience, you may wish to generate an access token to avoid re-entering your credentials after the initial clone. To do this:
54
57
55
-
1.Click your profile picture in the top right and then on Settings
56
-
1. Click Applications in the sidebar
58
+
1.In Gitea, click your profile picture in the top right and then on "Settings"
59
+
1. Click "Applications" in the sidebar
57
60
1. Create a new token
58
61
1. Enter a descriptive name
59
62
1. Expand "Select permissions" and change "repository" to "Read and Write"
63
+
1. Copy the generated token
60
64
1. Clone the repo using the token, for example `git clone https://<token>@<url>/<organization>/<repo>.git`
65
+
1. Note that in the test environment you will have to use "http" instead of "https"
66
+
67
+
## Request Code Egress
68
+
69
+
Egress mirroring is achieved through merging of code into a branch named `egress-mirror`. This is pre-created and will contain the same initial commit as the `main` branch.
70
+
71
+
If enabled, you may submit Pull Requests (PRs) for code to be mirrored to a repository external to the TRE:
72
+
73
+
1. From the repository page in Gitea, click "Pull Request"
74
+
1. Click "New Pull Request"
75
+
1. Click "merge into" and select the "egress-mirror" branch. This should cause the page to refresh and show the changes that will be requested
76
+
1. Click "New Pull Request"
77
+
1. Create the PR
78
+
1. Provide a descriptive title
79
+
1. Describe the changes that are being made, and any notes for reviewers
80
+
1. Click the cog next to "Reviewers" in the right sidebar and select the RCs group for your project (`<project-id>/RCs`)
81
+
1. Click "Create Pull Request"
82
+
1. External email notifications are not enabled, so contact your RC via normal channels to make them aware of the PR
83
+
84
+
By default, PRs require approval from 2 RCs. Once approved and merged, the code changes will be automatically mirrored to the external repository.
85
+
86
+
!!! note "Squashed Commits"
87
+
By default, all commits in a PR are "squashed" into a single commit on the mirror branch. This is to help ensure that any intermediate history containing potentially unwanted changes are not accidentally mirrored to the external repository.
88
+
89
+
### Branching Workflow
90
+
91
+
It is permitted for other branches and PRs to be created, to support standard software development practices. We suggest the following branching workflow, which uses feature branches and a periodic merge of main into the mirror branch.
92
+
93
+
```mermaid
94
+
---
95
+
config:
96
+
gitGraph:
97
+
mainBranchOrder: 1
98
+
---
99
+
gitGraph title Git Branch Workflow for Egress Mirroring
0 commit comments