Skip to content

Commit e58084a

Browse files
authored
Merge pull request exercism#680 from Smarticles101/move-contributing
Move contributing info into CONTRIBUTING file and add mention of rebases
2 parents 0c24d30 + 74697bb commit e58084a

2 files changed

Lines changed: 118 additions & 111 deletions

File tree

CONTRIBUTING.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## Table of Contents
2+
3+
* [Overview](#overview)
4+
* [Before Making Your Pull Request](#before-making-your-pull-request)
5+
* [Contributing With Minimal Setup](#contributing-with-minimal-setup)
6+
* [Getting Familiar With the Codebase](#getting-familiar-with-the-codebase)
7+
* [The `exercises` Module](#the-exercises-module)
8+
* [The Problem Submodules](#the-problem-submodules)
9+
* [Advanced: Complete Local Setup](#advanced-complete-local-setup)
10+
* [Tip: `gradle clean` before `exercism fetch`](#tip-gradle-clean-before-exercism-fetch)
11+
12+
## Overview
13+
14+
This guide covers contributing to the Java track. If you are new, this guide is for you.
15+
16+
If, at any point, you're having any trouble, pop in the [Gitter exercism/java room](https://gitter.im/exercism/java) or the [Gitter exercism/dev room](https://gitter.im/exercism/dev) for help.
17+
18+
19+
## Before Making Your Pull Request
20+
121
Hi! Thanks for contributing to the Exercism Java track!
222

323
Before opening your pull request, please review the track policies linked below and make sure your changes comply with them all. This helps us focus our review time on the more important aspects of your changes.
@@ -6,3 +26,100 @@ Before opening your pull request, please review the track policies linked below
626
- [Starter implementations](https://github.com/exercism/java/blob/master/POLICIES.md#starter-implementations)
727
- [Ignore noninitial tests](https://github.com/exercism/java/blob/master/POLICIES.md#ignore-noninitial-tests)
828
- [Multiple file submissions](https://github.com/exercism/java/blob/master/POLICIES.md#multiple-file-submissions)
29+
30+
One last thing to note before you get started. When you fork the repository and you want to sync your fork, you can perform a [`git rebase`](https://git-scm.com/docs/git-rebase). This is preferred over merging the changes because merging leads to a dirty commit history whereas performing a rebase adds in those changes without making extra commit messages. However, this is only preferred, so don't worry about it too much.
31+
32+
## Contributing With Minimal Setup
33+
34+
First things first: by contributing to Exercism, you are making this learning tool that much better and improving our industry as a whole... thank you!!!
35+
36+
To submit a fix for an existing exercise or port an exercise to Java with the least amount of setup:
37+
38+
1. **Ensure you have the basic Java tooling installed:** JDK 1.8+, an editor and Gradle 2.x.
39+
40+
(see [exercism.io: Installing Java](http://exercism.io/languages/java/installing))
41+
- **Setup a branch on a fork of [exercism/java](https://github.com/exercism/java) on your computer.**
42+
43+
See [GitHub Help: Forking](https://help.github.com/articles/fork-a-repo/). Use those instructions (in conjunction with the [Git Basics doc](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/git-basics.md)) to:
44+
* "fork" a repository on GitHub;
45+
- install `git`;
46+
- "clone" a copy of your fork;
47+
- configure an "upstream remote" (in this case, `exercism/java`);
48+
- create a branch to house your work
49+
- **Write the codes.** Do your work on that branch you just created.
50+
51+
The [Getting Familiar With the Codebase](#getting-familiar-with-the-codebase) section, below, is an orientation.
52+
- **Commit, push and create a pull request.**
53+
54+
Something like:
55+
```
56+
$ git add .
57+
$ git commit -m "(An intention-revealing commit message)"
58+
$ git push
59+
```
60+
61+
The Git Basics doc has a section on [commit messages](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/git-basics.md#commit-messages) that provides practical advice on crafting meaningful commit messages.
62+
- **Verify that your work passes all tests.** When you create a pull request (PR), GitHub triggers a build on Travis CI. Your PR will not be merged unless those tests pass.
63+
64+
## Getting Familiar With the Codebase
65+
66+
There are two objectives to the design of this build:
67+
68+
1. when a problem is built from within the `exercism/java` repo (i.e. when you, the contributor, are developing the exercise), the tests run against the "example" code;
69+
2. when a problem is built outside the `exercism/java` repo (when a participant is solving the exercise), the tests run against the "main" code.
70+
71+
This repo is a multi-project gradle build.
72+
73+
### The `exercises` Module
74+
75+
This is the top-level module, contained in the `exercises` directory. It is a container for the problem sub-modules.
76+
77+
* its `build.gradle` points the "main" sourceset to the example code.
78+
* its `settings.gradle` names each of the subprojects, one for each problem in the set.
79+
80+
### The Problem Submodules
81+
82+
The `exercises` subdirectory contains all of the problem submodules.
83+
Each problem/submodule is a subdirectory of the same name as its slug.
84+
85+
* its `build.gradle` names dependencies required to work that problem.
86+
87+
Each problem/submodule has three source sets:
88+
89+
* `src/test/java/` — a test suite defining the edges of the problem
90+
* `src/example/java/` — an example solution that passes all the tests
91+
* `src/main/java/` — starter source files, if required/desired *(this directory usually only has a `.keep` file in it)*.
92+
93+
----
94+
95+
## Advanced: Complete Local Setup
96+
97+
If you are going to make significant contribution(s) to the track, you might find it handy to have a complete local install of exercism on your computer. This way, you can run the full suite of tests without having to create/update a PR.
98+
99+
The easiest way to achieve this is simply use the `bin/journey-test.sh` script. However, you may want to perform other tests, depending on what you are doing. You can do so by duplicating the setup performed by the `bin/journey-test.sh` script.
100+
101+
### Tip: `gradle clean` before `exercism fetch`
102+
103+
If you `exercism fetch` after doing a build, the CLI will fail with the following error message:
104+
105+
```
106+
$ exercism fetch java bob
107+
2015/09/06 15:03:21 an internal server error was received.
108+
Please file a bug report with the contents of 'exercism debug' at: https://github.com/exercism/exercism.io/issues
109+
```
110+
111+
and if you review the logs of your x-api, you'll find:
112+
113+
```
114+
127.0.0.1 - - [06/Sep/2015:15:20:56 -0700] "GET /v2/exercises/java/bob HTTP/1.1" 500 514949 0.2138
115+
2015-09-06 15:21:01 - JSON::GeneratorError - source sequence is illegal/malformed utf-8:
116+
```
117+
118+
This is because some files generated by the build can't be served from the x-api. This is by design: the CLI does not serve binaries. To fix this, simply make sure you do a clean in your `exercism/java` repo before you fetch:
119+
120+
```
121+
cd ~/workspace/exercism/java/exercises
122+
gradle clean
123+
cd ~/workspace/exercism/exercises
124+
exercism fetch java bob
125+
```

README.md

Lines changed: 1 addition & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -6,114 +6,4 @@ Source for Exercism Exercises in Java.
66

77
For general information about how to contribute to Exercism, please refer to the [Contributing Guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks).
88

9-
## Table of Contents
10-
11-
* [Overview](#overview)
12-
* [Contributing With Minimal Setup](#contributing-with-minimal-setup)
13-
* [Getting Familiar With the Codebase](#getting-familiar-with-the-codebase)
14-
* [The `exercises` Module](#the-exercises-module)
15-
* [The Problem Submodules](#the-problem-submodules)
16-
* [Advanced: Complete Local Setup](#advanced-complete-local-setup)
17-
* [Tip: `gradle clean` before `exercism fetch`](#tip-gradle-clean-before-exercism-fetch)
18-
19-
20-
## Overview
21-
22-
This guide covers contributing to the Java track. If you are new, this guide is for you.
23-
24-
If, at any point, you're having any trouble, pop in the [Gitter exercism/java room](https://gitter.im/exercism/java) or the [Gitter exercism/dev room](https://gitter.im/exercism/dev) for help.
25-
26-
## Contributing With Minimal Setup
27-
28-
First things first: by contributing to Exercism, you are making this learning tool that much better and improving our industry as a whole... thank you!!!
29-
30-
To submit a fix for an existing exercise or port an exercise to Java with the least amount of setup:
31-
32-
1. **Ensure you have the basic Java tooling installed:** JDK 1.8+, an editor and Gradle 2.x.
33-
34-
(see [exercism.io: Installing Java](http://exercism.io/languages/java/installing))
35-
- **Setup a branch on a fork of [exercism/java](https://github.com/exercism/java) on your computer.**
36-
37-
See [GitHub Help: Forking](https://help.github.com/articles/fork-a-repo/). Use those instructions (in conjunction with the [Git Basics doc](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/git-basics.md)) to:
38-
* "fork" a repository on GitHub;
39-
- install `git`;
40-
- "clone" a copy of your fork;
41-
- configure an "upstream remote" (in this case, `exercism/java`);
42-
- create a branch to house your work
43-
- **Write the codes.** Do your work on that branch you just created.
44-
45-
The [Getting Familiar With the Codebase](#getting-familiar-with-the-codebase) section, below, is an orientation.
46-
- **Commit, push and create a pull request.**
47-
48-
Something like:
49-
```
50-
$ git add .
51-
$ git commit -m "(An intention-revealing commit message)"
52-
$ git push
53-
```
54-
55-
The Git Basics doc has a section on [commit messages](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/git-basics.md#commit-messages) that provides practical advice on crafting meaningful commit messages.
56-
- **Verify that your work passes all tests.** When you create a pull request (PR), GitHub triggers a build on Travis CI. Your PR will not be merged unless those tests pass.
57-
58-
## Getting Familiar With the Codebase
59-
60-
There are two objectives to the design of this build:
61-
62-
1. when a problem is built from within the `exercism/java` repo (i.e. when you, the contributor, are developing the exercise), the tests run against the "example" code;
63-
2. when a problem is built outside the `exercism/java` repo (when a participant is solving the exercise), the tests run against the "main" code.
64-
65-
This repo is a multi-project gradle build.
66-
67-
### The `exercises` Module
68-
69-
This is the top-level module, contained in the `exercises` directory. It is a container for the problem sub-modules.
70-
71-
* its `build.gradle` points the "main" sourceset to the example code.
72-
* its `settings.gradle` names each of the subprojects, one for each problem in the set.
73-
74-
### The Problem Submodules
75-
76-
The `exercises` subdirectory contains all of the problem submodules.
77-
Each problem/submodule is a subdirectory of the same name as its slug.
78-
79-
* its `build.gradle` names dependencies required to work that problem.
80-
81-
Each problem/submodule has three source sets:
82-
83-
* `src/test/java/` — a test suite defining the edges of the problem
84-
* `src/example/java/` — an example solution that passes all the tests
85-
* `src/main/java/` — starter source files, if required/desired *(this directory usually only has a `.keep` file in it)*.
86-
87-
----
88-
89-
## Advanced: Complete Local Setup
90-
91-
If you are going to make significant contribution(s) to the track, you might find it handy to have a complete local install of exercism on your computer. This way, you can run the full suite of tests without having to create/update a PR.
92-
93-
The easiest way to achieve this is simply use the `bin/journey-test.sh` script. However, you may want to perform other tests, depending on what you are doing. You can do so by duplicating the setup performed by the `bin/journey-test.sh` script.
94-
95-
### Tip: `gradle clean` before `exercism fetch`
96-
97-
If you `exercism fetch` after doing a build, the CLI will fail with the following error message:
98-
99-
```
100-
$ exercism fetch java bob
101-
2015/09/06 15:03:21 an internal server error was received.
102-
Please file a bug report with the contents of 'exercism debug' at: https://github.com/exercism/exercism.io/issues
103-
```
104-
105-
and if you review the logs of your x-api, you'll find:
106-
107-
```
108-
127.0.0.1 - - [06/Sep/2015:15:20:56 -0700] "GET /v2/exercises/java/bob HTTP/1.1" 500 514949 0.2138
109-
2015-09-06 15:21:01 - JSON::GeneratorError - source sequence is illegal/malformed utf-8:
110-
```
111-
112-
This is because some files generated by the build can't be served from the x-api. This is by design: the CLI does not serve binaries. To fix this, simply make sure you do a clean in your `exercism/java` repo before you fetch:
113-
114-
```
115-
cd ~/workspace/exercism/java/exercises
116-
gradle clean
117-
cd ~/workspace/exercism/exercises
118-
exercism fetch java bob
119-
```
9+
For information on contributing to this track, refer to the [CONTRIBUTING.md](https://github.com/exercism/java/blob/master/CONTRIBUTING.md) file.

0 commit comments

Comments
 (0)