Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(CONTRIBUTING): centralize, update, improve #16297

Merged
merged 3 commits into from
Nov 3, 2017

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Oct 24, 2017

  • remove outdated info
  • move info about writing docs from Wiki to contribute.md + updates
  • move info about development setup from docs/contribute to contribute.md
  • add info about running tests on Saucelabs / Browserstack
  • add info about specific core code topics
  • add link to contributing.md to Contribung page
  • add link to changelog.md to nav in docs

Closes #7303
Closes #9444

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change?

Please check if the PR fulfills these requirements

Other information:

- remove outdated info
- add info about writing docs from Wiki
- add info about development setup from docs contribute.md
- add info about running tests on Saucelabs / Browserstack

TODO:
- add link to contributing.md to Contribung page
- add link to changelog.md to dropdown in docs
-- link to current version changelog entry?

Closes angular#7303
Closes angular#9444
Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 00 - Love the overhaul.

But I do think that all the docs related bits make CONTRIBUTING.md quite overwhelming and intimidating. I would still keep it as a separate doc and link to it from CONTRIBUTING.md. WDYT?


For everything related to contributing, we have a document in our Git Repository that covers everything from submitting issues, setting up and building the code, to writing documentation, and much more: [Contributing](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, let me say this:

Super long lines in markdown files are evil, hard to review and hard to work with without special settings in your local editor. So why on earth would you write such lines in the first place when you can easily split them at 100 characters and get a nice readable, reviewable block of text? I hope this very long line forced you to scroll horizontally and helped you realize how unnecessarily unpleasant long lines can be. If you made it this far, thank you for allowing me to waste a small part of your time and for taking this comment into consideration.

(Yes, long lines can be fun, but only if you are me 😁)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have to scroll because I read it via email. 😛
But I will cut the lines. I did write this in an editor with word wrap ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arghhh... Well, it was worth a try 😛

CONTRIBUTING.md Outdated


[Google Closure I18N library]: https://github.com/google/closure-library/tree/master/closure/goog/i18n
[angular-dev]: https://groups.google.com/forum/?fromgroups#!forum/angular-dev
[browserstack]: https://www.browserstack.com/
[closing-issues]: https://help.github.com/articles/closing-issues-via-commit-messages/
[coc]: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
[contribute]: http://docs.angularjs.org/misc/contribute
[contributing]: http://docs.angularjs.org/misc/contribute
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go now 😃

CONTRIBUTING.md Outdated

## <a name="coc"></a> Code of Conduct

Help us keep AngularJS open and inclusive. Please read and follow our [Code of Conduct][coc].

## <a name="requests"></a> Questions, Bugs, Features

## <a name="question"></a> Got a Question or Problem?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and following sections should be ###.

CONTRIBUTING.md Outdated
If you have questions about how to use AngularJS, please direct these to the [Google Group][groups]
discussion list or [StackOverflow][stackoverflow]. We are also available on [IRC][irc] and
[Gitter][gitter].
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on dedicated support platforms, the best being [Stack Overflow][stackoverflow]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[stackoverflow]: --> [stackoverflow].

CONTRIBUTING.md Outdated
* **Major Changes** that you wish to contribute to the project should be discussed first in an
[GitHub issue][github-issues] that clearly outlines the changes and benefits of the feature.
* **Small Changes** can directly be crafted and submitted to the [GitHub Repository][github]
as a Pull Request. See the main section about [Documentation & Code Contributions](#code-contrib)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-contrib --> contributions

CONTRIBUTING.md Outdated
```

* In GitHub, send a pull request to `angular.js:master`. This will trigger the check of the
(Contributor License Agreement)(#cla) and the Travis integration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Contributor License Agreement) --> [Contributor License Agreement]

CONTRIBUTING.md Outdated
### Writing runnable (live) examples and e2e tests
It is possible to embed examples in the documentation along with appropriate e2e tests. These
examples and scenarios will be converted to runnable code within the documentation. So it is important
that they work correctly. To ensure this, all these e2e scenarios are run as part the automated Travis tests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as part the automated --> as part of the/our automated

CONTRIBUTING.md Outdated
that they work correctly. To ensure this, all these e2e scenarios are run as part the automated Travis tests.

If you are adding an example with an e2e test, you should [run the test locally](#e2e-tests). You can
use `fit` to run only your test.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expand a little bit on that, e.g.:

...you should run the test locally first to ensure it passes.
You can change it(...) to fit(...) to run only your test, but make sure you change it back to it(...) before committing.

CONTRIBUTING.md Outdated
This tag identifies a block of HTML that will define a runnable example. It can take the following attributes:

* `module` - specify an AngularJS module containing code that must be loaded to support this example.
* `animation` - if set to `true` then this example uses ngAnimations.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ngAnimations --> `ngAnimate`

CONTRIBUTING.md Outdated

* `module` - specify an AngularJS module containing code that must be loaded to support this example.
* `animation` - if set to `true` then this example uses ngAnimations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the name and deps attributes?

Copy link
Contributor Author

@Narretz Narretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough review, @gkalpak !
I'll have to look into automatically checking the links. So many are wrong.

I don't know if separating "Writing docs" makes a lot of sense, as it's an important part of writing a PR. We could move it at the end of Code & Doc Contrib.

I've also seen some repos that have a special DEVELOPERS.md, which contains everything from project setup to coding rules.

CONTRIBUTING.md Outdated

#### Throwing errors

User-facing errors should be thrown with [`minErr`][minErr], a special error function that provides errors ids, templated error messages, and adds a link to a detailed error description.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have many bollean provider config functions that don't end in enabled :D

CONTRIBUTING.md Outdated
* `@requires` - normally indicates that a JavaScript module is required; in an Angular service it is used to describe what other services this service relies on
* `@property` - describes a property of an object
* `@description` - used to provide a description of a component in markdown
* `@link` - specifies a link to a URL or a type in the API reference. **NOTE**: to link to `ng.$rootScope.Scope#$on` insert `methods_` between `#` and the actual method name: `{@link ng.$rootScope.Scope#methods_$on listen}`. Same goes for properties and events.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually didn't know about it either, this is copy and paste from the Wiki


For everything related to contributing, we have a document in our Git Repository that covers everything from submitting issues, setting up and building the code, to writing documentation, and much more: [Contributing](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have to scroll because I read it via email. 😛
But I will cut the lines. I did write this in an editor with word wrap ...

@gkalpak
Copy link
Member

gkalpak commented Oct 30, 2017

Here is my reasoning:

Since CONTRIBUTING.md is the first resource for potential contributors (including first-time contributors), I think it should be as lean as possible containing what is likely to be useful to many people (e.g. CoC, commit message guidelines, etc) and link to other, more specific resources. For example, many first-time contributors will just fix a typo of improve the wording in a description. Most of the time, they don't need to know everything about are (awesome but non-trivial) documentation pipeline and having a huge CONTRIBUTING.md may (a) make it more difficult to find what they really need to know and (b) be intimidating (for newcomers) 😃

I don't necessarily suggest moving everything that could be irrelevant to first-time contributors to other files, but the docs authoring section seemed/felt substantial in size and quite dense. Maybe moving dev related things to DEVELOPERS.md is a good compromize. (I would still keep the Commit Message Guidelines section in CONTRIBUTING.md though 😁)

I don't feel too strongly about it, so happy to go either way.

CONTRIBUTING.md Outdated
globally with:

```shell
yarn global add grunt-cli
Copy link
Contributor

@frederikprijck frederikprijck Oct 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be a better idea to avoid global installation of grunt by default ?
People unfamiliar with yarn/npm will follow the guideline and install it globally. I think people should not install this globally unless they know why.

Sorry, I'm a bit sensitive on the global npm package installations 🙈 It's an "anti-pattern" used in to many projects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in #16276, this is something we can do: document yarn ... as the default and list global installing of grunt as an alternative. But I think this can be part of a follow-up PR, as there may be more files that are affected by this.

@petebacondarwin
Copy link
Contributor

I agree with @gkalpak that we should move some of the more technical stuff to DEVELOPERS.md.

@Narretz
Copy link
Contributor Author

Narretz commented Oct 30, 2017

Ok. I think putting these 3 into the DEVELOPERS.md is a good separation, with links from CONTRIBUTING.md where it's appropriate:

  • Development Setup
  • Coding Rules
  • Writing Documentation

@Narretz Narretz force-pushed the docs-contributing branch 8 times, most recently from a006250 to 8f7ef70 Compare November 2, 2017 10:43
@Narretz
Copy link
Contributor Author

Narretz commented Nov 2, 2017

I've created the new DEVELOPERS.md, which contains the following sections:

  • Development Setup
  • Coding Rules
  • Commit Message Guidelines
  • Writing Documentation

I've added the commit message guidelines, because ...

  • they are quite dense, and we want to have a low entry barrier for contributors
  • for "improve docs" commits the message is pre-formatted (and easy to amend for us)
  • we now check the commit message on PRs in Travis

@Narretz Narretz force-pushed the docs-contributing branch 2 times, most recently from 082b8d8 to d3d257d Compare November 2, 2017 11:06

```shell
yarn global add grunt-cli
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we not decide to avoid installing grunt globally?
Instead people can just use yarn grunt ... to run grunt tasks.


```shell
sudo yarn global add grunt-cli
sudo yarn global add bower
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have ditched bower

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need it for a few things. @mgol will switch us to yarn aliases some time in the future.

`grunt` and `bower`:

```shell
sudo yarn global add grunt-cli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use local grunt then this whole note can be removed.

DEVELOPERS.md Outdated

* `docs/` — A directory that contains a standalone version of the docs
(same as served in `docs.angularjs.org`).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we ought to mention it also contains all the other core module files too? (e.g. angular-mocks.js, angular-route.js etc).

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use local grunt and drop the global installs of grunt and bower.

Otherwise LGTM

@Narretz
Copy link
Contributor Author

Narretz commented Nov 2, 2017

I think we can add the local grunt changes in a follow-up commit (and also note that you can still install globally grunt if you want ... that saves keystrokes!)

@mgol
Copy link
Member

mgol commented Nov 2, 2017

We should avoid global packages but since the relevant doc was just ported from an existing one, I'm fine doing that in a followup PR.

Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check the links in CONTRIBUTING.md and DEVELOPERS.md and ensure they are valid before merging?

CONTRIBUTING.md Outdated
[commit message conventions](#commit) and passes our commit message presubmit hook
(`validate-commit-msg.js`). Adherence to the [commit message conventions](#commit) is required,
because release notes are automatically generated from these messages.
[commit message conventions][developers.commits]. Adherence to the [commit message conventions](#commit)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#commit is no longer a valid link.

CONTRIBUTING.md Outdated
@@ -129,27 +146,33 @@ Before you submit your pull request consider the following guidelines:
* Push your branch to GitHub:

```shell
git push origin my-fix-branch
git push <remote> my-fix-branch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not origin. I'm afraid <remote> will confuse git beginners (and the instructions do not matter for experiences users, because they already know their way around).

Copy link
Contributor Author

@Narretz Narretz Nov 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, origin is better. I was thinking of my setup where angular/angular.js is the origin, and my fork just a remote.
Technically, since git now uses "simple" as the default push strategy, should git push be enough?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that for branches created in the way we show here, you need to have set the upstream once before you can just git push. I.e. you need to have run git push --set-upstream origin my-fix-branch the first time.

@Narretz Narretz force-pushed the docs-contributing branch 2 times, most recently from 4da38bc to 01c31b3 Compare November 3, 2017 11:20
@Narretz Narretz merged commit 181ac0b into angular:master Nov 3, 2017
Narretz added a commit that referenced this pull request Nov 17, 2017
CONTRIBUTING.md
- focus on basic info about issues and pull requests for new contributors
- move development heavy info to DEVELOPERS.md + add links
- remove outdated info

DEVELOPERS.md
- contains info about project setup, coding rules, and commit message guidelines from CONTRIBUTING.md
- add and update info about writing docs from Wiki
- add info about development setup from docs contribute.md
- add info about running tests on Saucelabs / Browserstack

Closes #7303
Closes #9444
Closes #16297
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
6 participants