Skip to content

Commit 00fa3c5

Browse files
authored
how2contribute4dummies (#5)
* yayayayyaa * whitespace * blahbalbhahasl * fuck microsoft
1 parent d0080f1 commit 00fa3c5

6 files changed

Lines changed: 175 additions & 4 deletions

File tree

src/SUMMARY.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ General Help
77
====
88

99
---
10-
- [Getting Started](contributing/getting-started.md)
10+
- [Introduction](contributing/introduction.md)
11+
- [Getting Started](contributing/getting-started.md)
12+
- [Local Hosts](contributing/local-hosts.md)
13+
- [Branching](contributing/branching.md)
14+
- [Pull Requests](contributing/pull-requests.md)
1115

1216
Design
1317
===============

src/contributing/branching.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# What Next?
2+
So you've got a nice and updated local host, then obviously you want to jump in and figure out coding and your changes. However... you're not quite there yet!
3+
4+
If you make changes now, you'll be doing so on your *master branch.* Your PR will automatically be closed if it comes from your master branch, so first, you need to figure out how to use Git and make a new *branch.*
5+
6+
If you want a more in depth explanation of Git, please see Wizden's [Git for the SS14 Developer](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html). This also has some information on how to use TortoiseGit and SmartGit, if you prefer those over Git Bash.
7+
8+
```admonish warning
9+
DO NOT SUBMIT PRS FROM YOUR MASTER BRANCH.
10+
11+
Your PR will be closed automatically if you submit from your master branch.
12+
13+
It can also cause issues for you later, so don't do it! PLEASE!!
14+
15+
```
16+
# What is a Branch?
17+
18+
A branch another copy of your codebase, which you make your changes onto. You are "branching" off of the main tree in order to develop and test your changes. When these changes are done, we can then merge them into the main branch--also known as a *pull request.*
19+
20+
We do this in order to help organize development. If you end up doing multiple projects at once, or even something like a minor bug fix while you are working on something else, branches help keep everything neat and separate. If you prefer to see things visually, there are many resources online explaining branches with visual guides.
21+
22+
# Working with Git
23+
Now, you have to actually make a branch. To get started, open Git Bash in your directory (the /funkystation/ folder created prior). Unless you've worked with Git Bash before, this will open it on your master branch. You can tell what branch Git Bash is currently on by the cyan text in parenthesis, it should say "(master)."
24+
25+
26+
The first command you need to know is `git checkout`. This is how you move between branches, you are checking out from one to the other. To make a new branch, you can simply do:
27+
28+
- `git checkout -b branch-name`
29+
30+
The -b tag means you want to make a new branch. You can replace `branch-name` with anything you want, just make sure it's unique.
31+
32+
After that... You're on a new branch! You can actually start coding now. After you finish your work, or need to save your work, you'll need to do two commands to *commit* your changes:
33+
34+
- `git add -A`
35+
36+
This "stages" the files to be committed. Basically you're telling Git that these are the files you edited and *want* to commit. The -A tag means all files, but you can remove it and individually add files for staging if you prefer.
37+
38+
- `git commit -m "commit message here"`
39+
40+
A commit basically an entry in your log of changes. The -m tag is so Git knows that you're attaching a message to the commit. If you don't add the tag, Git will probably open VIM (or whatever command line text editor you have installed. If you don't know what that is, it's probably VIM).
41+
42+
The message is so you know what was edited at a glance, but Git helpfully saves detailed information about what was edited in a commit.
43+
44+
```admonish warning
45+
HELP IT OPENED VIM!!
46+
VIM looks like some yellow text on top, a bunch of blue text, and a fuck ton of ~s everywhere.
47+
48+
It's terrible to use and you'll probably struggle to use it without someone telling you how to.
49+
50+
First, see if it says "---INSERT---" at the bottom. If it does, great, if it doesn't, press `i`.
51+
52+
Then type your commit message, press escape, and then type `:x`. Then boom! VIM is gone!
53+
```
54+
55+
56+
After you've finished all of your changes and committed them, the last step is to push them to your origin, GitHub:
57+
58+
- `git push origin branch-name`
59+
60+
Origin refers to Github, and `branch-name` would be the name of your current branch. After you do this, go to Github's website find your forked repository (you can click your PFP and then "My Repositories").
61+
62+
Usually a nice little popup that says that the branch you were just working on had new changes. You can click "make a pull request" from there, or navigate to your branches and do the same thing.
63+
Then, you can make a pull request!

src/contributing/getting-started.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
```admonish warning
44
If you get some strange issues with Windows regarding Python, be sure to check these two during your Python install.
5-
6-
If this doesn't work, understand that Microsoft sucks, and wants you to install Python through the Microsoft Store. Google can help you.
75
<img src="/assets/getting-started/python_for_windows.png" width=512 style="margin-left:auto;margin-right:auto;display:block"/>
86
```
97

@@ -24,4 +22,13 @@ In your terminal window, type `git clone <your repo url here> .` (without the <>
2422

2523
After it's done (you'll know when), type `python RUN_THIS.py`. Let that work, if it errors, reread the guide and make sure you followed all the steps.
2624

27-
Congratulations, it's completed. To open a development build of Funky Station, you can now run the `runclient.bat` file, as well as the `runserver.bat` file to get a local server and client up.
25+
Congratulations, it's completed. To open a development build of Funky Station, you can now run the `runclient.bat` file, as well as the `runserver.bat` file to get a local server and client up.
26+
27+
```admonish warning
28+
If you are using Windows and you get the following error:
29+
"Python was not found; run without arugments to install from the Microsoft Store,
30+
or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases"
31+
32+
Fuck Microsoft. Go into the settings it tells you to and disable the duplicate execution alias.
33+
Or just double click RUN_THIS.py. Whatever works.
34+
```

src/contributing/introduction.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# What is This?
2+
This is meant to be both a guide of how to get started contributing for SS14 and an introduction to development as a whole. The end goal is that you not only have successfully made a pull request (PR), but that you also have a decent understanding of what, why, and how you do so.
3+
4+
People with any sort of development experience may find sections of this guide redundant; please keep in mind that it is written with new developers in mind.
5+
6+
# What's in This Guide?
7+
This primarily focuses on introducing the tools you will be using to create a PR, rather than the nitty gritty of developing as a whole. Please consider looking at WizDen's [developer docs](https://docs.spacestation14.com/index.html) if you want to learn more about the finer details.

src/contributing/local-hosts.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Why not use Github's Web Editor?
2+
I know it's tempting. Especially if you know that the change you want to make doesn't deal with actual C# code; maybe you want to fix a typo or rewrite one of the guidebook pages. Something small.
3+
4+
**PLEASE DON'T!!!!!!!!!!!**
5+
6+
Part of this is for future proofing--learning how to use these tools on a small change helps prepare you to do larger changes later. Just because your changes are small now doesn't mean they will be later.
7+
8+
The web editor, and Github in general, can not handle large changes. Plus, changes you might think are small might be larger than you think. As an example, try to open the 'Files Changed' tab of a PR that changes maps. Usually it crashes.
9+
10+
Github also likes to fuck up files if you try to upload them through Github, rather than setting up a local host and doing all of this. Things like images getting lossy, audio getting bit crushed, et cetera. It sucks.
11+
# Creating a Local Host
12+
Please see Getting Started for information on how to get a local host on your computer. If you have an issues with this guide, you are always free to ask us in the Discord!
13+
14+
Similarly, if you want a more detailed version of the same guide, consider reading WizDen's [Setting up a Development Environment](https://docs.spacestation14.com/en/general-development/setup/setting-up-a-development-environment.html)
15+
16+
```admonish warning
17+
If you are using Windows and you get the following error:
18+
"Python was not found; run without arugments to install from the Microsoft Store,
19+
or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases"
20+
21+
Fuck Microsoft. Go into the settings it tells you to and disable the duplicate execution alias.
22+
Or just double click RUN_THIS.py. Whatever works.
23+
```
24+
# Running a Local Host
25+
At the end of Getting Started, you run `runserver.bat` and `runclient.bat` to run your local host. This works fine, but sometimes issues arise with these default settings.
26+
27+
Most commonly, these two files open your local host in *Debug*. There are other .bat files to open your local host in different configurations (modes), however, there are other ways to do this that are generally a little better.
28+
29+
The most common way is to use your IDE (integrated developer environment, the program you use to code) of choice. Use your IDE to open `SpaceStation14.sln` and then navigate to the build button. In Jetbrains Rider, it's in the top right.
30+
31+
If you don't have an IDE, you can also use command line to run and configure a local host. Git Bash works for this, just make sure you are in the correct directory. Then run:
32+
33+
- `dotnet build`
34+
- `dotnet run --project Content.Server`
35+
- `dotnet run --project Content.Server`
36+
37+
If you want to run your local host in a different configuration, add `--configuration Release/Debug/Tools` at the end of the two run commands.
38+
# Updating a Local Host
39+
40+
Assuming you followed the guide in Getting Started, you can just press the "Sync Fork" button on Github's website. Then it updates your fork! Yay!
41+
42+
If you prefer to update things manually, then you can also add a *remote* to fetch and merge into your local version. Make sure you are on your master branch while doing this.
43+
44+
A remote is a way for Git to know to go to that specific repository (a codebase) and grab changes and code from there. In this case, you'll need to add a remote for Funkystation's Github. You can do this in Git Bash by running:
45+
46+
- `git remote add funkystation https://github.com/funky-station/funky-station.git`
47+
48+
You can change `funkystation` to anything you want. This is just the name of the remote, so pick something you can remember easily!
49+
50+
If you need to add a remote for a different repository (such as Wizden or Goobstation), you can run the same command with the name and link changed. The link you want can be acquired by going to the repository's Github page, clicking the green "Code" button and then copying the link there.
51+
52+
After this, you need to *fetch* the remote. Fetching something means you are telling Git to go get everything on the remote and hold onto it:
53+
54+
- `git fetch funkystation`
55+
56+
Git Bash will spit out a lot of lines at you, assuming it's been a little while since you last updated your local host. This is good! If you get nothing, then that's also fine. It means whatever Git Bash is holding onto is up to date with Funkystation's repository.
57+
If you get an error, usually the error message is pretty obvious with what's wrong. If it's something like "Remote not found!" then make sure you typed in the name correctly.
58+
59+
Then, you need to *merge* the remote into your local code:
60+
61+
- `git merge funkystation/master`
62+
63+
Notice the addition of `/master`! This just means that you are telling Git to merge specifically the master branch (the main code) of Funkystation into your code. There are other branches in Funkystation's repository, which we generally don't want. Git Bash will tell you it's updating, and then it's done!

src/contributing/pull-requests.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Pull Requests
2+
3+
A *pull request* is a way for you to showcase your changes and ask for them to be merged into the main codebase. You are *requesting* that your changes be *pulled.* A little bit of a confusing term if you don't know the prerequisite jargon.
4+
5+
The last section of *Branching* tells you how to navigate Github and start your actual pull request. From here, you can select which branch you are PRing to. By default it is Funkystation's master branch, and you usually want to keep that the same.
6+
You can also see the *diff* (the difference in files between your changes and the original codebase) here. Please make sure to review this, as you don't want any other changes sneaking into your PR.
7+
8+
Similarly, you'll want to fill out the description of your actual PR. Each section has an explanation in its comments, which are the sections enclosed with `<!-- -->`. PRs are more likely to be reviewed and merged if these sections are properly filled.
9+
# Changelog Formatting
10+
11+
Enclosed in comments is a sample changelog for your usage. Please make sure your changelog is formatted completely correctly, otherwise it won't appear in game.
12+
13+
The format is as follows:
14+
```
15+
🆑Username
16+
- add:
17+
- remove:
18+
- tweak:
19+
- fix:
20+
```
21+
22+
For the username section, please make sure there are no special characters at all. Hyphens and exclamation points will break the changelog. You can also leave it blank if you prefer it to autofill your Github username.
23+
# Reviews
24+
25+
Once we receive a properly made PR, the maintainers will review your PR! We first look at things like test fails (CRLF check, YML linter, Content.Integration tests). Any related test fails will have to be corrected prior to being merged.
26+
27+
If the tests pass, great! We then review the code, discuss how it would impact the server, and then we either request changes, merge the PR, or close the PR. If you would like to know more about why or why not a PR was merged, please see our Design Principles.

0 commit comments

Comments
 (0)