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

Workflow for contributors #5

Closed
milancurcic opened this issue Dec 14, 2019 · 21 comments
Closed

Workflow for contributors #5

milancurcic opened this issue Dec 14, 2019 · 21 comments
Labels
meta Related to this repository

Comments

@milancurcic
Copy link
Member

Use this issue to discuss the workflow that we should adopt. This will eventually become part of the Workflow doc

For the time being:

  • Use What should be part of stdlib? #1 to broadly discuss what should be part of stdlib;
  • Open a new issue for a specific proposal;
  • Once the proposal gets reasonably enough discussion and support from the community, open a pull request to add code to the stdlib;
  • We can flesh out the specific requirements regarding quality control and similar in this thread.

We can also discuss the preferred git/GitHub workflows for contributing to the reop, such as feature branches, pull requests, etc.

@milancurcic milancurcic added the meta Related to this repository label Dec 14, 2019
@zbeekman
Copy link
Member

CD and conventional commits/automatic semantic versioning

I propose we adopt conventional commits https://www.conventionalcommits.org/en/v1.0.0/ and semantic versioning https://semver.org.

Conventional commits are a means of ensuring compliance with semver and automating the release process and changelog generation.

As such I propose master is where stable code is continuously delivered and released, devel is a protected development branch and all contributions are done via a forking workflow on feature branches (on the contributors fork).

@certik
Copy link
Member

certik commented Dec 17, 2019

The "conventional commits" is an interesting idea, but it seems way too complicated, and for that reason the projects that are listed there as example projects do not actually follow it, e.g.:

The reason is that most new contributors do not know how to format their commits properly, and thus you can either reject such contributions or it puts more work on project maintainers to rebase / squash commits properly, and squashing is bad because it destroys history and removes attribution if there is more than one author in the PR.

A better approach is to tie the changelog to the PR itself, not the individual commits. We do that in SymPy, here is an example:

And here is documentation about how it works: https://github.com/sympy/sympy/wiki/Writing-Release-Notes. We have a tool that creates the release notes automatically from the description in the PR. That way the project maintainers can easily create proper changelog description for each PR that anybody submits, and there is no need to rewrite commit history, so it scales well with people.

@zbeekman
Copy link
Member

I agree that conventional commits can be a little bit awkward. However I've developed CMake modules for some of my projects that detect when being built from a git repository, install (locally) the required npm modules, and then inject a git hook so that git commit really fires up git-cz. After the interactive commit formatting via git-cz the message is opened in your editor for review and modification.

The largest benefit of this is that commit messages end up clearly indicating breaking changes, and what types of changes were made, not to mention the large eco-system of tools for automatically releasing, versioning, creating changelogs, etc.

But this is not my hill to die on, and the reduced complexity and/or burden on contributors might be worth not using conventional commits. Basically, you can trade burden on committers for complexity in ensuring people have git hooks setup properly etc.

@milancurcic
Copy link
Member Author

I took a look at Conventional Commits and am personally not a fan. Seems like a lot of technical bureaucracy for not much reward. I don't think I've written more than a single-line, simple sentence commit message.

Changelogs in PR make sense to me.

Semver.... sure. This becomes meaningful at scale when people start using this in production. We'll probably be in 0.1.x for some time.

I like the master for latest stable and develop in feature branches, e.g. feature/ascii or similar.

@zbeekman
Copy link
Member

Sure, that's fine. They have a nice tool that holds your hand as you write the commit message and can be installed as a hook. But I'm happy to use less structured commit messages if people prefer.

@milancurcic
Copy link
Member Author

Let's bring back the discussion on workflow. We're very early on in the project and learning as we go what will work best for this community. Let's keep the discussion to how we work as people and open separate issues for topics such as versioning or any CI-related technicalities.

What do you think about this flow:

  1. You have an idea or a proposal. Open an issue to discuss it. This is on the level of "is there interest in having image reader/writer functions in stdlib?"
  2. When there seems to be significant interest in the proposal, like 80/20 participants think it's a good/bad idea, move on to discuss the specific API. It's OK to propose the API off the bat if you already have an idea for it.
  3. Discuss the API and iterate. When there is ~80/20 approval for the API, move on to implement it and submit a PR. Small PRs are always better than large. It's OK to implement only a few functions of a new module, and continue work on the others in a later PR.
  4. When opening a PR, request reviews from one or more people that are most relevant to it. These are likely to be people involved in prior steps of the workflow. Other contributors (not explicitly invited) may provide reviews and suggestions as well. Iterate until all (or most) participants are on the same page. We should never merge before requested reviewers approve.

@certik
Copy link
Member

certik commented Dec 31, 2019

@milancurcic in addition, I would mention in step 3. that new features go into "experimental" modules. In step 4. I would change the wording from "Other contributors (not explicitly invited) may provide reviews and suggestions as well." to "Other contributors (not explicitly invited) are encouraged to provide reviews and suggestions as well." I would change "We should never merge before requested reviewers approve." to "We should not merge if there is a very strong objection from the reviewers or from somebody in the wider community."

Finally, we need to figure out a step "5. Moving from experimental to main". We can get there in few months once we get actual real world usage of the features in experimental.

@zbeekman zbeekman mentioned this issue Dec 31, 2019
@zbeekman
Copy link
Member

zbeekman commented Jan 2, 2020

I agree with the proposal above from @milancurcic and suggestions from @certik.

A more logistical question: Do we always want to merge PRs with non-fast-forward merge commits? Do we ever want to be able to fast-forward merge? Or rebase then fast-forward? (no merge commit created)

The potential advantage of this is that it makes git history easier to understand and simpler. The disadvantage is that it can be harder or less obvious to figure out how to revert an entire merge/PR.

In general, I'm against fast-forward merges of PRs, but recently I have been seeing the appeal for using them in simple cases where there are only one or two commits and the changes in question are well contained.

@certik
Copy link
Member

certik commented Jan 2, 2020

I would keep using the default merge commits --- the main advantage that I can see is that when I need to find the associated discussion and review for a given commit in history, one just has to find the merge commit and it has the PR number in it, so one can go to GitHub and read the discussion to understand why it was merged.

@zbeekman
Copy link
Member

zbeekman commented Jan 2, 2020

ah, I see. So you'd advocate against doing a local merge and push as well. In that case I will refrain from doing that too! (And, I didn't think of that, but for this project that is an extremely compelling case to merge through the GH interface given the amount of discussion we can expect on PRs! Good call!)

@certik
Copy link
Member

certik commented Jan 2, 2020

@zbeekman Yes, exactly. I don't think local merge and push is even allowed is it? I thought I disabled it.

Update: I guess it might still be allowed. In GitLab I always disable direct pushes into master (it's actually really easy to make a mistake and push into the master by accident!), but I guess that is not possible in GitHub? The master branch protection is enabled and "Require status checks to pass before merging", so I thought that would disable direct pushes, because then obviously one cannot guarantee that the CI will pass. But I guess it does not do that.

Either way, yes, please let's not push directly to master. Always create a PR, and always get the PR reviewed and all tests pass before merging.

@zbeekman
Copy link
Member

zbeekman commented Jan 2, 2020

Either way, yes, please let's not push directly to master. Always create a PR, and always get the PR reviewed and all tests pass before merging.

If you set master a protected branch then you aren't allowed to push directly to master, unless doing so is equivalent to closing the PR. So you can push a merge commit that corresponds to an open PR and closes it. Then depending on the other settings (i.e. allow squash and rebase) you might be able to also do that locally and push.

Anyway, I'll merge through the online web interface going forwards. It has some downsides (like merge commits created that way won't be signed with my GPG signing key, but they might be signed with a different GH key) but that's fine and preserving the default merge comment is worth it.

@zbeekman
Copy link
Member

zbeekman commented Jan 2, 2020

(and, just FYI, I would never intentionally push anything to master other than a merge commit to close an open PR, but I will refrain from doing that as well)

certik added a commit to certik/stdlib that referenced this issue Jan 6, 2020
@certik
Copy link
Member

certik commented Jan 6, 2020

I discussed this with @nncarlson and we both think the final 5. step should be to write a "specification". As an example, we think the current open function in src/stdlib_experimental_io.f90 is read for it. The specification is an independent document that describes the API and the functionality, so that anyone can then create an implementation just based on the document. stdlib then provides a reference implementation. And it is this specification document that should be "approved", by the wide community and hopefully also informally by the standards committee. And if it gets "approved", we can then move code from "experimental" to "main".

I created #94, where I tried to write down this workflow based on the above discussion.

certik added a commit that referenced this issue Jan 7, 2020
Document workflow based on the discussion in #5
@jvdp1
Copy link
Member

jvdp1 commented Jan 19, 2020

The specification is an independent document that describes the API and the functionality, so that anyone can then create an implementation just based on the document.

Where should this document be saved? Next to the .f90 file? What about the format (.md)? Wht about the name (e.g., stdlib_experimental_io.md for stdlib_experimental.f90)?

@certik
Copy link
Member

certik commented Jan 19, 2020

@jvdp1 thanks for staring a discussion about this.

I was hoping the specification would be in some form that we can then automatically generate online html documentation (as well as perhaps a pdf document?). Also I was hoping we could somehow automatically understand the types of the arguments, something like FORD.

Format should be Markdown I think.

So one option is stdlib_experimental_io.md for stdlib_experimental_io.f90. The other option is inline inside stdlib_experimental_io.f90 like FORD.

Why don't we start with stdlib_experimental_io.md to get started. We can discuss how to automate it further as we go.

jvdp1 referenced this issue in jvdp1/stdlib Jan 21, 2020
Squashed commit of the following:

commit 3266163
Merge: e96c12d 4274f0d
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 20:47:32 2020 +0100

    modification of CMake and Makefile

    Merge branch 'stat_cmake' into stat_dev

commit 4274f0d
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 20:44:24 2020 +0100

    stat_cmake: update Makefile

commit 17e3d16
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 20:35:19 2020 +0100

    second try cmake

commit 397eb18
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 20:18:37 2020 +0100

    Modifications of CMake for tests on Ubuntu 7

commit e96c12d
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 19:40:05 2020 +0100

    small change in md

commit 7eec9ae
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 19:37:06 2020 +0100

    stat_dev: renamed stat to stats

commit 8199b6d
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 19:26:20 2020 +0100

    stat_dev: changed spec

commit b1c481d
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 19:15:25 2020 +0100

    stat_dev: modifs following comments

commit e64657c
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 14:23:59 2020 +0100

    stat_dev: addition of .md file for mean

commit ad504e8
Merge: 5a1adcb bab50e3
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 13:16:21 2020 +0100

    Merge remote-tracking branch 'jvdp1/stat_dev_1' into stat_dev

commit bab50e3
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 13:13:00 2020 +0100

    stat_dev_1: changed all to iterations

commit 8d4c11f
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 10:31:26 2020 +0100

    stat_dev_1:moved all calls to mean functions to loops

commit 922e523
Author: Vandenplas, Jeremie <[email protected]>
Date:   Tue Jan 21 09:13:10 2020 +0100

    stat_dev_1: update test_mean

commit 5a1adcb
Author: Vandenplas, Jeremie <[email protected]>
Date:   Mon Jan 20 23:55:15 2020 +0100

    stat_dev: inverting loops for efficiency

commit 86970ae
Author: Vandenplas, Jeremie <[email protected]>
Date:   Mon Jan 20 22:54:55 2020 +0100

    stat_dev: use specific interface

commit 6574a67
Author: Vandenplas, Jeremie <[email protected]>
Date:   Mon Jan 20 22:36:33 2020 +0100

    stat_dev: addition of calls to error_stop

commit e98090b
Author: Vandenplas, Jeremie <[email protected]>
Date:   Mon Jan 20 21:32:27 2020 +0100

    stat_dev: extension to rank 15

commit e0e3092
Author: Vandenplas, Jeremie <[email protected]>
Date:   Mon Jan 20 12:46:44 2020 +0100

    stat_dev: simplified merge

commit 22ff6e4
Author: Vandenplas, Jeremie <[email protected]>
Date:   Mon Jan 20 10:38:41 2020 +0100

    stat_dev: progress rank 3

commit 7612613
Author: Vandenplas, Jeremie <[email protected]>
Date:   Mon Jan 20 10:34:06 2020 +0100

    stat_dev: add rank 3

commit 60ab523
Author: Vandenplas, Jeremie <[email protected]>
Date:   Sun Jan 19 22:14:51 2020 +0100

    stat_dev: addition of integer cases

commit 6fb6ca5
Author: Vandenplas, Jeremie <[email protected]>
Date:   Sun Jan 19 21:03:46 2020 +0100

    stat_dev: avoid allocatable functions

commit a1c6353
Author: Vandenplas, Jeremie <[email protected]>
Date:   Sun Jan 19 20:11:49 2020 +0100

    modification to have the same behaviour as Fortran sum

commit 72500e1
Author: Vandenplas, Jeremie <[email protected]>
Date:   Sun Jan 19 15:23:34 2020 +0100

    stat_dev: add error_stop

commit 1272574
Author: Vandenplas, Jeremie <[email protected]>
Date:   Sun Jan 19 15:02:52 2020 +0100

    stat_dev: update Makefile

commit 426d43f
Author: Vandenplas, Jeremie <[email protected]>
Date:   Sun Jan 19 12:21:09 2020 +0100

    stat_dev: addition of test and creation of modules and submodules with fypp

    how to use pure functions inside submodules

commit 965f37b
Author: Vandenplas, Jeremie <[email protected]>
Date:   Sun Jan 19 11:35:11 2020 +0100

    moved to submodules

    how to use pure functions in submodules

commit d9af336
Author: Vandenplas, Jeremie <[email protected]>
Date:   Sun Jan 19 11:22:52 2020 +0100

    stat_dev: init

commit dc7e49b
Merge: f300f4a cb7cf71
Author: Ondřej Čertík <[email protected]>
Date:   Tue Jan 14 11:11:12 2020 -0700

    Merge pull request fortran-lang#109 from nncarlson/target-include

    Update CMakeLists handling of .mod files

commit cb7cf71
Author: Neil Carlson <[email protected]>
Date:   Mon Jan 13 16:38:12 2020 -0700

    Update CMakeLists handling of .mod files

commit f300f4a
Merge: 12bd060 0ea0ee1
Author: Milan Curcic <[email protected]>
Date:   Wed Jan 8 18:20:09 2020 -0500

    Merge pull request fortran-lang#54 from scivision/systemlib

    add system module

commit 0ea0ee1
Author: Michael Hirsch, Ph.D <[email protected]>
Date:   Mon Jan 6 11:41:46 2020 -0500

    make sleep test automated check with system_clock

commit c8974dc
Author: Michael Hirsch, Ph.D <[email protected]>
Date:   Mon Dec 30 16:20:55 2019 -0500

    add system module

    There are a number of capabilities it would be useful to bring from
    cstdlib and STL. This is an initial demonstration, replacing
    the non-cross-compiler sleep() with a standard implmeentation that
    works across compilers and operating systems, with millisecond integer
    input.

commit 12bd060
Merge: 006beda e1d861d
Author: Ondřej Čertík <[email protected]>
Date:   Wed Jan 8 11:52:06 2020 -0700

    Merge pull request fortran-lang#97 from certik/goals

    Add Goals and Motivation section into README

commit e1d861d
Author: Ondřej Čertík <[email protected]>
Date:   Wed Jan 8 10:00:27 2020 -0700

    Update README.md

commit ca4554a
Author: Ondřej Čertík <[email protected]>
Date:   Wed Jan 8 09:49:39 2020 -0700

    Add Goals and Motivation section into README

commit 006beda
Merge: 1926ade e81d295
Author: Ondřej Čertík <[email protected]>
Date:   Tue Jan 7 15:41:39 2020 -0700

    Merge pull request fortran-lang#94 from certik/workflow

    Document workflow based on the discussion in #5

commit e81d295
Author: Ondřej Čertík <[email protected]>
Date:   Tue Jan 7 08:20:24 2020 -0700

    Update the workflow based on feedback

commit 1926ade
Merge: 7a6108e f857482
Author: Ondřej Čertík <[email protected]>
Date:   Tue Jan 7 08:01:39 2020 -0700

    Merge pull request fortran-lang#96 from nshaffer/dev-optval

    Make optval pure or pure elemental where possible

commit f857482
Merge: 274a2bb 7a6108e
Author: Ondřej Čertík <[email protected]>
Date:   Tue Jan 7 07:48:17 2020 -0700

    Merge branch 'master' into dev-optval

commit 274a2bb
Author: Nathaniel Shaffer <[email protected]>
Date:   Tue Jan 7 07:00:21 2020 -0700

    add tests for 1d arrays (reals, ints, logical)

commit e06e322
Author: Nathaniel Shaffer <[email protected]>
Date:   Tue Jan 7 06:58:14 2020 -0700

    add "elemental" and/or "pure" attributes where possible

commit 92926e0
Author: Ondřej Čertík <[email protected]>
Date:   Mon Jan 6 15:01:31 2020 -0700

    Make the specification requirement part of step 3.

commit 1f56d0d
Author: Ondřej Čertík <[email protected]>
Date:   Mon Jan 6 12:09:48 2020 -0700

    Document workflow based on the discussion in #5

commit 7a6108e
Merge: e2b0cda a606606
Author: Izaak "Zaak" Beekman <[email protected]>
Date:   Mon Jan 6 13:02:55 2020 -0500

    ci ctest enhancements (fortran-lang#92)

    Merge [scivision:citime] into master

    [scivision:citime]: https://github.com/scivision/stdlib/tree/citime

commit a606606
Author: Michael Hirsch, Ph.D <[email protected]>
Date:   Mon Jan 6 11:50:17 2020 -0500

    ci ctest enhancements

commit e2b0cda
Merge: 57d99f8 f0a6886
Author: Ondřej Čertík <[email protected]>
Date:   Mon Jan 6 08:01:24 2020 -0700

    Merge pull request fortran-lang#90 from certik/stream

    Use access = "stream" by default

commit f0a6886
Author: Ondřej Čertík <[email protected]>
Date:   Mon Jan 6 07:56:18 2020 -0700

    Update src/stdlib_experimental_io.f90

    Co-Authored-By: Jeremie Vandenplas <[email protected]>

commit 05540fd
Author: Ondřej Čertík <[email protected]>
Date:   Mon Jan 6 07:52:24 2020 -0700

    Use access = "stream" by default

commit 57d99f8
Merge: c3e4816 d845f2d
Author: Ondřej Čertík <[email protected]>
Date:   Mon Jan 6 07:42:42 2020 -0700

    Merge pull request fortran-lang#89 from pdebuyl/qsavetxt_format_string

    Use explicit formatting in qsavetxt

commit d845f2d
Author: Pierre de Buyl <[email protected]>
Date:   Mon Jan 6 10:35:55 2020 +0100

    Use explicit formatting in qsavetxt
milancurcic pushed a commit that referenced this issue Jan 27, 2020
@MarDiehl
Copy link
Contributor

I would strongly recommend to accept only functionality that comes with a set of unit tests for all relevant use cases. It might be a little bit pessimistic, but I consider code without test as broken until a unit test convinces me from the opposite

@certik
Copy link
Member

certik commented May 30, 2020

@MarDiehl that is exactly what we do. Every PR has to have tests for all new functionality before it gets merged.

@MarDiehl
Copy link
Contributor

@MarDiehl that is exactly what we do. Every PR has to have tests for all new functionality before it gets merged.
👍

@milancurcic
Copy link
Member Author

@certik is right that we do this for every feature PR, but @MarDiehl raises an important point: This isn't obvious from the workflow doc. We should require tests in step 4 (implementation).

@MarDiehl Do you mind opening a PR to add a brief statement about tests in the workflow doc?

(of course, this can't answer the question what makes good and sufficient tests)

@milancurcic
Copy link
Member Author

We have an established workflow that we've been mostly following for a while now. I will close this and we can tackle any problems that come up in the future as specific issues.

awvwgk pushed a commit that referenced this issue Jun 3, 2021
Add checks on `work` and `iwork`
jvdp1 pushed a commit that referenced this issue Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Related to this repository
Projects
None yet
Development

No branches or pull requests

5 participants