|
| 1 | +# Using Linear at Sourcegraph (trial) |
| 2 | + |
| 3 | +<!-- |
| 4 | +TODOs post adoption: |
| 5 | +- Remove trial from doc title |
| 6 | +- Combine with 'working with issues' doc |
| 7 | +- Update guidance around label groups. |
| 8 | +- Update mentions of Eng Private team if we |
| 9 | + merge that with main Eng team. Maybe we still need |
| 10 | + a separate OSS team for OSS repos. |
| 11 | +--> |
| 12 | + |
| 13 | +This document describes recommended ways of using Linear |
| 14 | +during the trial period, without causing a disruption to |
| 15 | +team members who continue using GitHub |
| 16 | +and are not part of the trial. |
| 17 | + |
| 18 | +While the [Linear docs](https://linear.app/docs) are excellent, |
| 19 | +here is a very quick run down of the core mental model. |
| 20 | + |
| 21 | +- The workspace is divided into Teams. |
| 22 | + - Settings related to workflow (issue statuses, estimates, cycles), |
| 23 | + templates (for issues, projects etc.), syncing with external tools |
| 24 | + and so on are customizable per Team. |
| 25 | +- **Issues** are the smallest unit of work. |
| 26 | + - Issues can have sub-issues, be blocked by other issues etc. |
| 27 | + - An Issue belongs to a single Team: the issue identifier includes |
| 28 | + a short prefix based on the Team. (Example: ENG-123) |
| 29 | +- **Views** allow slicing/dicing Issues in flexible ways. |
| 30 | + - Views work both within Teams and across Teams. |
| 31 | +- **Projects** allow grouping issues into more coherent units. |
| 32 | + - A Project belongs to a single Team, but can contain issues |
| 33 | + that belong to other Teams. |
| 34 | + - Project can have Documents that allow inline comment threads |
| 35 | + similar to Google Docs. |
| 36 | +- **Roadmaps** allow grouping projects into larger units, |
| 37 | + and are owned at the workspace level. |
| 38 | + |
| 39 | +For more details, see the [conceptual model docs](https://linear.app/docs/conceptual-model). |
| 40 | + |
| 41 | +## Logging in |
| 42 | + |
| 43 | +Install the [Linear app](https://linear.app/download) or |
| 44 | +go to [our Linear workspace](https://linear.app/sourcegraph) |
| 45 | +and log in with SAML SSO. |
| 46 | + |
| 47 | +## Team structure |
| 48 | + |
| 49 | +For now, we will aim to use coarse-grained teams. |
| 50 | +To start out with, there are 5 teams: Eng PUBLIC, |
| 51 | +Eng Private, Product, Design and Implementation. |
| 52 | + |
| 53 | +Teammates in other parts of the company interested |
| 54 | +in testing out Linear should feel free to create new Teams. |
| 55 | + |
| 56 | +### Eng PUBLIC and Eng Private |
| 57 | + |
| 58 | +Eng PUBLIC has _full_ bidirectional syncing with `sourcegraph/sourcegraph`. |
| 59 | +This means that the following will be synced across, |
| 60 | +regardless of whether the change is made in Linear or GitHub: |
| 61 | + |
| 62 | +1. New issues being created. |
| 63 | +2. Changes to labels, issue title, issue description, |
| 64 | + new comments (for the "GitHub thread" in Linear), and |
| 65 | + open/close status. |
| 66 | + |
| 67 | +All other repositories have _partial_ bidirectional syncing, |
| 68 | +which means that out of (1) and (2) above, only (2) is enabled, |
| 69 | +i.e. new issues created in Linear will not be synced to GitHub. |
| 70 | +This applies to: |
| 71 | + |
| 72 | +- `sourcegraph/customer` - synced with Eng Private |
| 73 | +- `sourcegraph/cody` |
| 74 | +- `sourcegraph/src-cli` |
| 75 | +- `sourcegraph/scip`, `sourcegraph/scip-java` and other indexers |
| 76 | +- All other private repositories that have syncing turned on. |
| 77 | + The full list of repos with syncing can be found [here](https://linear.app/sourcegraph/settings/integrations/github). |
| 78 | + |
| 79 | +Both Eng PUBLIC and Eng Private are configured to use [2 week cycles](https://linear.app/docs/use-cycles) |
| 80 | +based on [RFC 916](https://docs.google.com/document/d/16mipKz0fc2Ki5NYXG8Rarb8b4KHh34t27P9Ao_m8e-o/edit). |
| 81 | + |
| 82 | +## Adding a new repository (for Engineering) |
| 83 | + |
| 84 | +You can ask for help in `#wg-linear-trial` with these steps as well. |
| 85 | + |
| 86 | +1. Add the repository to the [GitHub integration](https://linear.app/sourcegraph/settings/integrations/github). |
| 87 | + If you do not see repositories in the Sourcegraph GitHub org listed here, |
| 88 | + you may need to request the `sourcegraph - Owner` GitHub permission in Entitle. |
| 89 | + |
| 90 | + - For private repos, use the `Eng Private` team. |
| 91 | + - For public repos, use the `Eng PUBLIC` team. |
| 92 | + |
| 93 | + DO NOT enable the "Enable bidirectional sync" toggle; |
| 94 | + it only applies to _new issues_ created in Linear. |
| 95 | + Comments, label changes, title and description changes will |
| 96 | + still sync bidirectionally even if that toggle is disabled. |
| 97 | + See the [FAQ](#faq) for more details. |
| 98 | + |
| 99 | +2. Under [Import / Export](https://linear.app/sourcegraph/settings/import-export), |
| 100 | + add a GitHub repository. After clicking 'Connect to GitHub' there may |
| 101 | + be a delay of 10-15s before you see the options for selecting a repo. |
| 102 | + |
| 103 | + If you do not see repositories in the Sourcegraph GitHub org listed here, |
| 104 | + you may need to request the `sourcegraph - Owner` GitHub permission in Entitle. |
| 105 | + |
| 106 | + - If present, disable the toggle for importing data from organization level projects. |
| 107 | + - Enable the toggle for importing data from closed issues. |
| 108 | + - Select the team to import issues into: |
| 109 | + - For private repos, use the `Eng Private` team. |
| 110 | + - For public repos, use the `Eng PUBLIC` team. |
| 111 | + |
| 112 | + After importing is complete, you will have the option to configure it. |
| 113 | + Make sure all these checkboxes are checked: |
| 114 | + |
| 115 | + - Import N open issues |
| 116 | + - Import N stale issues to Archive |
| 117 | + - Import N closed or done issues to Archive |
| 118 | + - Sync issues after import |
| 119 | + |
| 120 | + So that syncing is maintained for old issues, and all issue history |
| 121 | + is available for search. |
| 122 | + |
| 123 | + After this step, select 'Import users' and make sure that: |
| 124 | + |
| 125 | + - If a person has 'Map to Existing' but no associated account on |
| 126 | + the right side, then change it to 'Do not create' |
| 127 | + - Replace any 'Create with email' with 'Do not create' |
| 128 | + |
| 129 | + Once you click next, confirm on the next page that: |
| 130 | + |
| 131 | + - The number of user invites is zero |
| 132 | + - The number of completed issues matches up with the closed |
| 133 | + issues in the repo's GitHub issue tracker. |
| 134 | + |
| 135 | +At the moment, all repos except for the monorepo use an extra issue label |
| 136 | +to allow filtering for views inside Linear. For example, the `scip-java` |
| 137 | +repo uses the `graph/scip-java` label. |
| 138 | +Here is an [example PR](https://github.com/sourcegraph/scip-java/pull/685/files) |
| 139 | +for auto-adding the label to new issues. |
| 140 | +For old issues, you can quickly add the label after importing into Linear. |
| 141 | + |
| 142 | +## Dos and Don'ts |
| 143 | + |
| 144 | +1. **Don't create new Teams for sub-teams in Engineering** |
| 145 | + (except for testing Linear features, that's OK). |
| 146 | + Instead, let's try to tweak existing settings or enable new ones |
| 147 | + which would be useful to all teams. |
| 148 | +2. **Do add other repositories of interest to Linear**. |
| 149 | + - Even for repos which only have PRs, if the PR descriptions |
| 150 | + use Linear identifiers such as `Fixes ENG-123`, |
| 151 | + then the corresponding issue will be auto-closed. |
| 152 | + - Caveat: Do not enable bidirectional syncing for other repos |
| 153 | + in Eng PUBLIC or Eng Private. |
| 154 | +3. If your team is on-board, **do connect your team's #discuss |
| 155 | + channel with Eng Private using Linear Asks** |
| 156 | + ([here](https://linear.app/sourcegraph/settings/asks)) |
| 157 | + to easily turn Slack threads into issues. ([docs](https://linear.app/docs/linear-asks)) |
| 158 | +4. **Avoid creating new label groups inside Linear** |
| 159 | + (creating new labels, is OK). - If you attempt to create a new label with `/` on-the-fly |
| 160 | + when editing an issue, Linear will create a label group |
| 161 | + instead of a "flat" label. |
| 162 | + |
| 163 | + For example, if you type `X/Y` for a new label, it will create |
| 164 | + a group `X` with a label `Y` in that group. Since `X` is the |
| 165 | + group name, the label synced to GitHub will be just `Y`. |
| 166 | + This may be confusing to someone seeing the issue on GitHub |
| 167 | + as the prefix is no longer available. |
| 168 | + |
| 169 | + - Label groups also have at-most-one semantics - you can't apply |
| 170 | + multiple labels from the same group to a single issue. |
| 171 | + - Alternative: you can create a label with `/` from the Team's settings |
| 172 | + ([example link](https://linear.app/sourcegraph/settings/teams/ENG/labels)). |
| 173 | + |
| 174 | +5. **Do explore the various Linear [features](https://linear.app/docs) |
| 175 | + and [integrations](https://linear.app/sourcegraph/settings/integrations)**. |
| 176 | + |
| 177 | +## FAQ |
| 178 | + |
| 179 | +### Why are Eng PUBLIC and Eng Private separate? |
| 180 | + |
| 181 | +The Eng Private team is present because of the following |
| 182 | +considerations: |
| 183 | + |
| 184 | +1. We have some private repositories on GitHub. |
| 185 | +2. We'd like to use bidirectional syncing for the trial |
| 186 | + period to avoid disrupting people not using Linear. |
| 187 | +3. To test out whether Linear can work well as a single |
| 188 | + pane of glass for issues, we need to sync issues from |
| 189 | + our private repos into Linear. |
| 190 | +4. The Linear -> GitHub sync direction uses the default |
| 191 | + repo set in the GitHub integration, instead of offering |
| 192 | + a repo picker. |
| 193 | +5. The default repo for Eng PUBLIC is sourcegraph/sourcegraph |
| 194 | + for ease of use. |
| 195 | + |
| 196 | +The above factors create the risk of an information leak |
| 197 | +if someone creates an issue in Linear with customer details. |
| 198 | + |
| 199 | +Eng Private also provides a natural place to create issues |
| 200 | +from Slack threads which may have customer details. |
| 201 | + |
| 202 | +### Why not create separate Linear Teams for each sub-team in Engineering? |
| 203 | + |
| 204 | +We initially considered doing this but decided against it |
| 205 | +for the following reasons: |
| 206 | + |
| 207 | +- It would create a proliferation of issue prefixes in identifiers, |
| 208 | + making it harder to identify the top-level team based on the identifier. |
| 209 | +- If there were any re-orgs in the future, having the issue identifiers |
| 210 | + change to reflect new team names would be a disorienting experience, |
| 211 | + especially for teammates outside Engineering. |
| 212 | +- For teammates outside Engineering, it would be valuable to reduce |
| 213 | + the number of potential places to file issues. |
| 214 | + |
| 215 | +However, if the flexibility provided by the current team structure |
| 216 | +is not enough, then we can consider creating smaller Teams in Linear |
| 217 | +at the end of the trial (around mid May). |
| 218 | + |
| 219 | +### Why don't we have full bidirectional syncing for all repos? |
| 220 | + |
| 221 | +This limitation is present because Linear doesn't offer a repo picker |
| 222 | +in the UI if bidirectional issue creation syncing is |
| 223 | +enabled for more than 1 repo. |
| 224 | + |
| 225 | +This means that even if we enabled |
| 226 | +bidirectional syncing for say `sourcegraph/cody` with the Eng PUBLIC |
| 227 | +Team, you couldn't actually create issues which sync to that repo directly |
| 228 | +in the UI. To have that work, we'd have to create a separate Cody Team |
| 229 | +in Linear with `sourcegraph/cody` being it's default bidirectional syncing repo. |
| 230 | + |
| 231 | +However, that would defeat the above goal of avoiding creating |
| 232 | +separate Linear Teams for each sub-team in Engineering. |
| 233 | + |
| 234 | +## Known restrictions |
| 235 | + |
| 236 | +- No custom fields for Issues. |
| 237 | +- An issue can have at most one assignee (DRI model). |
0 commit comments