mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[Feature Request] DX: Change the default branch of modularml/mojo from `main` to `nightly`

Open gabrieldemarmiesse opened this issue 9 months ago • 5 comments

Review Mojo's priorities

What is your request?

I would like a modularml admin to go to the settings of this repo and change the default branch to nightly, see https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/changing-the-default-branch

What is your motivation for this change?

  • Many (mostly new) contributors make the mistake of targeting main instead of nightly. This happens so many times that we even had to make a github action to check it in the CI.
  • Also when reading contributing guides and such from the github UI, it makes sense that future contributors read the latest version (from nightly) than the latest stable version.
  • The mojo repo in the github UI is not supposed to be accessed by non-contributors (except the readme maybe), as such, it doesn't matter which version of the code/docs appears first in the github UI

To conclude: There is very little value in keeping main as the default branch, we could switch it to nightly.

This should lower the number of quirks to remember/learn when contributing to this repo.

Any other details?

No response

gabrieldemarmiesse avatar May 06 '24 12:05 gabrieldemarmiesse

Thanks for filing this. Would love the community to +1 if this is important to other folks. The reason that the main branch is is the default right now is to support the users that download the released versions of Mojo and want to run the examples.

ematejska avatar May 06 '24 16:05 ematejska

While this is in no way the exact list of all the PRs that have wrongfully targeted main, here is the list of PRs that target main and were not accepted after the stdlib became open source: https://github.com/modularml/mojo/pulls?q=is%3Apr+base%3Amain++is%3Aunmerged+created%3A%3E2024-03-28 . That can be used as a data point to understand the problem I'm talking about.

If we assume that https://github.com/modularml/mojo/pulls?q=is%3Apr+base%3Anightly+is%3Aclosed+created%3A%3E2024-03-28+-author%3AJoeLoser+ is the list of PR merged in nightly by the community, the number of PRs that targeted the wrong branch by the community is around ~10% of all opened PRs, which is significant.

If I may add, new contributors aren't necessarily the ones that will +1 this, because it's a mistake that contributors make once and will never make again. So it might not seem important when the contributor has learned that nightly is the right target.

Maybe there is something we can work out about the examples to still keep this workflow while still changing the main branch? If someone from the community has an idea there it would be great :)

gabrieldemarmiesse avatar May 06 '24 17:05 gabrieldemarmiesse

+1 for this.

I would even prefer if the main branch is the current nightly branch for daily development. And, the stable branch is the current main branch for cutting release.

The reason that the main branch is is the default right now is to support the users that download the released versions of Mojo and want to run the examples.

Is it possible to redirect link to the release branch? If they jump into the repo instead of the official site, we can direct them with README.md

jayzhan211 avatar May 08 '24 01:05 jayzhan211

Would it help if there was a cross-platform bash script or something similar with the right git instructions that did the right thing to set up fix branch locally?

ksandvik avatar May 20 '24 20:05 ksandvik

Would it help if there was a cross-platform bash script or something similar with the right git instructions that did the right thing to set up fix branch locally?

I don't think the issue is here. The problem is in the github UI as mentionned in the issue description and a bash script won't change the UI.

gabrieldemarmiesse avatar May 21 '24 16:05 gabrieldemarmiesse

One another minor annoyance of not having the nightly branch as the default branch is that the issue templates and pull request templates used are the ones of the default branch, meaning any change to those will only be seen at the next release

gabrieldemarmiesse avatar May 25 '24 11:05 gabrieldemarmiesse

+1

siitron avatar May 26 '24 22:05 siitron

For motivating examples, I'm re-listing the PRs I mentioned on Discord:

  1. 2912
  2. 2881
  3. 2732
  4. 2697
  5. 2676
  6. 2665
  7. 2662
  8. 2656
  9. 2490
  10. 2478
  11. 2472
  12. 2343
  13. 2309
  14. 2301
  15. 2272
  16. 2221
  17. 2178
  18. 2039
  19. 2029
  20. 2028

(I'm not providing links because GitHub)

All these commits initially targeted the main branch; on retargeting the nightly branch, a whole bunch of commits got applied to them, inflating the commit number massively.

Brian-M-J avatar May 31 '24 12:05 Brian-M-J

For more motivating examples, here are all the PRs (and one issue) till now (which I could find) that suggested documentation fixes which were already applied in the nightly branch:

  1. 2890
  2. 2881
  3. 2750
  4. 2732
  5. 2512
  6. 2516
  7. 2508

Since the docs site syncs with main and not nightly, users see a lot of outdated information and errors. They then look at the repo and see that the repo's default branch (main) also has these errors, not realizing that they need to check nightly instead.

Brian-M-J avatar Jun 01 '24 13:06 Brian-M-J