2021-04-26 23:26:16 +02:00
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE - RUN doctoc TO UPDATE -->
# Maintaining
2021-09-23 21:24:08 +02:00
- [Team ](#team )
- [Onboarding ](#onboarding )
- [Offboarding ](#offboarding )
- [Workflow ](#workflow )
- [Milestones ](#milestones )
- [Triage ](#triage )
- [Versioning ](#versioning )
- [Pull requests ](#pull-requests )
- [Merge strategies ](#merge-strategies )
- [Changelog ](#changelog )
- [Releases ](#releases )
- [Publishing a release ](#publishing-a-release )
- [AUR ](#aur )
- [Docker ](#docker )
- [Homebrew ](#homebrew )
- [npm ](#npm )
2022-04-07 22:15:30 +02:00
- [Syncing with upstream Code ](#syncing-with-upstream-code )
2021-09-29 23:59:17 +02:00
- [Testing ](#testing )
2021-09-23 21:24:08 +02:00
- [Documentation ](#documentation )
- [Troubleshooting ](#troubleshooting )
2021-04-26 23:26:16 +02:00
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2021-09-23 21:04:14 +02:00
This document is meant to serve current and future maintainers of code-server,
as well as share our workflow for maintaining the project.
## Team
2021-04-26 23:26:16 +02:00
Current maintainers:
- @code -asher
- @jsjoeio
2022-01-10 19:38:43 +01:00
Occasionally, other Coder employees may step in time to time to assist with code-server.
2021-04-26 23:26:16 +02:00
2021-09-23 21:12:34 +02:00
### Onboarding
To onboard a new maintainer to the project, please make sure to do the following:
2022-09-10 00:15:39 +02:00
- [ ] Add to [coder/code-server ](https://github.com/orgs/coder/teams/code-server )
2022-01-20 19:38:19 +01:00
- [ ] Add as Admin under [Repository Settings > Access ](https://github.com/coder/code-server/settings/access )
2021-09-23 21:12:34 +02:00
- [ ] Add to [npm Coder org ](https://www.npmjs.com/org/coder )
- [ ] Add as [AUR maintainer ](https://aur.archlinux.org/packages/code-server/ ) (talk to Colin)
2022-01-20 19:38:19 +01:00
- [ ] Introduce to community via Discussion (see [example ](https://github.com/coder/code-server/discussions/3955 ))
2021-09-23 21:12:34 +02:00
### Offboarding
Very similar to Onboarding but Remove maintainer from all teams and revoke access. Please also do the following:
2022-01-20 19:38:19 +01:00
- [ ] Write farewell post via Discussion (see [example ](https://github.com/coder/code-server/discussions/3933 ))
2021-09-23 21:12:34 +02:00
2021-04-26 23:26:16 +02:00
## Workflow
2021-07-07 18:00:51 +02:00
The workflow used by code-server maintainers aims to be easy to understood by
the community and easy enough for new maintainers to jump in and start
contributing on day one.
2021-04-26 23:26:16 +02:00
### Milestones
2021-07-07 18:00:51 +02:00
We operate mainly using
2022-01-20 19:38:19 +01:00
[milestones ](https://github.com/coder/code-server/milestones ). This was heavily
2021-07-07 18:00:51 +02:00
inspired by our friends over at [vscode ](https://github.com/microsoft/vscode ).
2021-04-26 23:26:16 +02:00
Here are the milestones we use and how we use them:
- "Backlog" -> Work not yet planned for a specific release.
- "On Deck" -> Work under consideration for upcoming milestones.
2021-07-07 18:00:51 +02:00
- "Backlog Candidates" -> Work that is not yet accepted for the backlog. We wait
for the community to weigh in.
2022-09-10 00:15:39 +02:00
- "< Month > " -> Work to be done for said month.
2021-04-26 23:26:16 +02:00
2021-07-07 18:00:51 +02:00
With this flow, any un-assigned issues are essentially in triage state. Once
triaged, issues are either "Backlog" or "Backlog Candidates". They will
eventually move to "On Deck" (or be closed). Lastly, they will end up on a
version milestone where they will be worked on.
2021-04-26 23:26:16 +02:00
2021-05-04 20:57:00 +02:00
### Triage
We use the following process for triaging GitHub issues:
2021-07-07 18:00:51 +02:00
1. Create an issue
1. Add appropriate labels to the issue (including "needs-investigation" if we
should look into it further)
1. Add the issue to a milestone
1. If it should be fixed soon, add to version milestone or "On Deck"
2. If not urgent, add to "Backlog"
3. Otherwise, add to "Backlog Candidate" for future consideration
2021-05-04 20:57:00 +02:00
2021-05-05 00:08:04 +02:00
## Versioning
`<major.minor.patch>`
2021-07-07 18:00:51 +02:00
The code-server project follows traditional [semantic
versioning](https://semver.org/), with the objective of minimizing major changes
that break backward compatibility. We increment the patch level for all
releases, except when the upstream Visual Studio Code project increments its
minor version or we change the plugin API in a backward-compatible manner. In
those cases, we increment the minor version rather than the patch level.
2021-05-13 00:34:35 +02:00
2021-07-07 18:00:51 +02:00
## Pull requests
2021-05-13 00:34:35 +02:00
2021-07-07 18:00:51 +02:00
Ideally, every PR should fix an issue. If it doesn't, make sure it's associated
with a version milestone.
2021-05-13 00:34:35 +02:00
2021-07-07 18:00:51 +02:00
If a PR does fix an issue, don't add it to the version milestone. Otherwise, the
version milestone will have duplicate information: the issue and the PR fixing
the issue.
2021-05-13 00:47:41 +02:00
2021-07-07 18:00:51 +02:00
### Merge strategies
2021-05-13 00:47:41 +02:00
2021-12-06 18:58:04 +01:00
For most things, we recommend the **squash and merge** strategy. There
2021-07-07 18:00:51 +02:00
may be times where **creating a merge commit** makes sense as well. Use your
best judgment. If you're unsure, you can always discuss in the PR with the team.
2021-05-12 00:29:39 +02:00
2021-05-27 18:32:09 +02:00
### Changelog
2021-07-07 18:00:51 +02:00
To save time when creating a new release for code-server, we keep a running
changelog at `CHANGELOG.md` .
2021-05-27 18:32:09 +02:00
2021-07-07 18:00:51 +02:00
If either the author or reviewer of a PR believes the change should be mentioned
in the changelog, then it should be added.
2021-05-27 18:32:09 +02:00
2021-07-07 18:00:51 +02:00
If there is not a **Next Version** when you modify `CHANGELOG.md` , please add it
using the template you see near the top of the changelog.
2021-06-24 00:37:01 +02:00
2021-07-07 18:00:51 +02:00
When writing your changelog item, ask yourself:
2021-06-24 00:37:01 +02:00
1. How do these changes affect code-server users?
2021-07-07 18:00:51 +02:00
2. What actions do they need to take (if any)?
2021-05-27 18:32:09 +02:00
2021-07-07 18:00:51 +02:00
If you need inspiration, we suggest looking at the [Emacs
changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
2021-05-12 00:29:39 +02:00
2021-07-07 18:00:51 +02:00
## Releases
2021-05-12 00:29:39 +02:00
2021-05-31 17:11:58 +02:00
### Publishing a release
2021-05-25 16:48:01 +02:00
2022-07-18 23:38:07 +02:00
1. Create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0)
1. If you don't do this, the `npm-brew` GitHub workflow will fail. It looks for the release artifacts under the branch pattern.
2022-09-30 23:44:45 +02:00
1. Run `yarn release:prep`
2022-07-01 22:45:36 +02:00
1. Bump chart version in `Chart.yaml` .
2022-09-16 17:14:28 +02:00
1. Summarize the major changes in the `CHANGELOG.md`
1. Download CI artifacts and make sure code-server works locally.
1. Merge PR and wait for CI build on `main` to finish.
1. Go to GitHub Actions > Draft release > Run workflow off `main` . CI will automatically upload the artifacts to the release.
1. Add the release notes from the `CHANGELOG.md` and publish release. CI will automatically grab the
2021-07-07 18:00:51 +02:00
artifacts, publish the NPM package from `npm-package` , and publish the Docker
Hub image from `release-images` .
2021-08-30 19:32:56 +02:00
2021-09-23 21:24:08 +02:00
#### AUR
2022-02-01 17:45:19 +01:00
We publish to AUR as a package [here ](https://aur.archlinux.org/packages/code-server/ ). This process is manual and can be done by following the steps in [this repo ](https://github.com/coder/code-server-aur ).
2021-09-23 21:24:08 +02:00
#### Docker
We publish code-server as a Docker image [here ](https://registry.hub.docker.com/r/codercom/code-server ), tagging it both with the version and latest.
This is currently automated with the release process.
#### Homebrew
We publish code-server on Homebrew [here ](https://github.com/Homebrew/homebrew-core/blob/master/Formula/code-server.rb ).
2022-01-10 19:38:43 +01:00
This is currently automated with the release process (but may fail occasionally). If it does, run this locally:
2021-09-23 21:24:08 +02:00
```shell
# Replace VERSION with version
brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit
```
#### npm
2021-09-23 21:25:49 +02:00
We publish code-server as a npm package [here ](https://www.npmjs.com/package/code-server/v/latest ).
2021-09-23 21:24:08 +02:00
This is currently automated with the release process.
2022-04-07 22:15:30 +02:00
## Syncing with upstream Code
2021-12-06 18:58:04 +01:00
2022-04-07 22:15:30 +02:00
Refer to the [contributing docs ](https://coder.com/docs/code-server/latest/CONTRIBUTING#version-updates-to-code ) for information on how to update Code within code-server.
2021-12-06 18:58:04 +01:00
2021-09-29 23:59:17 +02:00
## Testing
Our testing structure is laid out under our [Contributing docs ](https://coder.com/docs/code-server/latest/CONTRIBUTING#test ).
2022-01-10 19:38:43 +01:00
We hope to eventually hit 100% test coverage with our unit tests, and maybe one day our scripts (coverage not tracked currently).
2021-09-29 23:59:17 +02:00
If you're ever looking to add more tests, here are a few ways to get started:
- run `yarn test:unit` and look at the coverage chart. You'll see all the uncovered lines. This is a good place to start.
- look at `test/scripts` to see which scripts are tested. We can always use more tests there.
- look at `test/e2e` . We can always use more end-to-end tests.
Otherwise, talk to a current maintainer and ask which part of the codebase is lacking most when it comes to tests.
2021-08-30 19:32:56 +02:00
## Documentation
### Troubleshooting
Our docs are hosted on [Vercel ](https://vercel.com/ ). Vercel only shows logs in realtime, which means you need to have the logs open in one tab and reproduce your error in another tab. Since our logs are private to Coder the organization, you can only follow these steps if you're a Coder employee. Ask a maintainer for help if you need it.
2022-02-01 17:45:19 +01:00
Taking a real scenario, let's say you wanted to troubleshoot [this docs change ](https://github.com/coder/code-server/pull/4042 ). Here is how you would do it:
2021-08-30 19:32:56 +02:00
1. Go to https://vercel.com/codercom/codercom
2. Click "View Function Logs"
3. In a separate tab, open the preview link from github-actions-bot
4. Now look at the function logs and see if there are errors in the logs