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

docs: Docathon 📚 #22

Merged
merged 48 commits into from
Mar 24, 2025
Merged

docs: Docathon 📚 #22

merged 48 commits into from
Mar 24, 2025

Conversation

gmertes
Copy link
Member

@gmertes gmertes commented Mar 18, 2025


📚 Documentation preview 📚: https://anemoi--22.org.readthedocs.build/en/22/

@FussyDuck
Copy link

FussyDuck commented Mar 18, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
4 out of 5 committers have signed the CLA.

✅ gmertes
✅ b8raoult
✅ HCookie
✅ VeraChristina
❌ corentincarton
You have signed the CLA already but the status is still pending? Let us recheck it.

@gmertes gmertes changed the title docs: Docathon docs: Docathon 📚 Mar 18, 2025
@floriankrb
Copy link
Member

Great work. Reviewing in readthedocs, I noticed a few things:

_ Should we tell contributors to avoid rewriting history in their PR branches, or not ?

_ in https://anemoi--22.org.readthedocs.build/en/22/contributing/code_style.html
add a link to the .precommit.yaml file ?
"Public API before private implementations." this seems strange. I would do the reverse.

_ is this duplicated doc for "testing" ?
https://anemoi--22.org.readthedocs.build/en/22/contributing/guidelines.html#testing
https://anemoi--22.org.readthedocs.build/en/22/contributing/testing.html

_ "longtests" is not an English word in "@pytest.mark.longtests". I would rather have @pytest.mark.large and/or @pytest.mark.@long

_ in "Configuration Handling", it seems that the "#." syntax is buggy.

@gmertes
Copy link
Member Author

gmertes commented Mar 20, 2025

Should we tell contributors to avoid rewriting history in their PR branches, or not ?

Since it will get squashed anyway, does that matter? (just curious)

@VeraChristina
Copy link
Contributor

VeraChristina commented Mar 20, 2025

Thanks for the feedback!

_ is this duplicated doc for "testing" ? https://anemoi--22.org.readthedocs.build/en/22/contributing/guidelines.html#testing https://anemoi--22.org.readthedocs.build/en/22/contributing/testing.html

The "Testing Guidelines" are quite long, so we decided to separate them out and only have a brief section in contributing guidelines with a reference. Since this seems to not have been clear I have shortened that section (also to avoid redundancies), and made the reference to guidelines more explicit -- hope it is more clear now.

_ "longtests" is not an English word in "@pytest.mark.longtests". I would rather have @pytest.mark.large and/or @pytest.mark.@long

I would prefer to not address this in this PR since it requires a change in the testing code. Can you raise this issue in anemoi-core?

_ in "Configuration Handling", it seems that the "#." syntax is buggy.

Good spot! Fixed.

@floriankrb
Copy link
Member

Should we tell contributors to avoid rewriting history in their PR branches, or not ?

Since it will get squashed anyway, does that matter? (just curious)

When developing on your own, I like to commit very often on my local clone, so I don't lose my work and I can stash when things get bad. Usually, I don't want to expose all these drafts to the public view, so, I git rebase -i to play around with my commits until I have something I actually want to share, and only then I push.
_ When I am the only one editing the PR code, I feel free to rewrite history in my PR branch and push more often.
_ But not when I am working with others and want to share the current state of the branch. In this case, I do not rewrite history because this will cause issues when they pull.

In a "best practice guideline", we could encourage one behaviour or another. But we also could say nothing about it, as you wrote, this does not matter for the final state of the code in the package : once it has been merged, all these commits are hidden.

Copy link
Contributor

@aaron-hopkinson aaron-hopkinson left a comment

Choose a reason for hiding this comment

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

A definite improvement and a good starting point to build on in the future. Thanks!

(Added a few comments - feel free to accept/reject these as you see fit)


.. code:: bash

git clone https://github.com/ecmwf/anemoi-core/
Copy link
Contributor

Choose a reason for hiding this comment

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

The line below is for a generic package - should this also be generic (rather than core)? (Maybe we could tie in with the variable suggestion below?)

Also, should we instead prefer the use of ssh over https? I feel like I once read that GitHub was encouraging ssh over https, but I might be wrong...

(That said, if we recommend ssh, we may want to point people at this GitHub page for help getting set up)

Copy link
Contributor

Choose a reason for hiding this comment

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

NB: The README.md file in this repo recommends ssh

Copy link
Contributor

Choose a reason for hiding this comment

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

See above (as to package vs core)
I haven't changed to ssh for now -- different question: does this even make sense given that this is the public documentation and we are assuming people are working on forks?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point - copying over my comment from Teams for visibility to others.

I think if you want to cover the forked repo workflow, you could either: run through the GitHub forking process, then tell people to clone their fork, and then set up upstream as a remote, and then explicitly set no_push on upstream. Or: clone upstream, and if people want to fork, set up the fork as a remote.

Branching Guidelines
**********************

- Use feature branches for new features (e.g., `feature/your-feature`)
Copy link
Member Author

Choose a reason for hiding this comment

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

For consistency we should recommend semantic commit keywords, so feat/your-feature

Copy link
Contributor

Choose a reason for hiding this comment

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

Challenge: if it's on a personal fork, does it matter?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, but also doesn't hurt to at least keep the example consistent -- which it now is. (I think this is one of several places where we don't exclusively have the "fork case" in mind. But I also don't think that this particular bit overburdens users -- happy for people to disagree.)

Comment on lines 65 to 67
While these commit message conventions are recommended for all branches
in Anemoi, they are strictly enforced only for commits to the ``main``
branch. This enforcement is particularly important as our automated
Copy link
Member Author

Choose a reason for hiding this comment

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

While this is true, it can be confusing to talk about commits to main when contribors don't commit to main directly.

Instead, I would say that it's only enforced for the PR titles. You already say this in the next section, but I would reiterate it here.

I would maybe even not talk about "commit guidelines" at all, but only talk about "PR title guidelines". Since the commits that users do inside their own branch don't really matter at all imo. When you review PRs you just look at the code changes, not at the commit messages.

Copy link
Contributor

Choose a reason for hiding this comment

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

More flexibility in commit messages is something I approve of. I think the fewer rules we impose before things get to the PR/merging stage, the better - at least in terms of reducing the barriers to contributing.

Copy link
Contributor

Choose a reason for hiding this comment

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

But I can absolutely see why having some enforcement around the PR merge-sqaush-commit is helpful :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Very good point. Have changed updated the "commit guidelines" (now "PR title guidlines") accordingly

Copy link
Contributor

@VeraChristina VeraChristina Mar 21, 2025

Choose a reason for hiding this comment

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

On Aaron's point, the wording is now that we "recommend" this for commits more generally -- hope that leaves enough room (as it's under PR title guidelines, not commit guidelines)

@aaron-hopkinson
Copy link
Contributor

aaron-hopkinson commented Mar 21, 2025

When developing on your own, I like to commit very often on my local clone, so I don't lose my work and I can stash when things get bad. Usually, I don't want to expose all these drafts to the public view, so, I git rebase -i to play around with my commits until I have something I actually want to share, and only then I push.

@floriankrb I do this too, and think it's good practice to try to clean up your git history before creating a PR (although I'm not always perfect at this...). Once the code's public, I think we should generally try to avoid rewriting history/force pushing in order to avoid inconveniencing other people.

That said, draft PRs are a good way of getting feedback while the code is still being developed (and something we encourage in the docs) - and are explicitly not in a mergeable state - so maybe we could say that you're free to do whatever you want on a draft PR, but if it's a proper PR (i.e. intended to be merged), then we probably shouldn't be rewriting history from that point on? That seems like a sensible balance to me. What do you think?

@HCookie HCookie merged commit 8daacb6 into main Mar 24, 2025
5 of 6 checks passed
@HCookie HCookie deleted the Docathon branch March 24, 2025 17:28
HCookie added a commit that referenced this pull request Mar 24, 2025
Co-authored-by: Harrison Cook <[email protected]>
Co-authored-by: Corentin Carton de Wiart <[email protected]>
Co-authored-by: Baudouin Raoult <[email protected]>
Co-authored-by: Vera Gahlen <[email protected]>
Co-authored-by: aaron-hopkinson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

8 participants