Workflow & Guidelines
To facilitate multiple people working on and reviewing docs simultaneously, following this workflow is required for all contributors.
If you are unfamiliar with Git, GitHub and/or VS Code, click the footnotes referenced on the steps for more detailed instructions.
Running the website locally
Section titled “Running the website locally”In order to see your changes live, start the website locally.
- Open a Terminal in the project root directory and run:
- Once the server starts, a URL will be provided in the console that you can click to open the local version of the website.
- The local version should self-refresh as you make changes. If you don’t see a change, try refreshing the page in your browser.
- When you’re done, click inside of the terminal and press Ctrl+C to stop the server.
If you receive an error about a missing package when you try to start the server, run:
Document Editing Workflow
Section titled “Document Editing Workflow”-
In the project, open the issue in the “Ready” column and assign yourself to it (click “Assignees”. It’s in the “Metadata” section at the bottom of the sidebar view, or along the right in the full page issue view).
Do not pick up any issues from the “Backlog” column. -
Drag the issue into the “In Progress” column.
-
Create a new branch3 (VS Code switches to the new branch automatically).
NoteBranch names should be ‘lowercase-with-hyphens’ (no spaces). If working on one doc, the branch name should be the doc name. Otherwise, try to come up with a meaningful but short name.
-
Make your changes/additions.
-
Stage4 and Commit5 your changes/additions.
NoteCommit messages should be written in the imperative, meaning they should make grammatical sense if appended after the phrase “if applied, this commit will…”. Example: “create the EuroScope doc”.
TipIf you get an error while committing, click the “View Command Output” button. Look for ESLint errors and fix them before you commit again. If you see an error from Prettier saying you haven’t formatted a document, ensure you have set up the Prettier Extension properly to run on save.
-
Pull2, then check the Graph view in the Source Control pane in VS Code for any new commits pushed to
mainthat aren’t on your branch. If you see any, merge6 them into your branch. -
Push7 the commits to GitHub on your branch.
-
Open a pull request8 (PR). Write the PR title in the imperative mood, similar to a commit message. In the description, ensure the phrase “Closes #n” is present on its own line at the bottom. Replace ‘n’ with the issue number9. This will auto-move your Issue to “Done” once your PR is merged and link it to your PR.
-
After creating your PR, assign yourself to the PR in the same way you did for the issue, then request a review10 from at least one contributor who was not involved with your work.
-
In the project, drag your issue into the “In Review” column.
-
After the contributor approves your review, request a review10 from the project lead and move your issue into the “KT Review” column.
-
Once your PR has been reviewed and merged, switch back to the
mainbranch, pull and delete your branch11.
General Guidelines
Section titled “General Guidelines”- Never commit or push directly on the
mainbranch. Always use a separate branch and a pull request. - Your work shouldn’t require modifying anything outside of the
src/content/docsfolder. If you feel outside changes are required, please speak to tech support first. - Ensure you’re on the right branch before you commit.
- Pull and push regularly. At a minimum, pull before you start work on a given day and push once you’re done for the day if you’ve committed anything. If you are collaborating with someone else on the same branch, do this more often as you may need to resolve merge conflicts6 when you pull.
- Commit regularly; at least once when you finish writing a new file and for each major change. Think of committing like a slightly less frequent version of saving with a name for each ‘save’. You don’t only want to save once at the very end.
- Generally, if your commit message contains ‘and’, you may have too many changes lumped into one commit. VS Code allows you to selectively commit only certain sections of each file so you can break up the commits12.
- Don’t reuse branches. Delete them after the relevant pull request has been merged.
- Take the time to review pull requests in detail to avoid having to go back and make more changes after the fact. GitHub has a great guide on how to review pull requests. Use the feature to comment on specific lines whenever you can to make responding to your review easier.
Footnotes
Section titled “Footnotes”-
Pulling in VS Code. If you’re collaborating with someone on the same branch and encounter a merge conflict while pulling, see the footnote about merge conflicts6. ↩ ↩2
-
Follow the instructions in Merging Branches in VS Code. Note however that unlike the example, the ‘target’ branch is your working branch, and you merge FROM
main.You may encounter merge conflicts when merging or pulling. If that happens, see Resolve Merge Conflicts in VS Code. Always resolve merge conflicts using the 3-way merge editor. Do not attempt to resolve them inline. Always consider each conflict carefully to ensure you don’t overwrite someone else’s work. ↩ ↩2 ↩3
-
Creating a PR on GitHub. The base branch should always be
main, and the compare branch should be your branch. ↩ -
Deleting branches in VS Code. You should delete the remote branch first (the one that’s been pushed to GitHub), followed by your local branch. Both can be done through VS Code. ↩