Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve contributing docs aka hacking #57645

Merged
merged 15 commits into from
Jan 11, 2021

Conversation

waynew
Copy link
Contributor

@waynew waynew commented Jun 11, 2020

HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
@dwoz dwoz added Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases has-failing-test labels Jun 16, 2020
@sagetherage sagetherage added the Documentation Relates to Salt documentation label Sep 1, 2020
@dwoz dwoz removed the Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label Sep 22, 2020
@sagetherage sagetherage changed the title Improve contributing docs Improve contributing docs aka hacking Oct 26, 2020
@waynew waynew marked this pull request as ready for review December 9, 2020 20:31
@waynew waynew requested a review from a team as a code owner December 9, 2020 20:31
@waynew waynew requested review from cmcmarrow and removed request for a team December 9, 2020 20:31
krionbsd
krionbsd previously approved these changes Dec 9, 2020
@sagetherage sagetherage added the Aluminium Release Post Mg and Pre Si label Dec 9, 2020
Copy link
Collaborator

@s0undt3ch s0undt3ch left a comment

Choose a reason for hiding this comment

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

Why do we repeat content?

HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
HACKING.rst Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
HACKING.rst Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
Copy link
Contributor

@ScriptAutomate ScriptAutomate left a comment

Choose a reason for hiding this comment

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

EDIT: Conversation with @sagetherage shows that my review comments here warrant a follow-up PR because of needed discussion with others down the pipeline around release generation where we need to ensure filename changes and deletion of files doesn't impact the build/release pipeline. I'm going to create a follow-up issue.

I'm wondering whether we can do the following:

# HACKING.rst -> CONTRIBUTING.md
pkg/suse/salt.spec:782:%doc LICENSE AUTHORS README.rst HACKING.rst README.SUSE
MANIFEST.in:4:include HACKING.rst
# CONTRIBUTING.rst -> CONTRIBUTING.md
MANIFEST.in:3:include CONTRIBUTING.rst

That, or we go with CONTRIBUTING.rst, and have the file get pulled in as the new contents of https://docs.saltstack.com/en/latest/topics/development/hacking.html (and rst include call), where we then will have the contributing guide in both the GitHub repo root (for easy access and reference via GitHub or source code), and in the Sphinx-generated documentation, without having duplicate files.

This would do some nice, significant cleanup and reduce a lot of confusion. Either it should be done within this PR, or in a PR directly following the merge of this PR.

ScriptAutomate
ScriptAutomate previously approved these changes Dec 10, 2020
Copy link
Contributor

@barbaricyawps barbaricyawps left a comment

Choose a reason for hiding this comment

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

I have more to say but I'm posting what I've reviewed so far.

HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated
brew update
brew install pyenv
brew install pyenv-virtualenv

Copy link
Contributor

@barbaricyawps barbaricyawps Dec 10, 2020

Choose a reason for hiding this comment

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

Chore: We might want to ask @twangboy to write the section about how to set up a Windows environment.

Copy link
Contributor

@barbaricyawps barbaricyawps Jan 7, 2021

Choose a reason for hiding this comment

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

Maybe open a separate issue for this chore and you can resolve this comment.

HACKING.md Outdated

So you want to contribute to the Salt project? Excellent! You can help in a
number of ways:

Copy link
Contributor

Choose a reason for hiding this comment

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

NOTE: I use the conventional comments method of PR reviewing.

Chore: Let's define what contributing means and what kinds of contributions we're looking for. I'm a big fan of the All Contributors Project statement that advocates for "recognizing contributors to an open source project in a way that rewards each and every contribution, not just code."

I don't think this is actually on you to do this in this PR, which is why I marked it as a follow-up chore. We need to maybe need to add this to the Open agenda and discuss it and then document the decision here. We could even go so far as considering adding the All Contributor's bot to our project, but that would require an SEP for sure. Could you help me open a ticket it or add it to the appropriate agenda and make sure I'm invited wherever that discussion occurs?

HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
HACKING.md Outdated Show resolved Hide resolved
@waynew
Copy link
Contributor Author

waynew commented Dec 17, 2020

Let's try this one 👍

Comment on lines +583 to +589
If the value is less than 2047, you should increase it with:

SaltStack uses several labeling schemes to help facilitate code contributions
and bug resolution. See the :ref:`Labels and Milestones
<labels-and-milestones>` documentation for more information.
::

Mentionbot
----------
ulimit -n 2047
# For c-shell:
limit descriptors 2047
Copy link
Contributor

Choose a reason for hiding this comment

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

I did an audit of other open PRs, just in case there may need to be additional edits here, and I noticed this in #56391:

https://github.com/saltstack/salt/pull/56391/files?file-filters%5B%5D=.rst#diff-d4ef981b7725173c30d3e321db8d335dbf3419243e13699514cd1efad2d9f094R244-R247

The ulimit value is being adjusted to 3072. I'm not sure whether this is required or not, as I haven't gone this deep into the development where I was needing to adjust my ulimit -n value away from my dev system default of 1024 to 2047 or greater.

Whatever we decide on that (to update the value or not), we could actually close out #56391 because the rest of that PR is specific to Python 2, which is no longer supported by current versions of Salt. I've closed out #58128 as this PR will also supersede the need for it.

ScriptAutomate
ScriptAutomate previously approved these changes Jan 4, 2021
s0undt3ch
s0undt3ch previously approved these changes Jan 5, 2021
@krionbsd krionbsd self-requested a review January 6, 2021 07:57
krionbsd
krionbsd previously approved these changes Jan 6, 2021
Copy link
Contributor

@barbaricyawps barbaricyawps left a comment

Choose a reason for hiding this comment

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

Praise: I'm loving this so much, Wayne. Gigantic improvement over the old style.

Summary: I have some minor quibbles that need to be resolved before I will feel comfortable giving my final approval. All of them are very quick fixes.

`Git <https://git-scm.com/>`__, a common version control tool used
across many open source projects, and is necessary for contributing to
salt. For an introduction to Git, watch `Salt Docs Clinic - Git For the
True
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick (blocking): I recommend always capitalizing Salt.

Sending a GitHub pull request
-----------------------------
Sweet! Now you’re ready to clone salt so you can start hacking away! If
you get stuck at any point, check out the resources at the beginning of
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick (blocking): I recommend always capitalizing Salt.


.. code-block:: bash
This creates a shallow clone of salt, which should be fast. Most of the
time that’s all you’ll need, and you can start building out other
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick (blocking): I recommend always capitalizing Salt.

enables us to run multiple different test configurations, as well as
other common tasks. You can think of it as Make with superpowers.
Pre-commit does what it sounds like - it configures some Git pre-commit
hooks to run ``black`` for formatting, ``isort`` for keeping our imports
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nitpick (non-blocking): Can you change the dash to a colon to satisfy my inner grammar nerd, please? :)

"Pre-commit does what it sounds like: it configures some Git pre-commit.."

.. code-block:: bash
.. warning::
Currently there is an issue with the pip-tools-compile pre-commit hook on windows.
The details around this issue are included here:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick (blocking): Please capitalize Windows. (But for the record, I care more about it for Salt than Windows.)

The first time this will take a while because there are a *lot* of
modules. Maybe you should go grab some dessert if you already finished
that sandwich. But once Sphinx is done building the docs, python should
launch your default browser with the URL
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick (blocking): I recommend capitalizing Python.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case I'll disagree: it's python the executable, not Python the language, that's launching the browser.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me. I'll defer to you. :)

https://help.github.com/en.
If your change is a doc-only change, you can go ahead and commit/push
your code and open a PR. You can indicate that it’s a doc-only change by
adding ``[Documentation]`` to the title of your PR. Otherwise you’ll
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nitpick (non-blocking): Can you say "docs-only" instead with the plural?

"If your change is a docs-only change, you can go ahead and commit/push
your code and open a PR. You can indicate that it’s a docs-only change by..."

----------------------
If you’d rather not use ``kill``, you can have a couple of terminals
open with your salt virtualenv activated and omit the ``--daemon``
argument. Salt will run in the foreground, so you can just use ctrl+c to
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick (blocking): I recommend capitalizing Salt here too. "...your Salt virtualenv..."

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'll disagree here too: I'm referring to the name of the virtualenv, salt.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll defer to you. That's fine.

And that’s all that would go into your file. When it comes to your
commit message, it’s usually a good idea to add other information - what
does a reviewer need to know about the change that you made? If someone
isn’t an expert in this area, what will they need to know?

Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting recommendation (non-blocking): I like putting things in bullet points when I have a list of two or more things. I recommend:

And that’s all that would go into your file. When it comes to your
commit message, it’s usually a good idea to add other information, such as

  • What does a reviewer need to know about the change that you made?
  • If someone isn’t an expert in this area, what will they need to know?

passing and we’re not in a code freeze, ideally your code will be merged
that day. If you haven’t heard from your assigned reviewer, ping them on
GitHub, `irc <https://webchat.freenode.net/#salt>`__, or Community
Slack.

Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Are you sure we can keep this commitment to review a PR in one business day? That hasn't been my experience when contributing to Salt and I just worry about making a commitment we can't keep.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The goal is that we should at least be able to leave some sort of feedback within a business day. That's definitely not been the case typically, but that's not because it can't be done - we just haven't prioritized it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like your "can-do" attitude. Feel free to leave this as-is. :)

@waynew
Copy link
Contributor Author

waynew commented Jan 7, 2021

@barbaricyawps got those cleaned up! 👍

Copy link
Contributor

@barbaricyawps barbaricyawps left a comment

Choose a reason for hiding this comment

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

@waynew , approved!

@krionbsd krionbsd self-requested a review January 11, 2021 16:50
@dwoz dwoz merged commit 66b4479 into saltstack:master Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aluminium Release Post Mg and Pre Si Documentation Relates to Salt documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test Suite Documentation Lacks Details