@@ -8,6 +8,7 @@ This document is about issues and pull requests.
8
8
9
9
* [ Issues] ( #issues )
10
10
* [ Pull Requests] ( #pull-requests )
11
+ * [ Releases] ( #releases )
11
12
* [ Code Reviews] ( #code-reviews )
12
13
13
14
## Issues
@@ -515,6 +516,175 @@ Thank them for contributing. Encourage them if you feel this is going to be long
515
516
In short, try to make them want to contribute again. If they are stuck, try to provide them with
516
517
code yourself, or ping someone who can help.
517
518
519
+ ## Releases
520
+
521
+ ### Limitations and requests
522
+
523
+ Releases can be done by a limited number of persons.
524
+
525
+ We try to make releases as much as possible, but don't hesitate to mention ` @sonata-project/release-managers `
526
+ on your PR/issue comment to ask for a new release if needed.
527
+
528
+ Other contributors outside this team are not allowed to publish a release
529
+ but are encouraged to report release requests on the dedicated private Slack channel.
530
+
531
+ ### Minor releases and patch releases
532
+
533
+ Releasing software is the last step to getting your bugfixes or new features to your user base,
534
+ and should be done regularly, so that users are not tempted to use development branches.
535
+ To know what you are going to release on branch 42.x, given that the last release on this branch is 42.3.1,
536
+ go to ` https://github.com/sonata-project/SonataCoreBundle/compare/42.3.1...42.x ` .
537
+ You should see a list of commits, some of which should contain links to pull requests.
538
+
539
+ #### Determining the next release number
540
+
541
+ First of all, you MUST find the exact datetime of the last release.
542
+ Go to the project releases section and display the last release page:
543
+
544
+ ![ Release page] ( https://user-images.githubusercontent.com/1698357/39665568-d9dd74bc-5096-11e8-8c25-dff0d75ce717.png )
545
+
546
+ Then, click on the commit hash to show it and open the browser dev toolbar from the commit date:
547
+
548
+ ![ Commit page] ( https://user-images.githubusercontent.com/1698357/39665576-f9fa09ea-5096-11e8-8ddb-e5860a7b2122.png )
549
+
550
+ Then you know the exact datetime of the released commit is ` 2018-04-20T09:47:48Z ` . Copy it.
551
+
552
+ It's important to NOT use the tag datetime because the tag may be written later after the commit.
553
+
554
+ An alternative way to do this is to issue the following command in your shell:
555
+ ``` shell
556
+ git describe --abbrev=0 --tags| xargs git show --pretty=format:%aI --no-patch| tail -n 1
557
+ ```
558
+
559
+ After that, go on the pull requests page of the repo and replace the default filter by this one:
560
+
561
+ ```
562
+ base:3.x merged:>2018-04-20T09:47:48Z
563
+ ```
564
+
565
+ - ` base ` : The base branch where the PR are merged.
566
+ It MUST be the current stable branch, or the legacy branch where you want to make a release.
567
+ - ` merged ` : All the pull request merged ** after** the given datetime.
568
+
569
+ If any of those pull requests is labeled ` minor ` , then the next release should be a minor release (42.4.0).
570
+ Otherwise, if there are any pull requests labeled ` patch ` ,
571
+ the next release should be a patch release (42.3.2).
572
+ If there are neither minor nor patch pull requests, all the others should be labeled ` docs ` or ` pedantic ` ,
573
+ and you should not make a release.
574
+
575
+ ![ Pull requests page] ( https://user-images.githubusercontent.com/1698357/39665578-031aa2e6-5097-11e8-9f68-9ea32eec2b79.png )
576
+
577
+ In this case, it will be a patch release.
578
+
579
+ :warning : All the pull requests MUST have only one ` patch ` , ` minor ` , ` pedantic ` or ` docs ` label.
580
+ If you find a non-labelled PR or a ` major ` one, a mistake was made and MUST be fixed before the release.
581
+
582
+ #### Adding the release to the UPGRADE file
583
+
584
+ If there are any deprecations, then the release should be minor and the UPGRADE-42.x file should be changed,
585
+ moving the instructions explaining how to bypass the deprecation messages,
586
+ that should hopefully be there, to a new section named ` UPGRADE FROM 42.3.1 to 42.4.0 ` .
587
+
588
+ ``` patch
589
+ UPGRADE 42.x
590
+ ===========
591
+
592
+ + UPGRADE FROM 42.3.1 to 42.4.0
593
+ + =============================
594
+ +
595
+ ## Deprecated use of `getSchmeckles` in `Sonata\Defraculator\Vortex`
596
+ ```
597
+
598
+ #### Upgrading code comments and deprecation messages
599
+
600
+ All occurences of ` 42.x ` in comments or deprecation messages should be updating
601
+ by resolving ` x ` to its value at the time of the release.
602
+
603
+ :warning : You can do it quickly with a "Search and Replace" feature, but be careful not to replace unwanted matches.
604
+
605
+ #### Compiling the changelog
606
+
607
+ Each non-pedantic (and therefore non-docs) PR should contain a ` CHANGELOG ` section,
608
+ that you need to copy manually into the ` CHANGELOG.md ` file.
609
+ The title is in the following format :
610
+ ` [42.3.2](https://github.com/sonata-project/SonataNewsBundle/compare/42.3.1...42.3.2) - YYYY-MM-DD ` .
611
+
612
+ :warning : Do not hesitate to review the changelog before the copy.
613
+ The entries should be short, clear and must tell what have been fixed/improved for ** the end user** , not how.
614
+
615
+ #### Creating the release commit
616
+
617
+ The changes above should be added to a signed commit with the following message : ` 42.3.2 ` . Nothing else.
618
+ You MUST sign the tag with your GPG key, after which all you have to do is push it.
619
+ If you don't have push access, you can still create a PR with the relevant changes
620
+ and have them signed off by someone who has it.
621
+
622
+ Commands summary (we assume ` upstream ` corresponds to the Sonata repository):
623
+
624
+ ```
625
+ git commit -am 42.3.2
626
+ git tag -s 42.3.2 -m 42.3.2
627
+ git push upstream && git push upstream --tags
628
+ ```
629
+
630
+ #### Fill the release note on GitHub
631
+
632
+ Copy the changelog entries except the release number line and paste them on the release note form:
633
+
634
+ ![ Release note form] ( https://user-images.githubusercontent.com/1698357/39665555-bcf18aa0-5096-11e8-9249-dd7ea1eb15d2.png )
635
+
636
+ Submit the data, and you are done!
637
+
638
+ ### Major releases
639
+
640
+ Major releases should be done on a regular basis,
641
+ to avoid branches getting too far from their more stable counterparts:
642
+ the biggest the gap, the harder the merges are.
643
+ We use a 3 branch system, which means releasing 42.0.0 implies that:
644
+
645
+ - the master branch is aliased to 43.x;
646
+ - 42.x becomes the stable branch;
647
+ - 41.x becomes the legacy branch;
648
+ - 40.x is abandoned.
649
+
650
+ #### Preparing the unstable branch
651
+
652
+ - Every ` NEXT_MAJOR ` instruction should be followed ** before** the release.
653
+ - If possible, the latest version of every dependency should be supported
654
+ (` composer outdated ` shouldn't output anything).
655
+ - If sensible, the old major versions of every dependency should be dropped.
656
+
657
+ #### Pre-release cleanup
658
+
659
+ Before releasing anything, it is best to reduce the gap between branches:
660
+
661
+ - Merge the legacy branch into the stable branch.
662
+ - Merge the stable branch into the unstable branch.
663
+
664
+ #### Releasing last versions
665
+
666
+ Before abandoning it, the legacy branch MUST receive a last patch version.
667
+ Likewise, the stable branch MUST receive a last version if that version is minor,
668
+ it SHOULD receive one is that version is a patch version.
669
+
670
+ #### Creating the new stable branch and files
671
+
672
+ If the current major is ` 42 ` , a new ` 43.x ` branch should be created from master,
673
+ then a commit should be done on master to bump the ` branch-alias ` and version numbers in the README.
674
+
675
+ Also, the following files must be created/updated on the new stable branch:
676
+
677
+ - ` UPGRADE-43.x.md ` , containing only the main title
678
+ - ` UPGRADE-43.0.md ` , containing the upgrade notes fetched from the major PRs.
679
+ - ` CHANGELOG.md ` , containing the changelog of the major PRs.
680
+ - ` composer.json ` , the ` branch-alias ` MUST be changed to ` 43.x-dev `
681
+
682
+ Push the new branch with a commit containing the modified files and "43.x-dev" as comment.
683
+
684
+ #### Tagging the release
685
+
686
+ Finally, a signed tag should be created on the newly-created stable branch and the release note MUST be filled.
687
+
518
688
[ sphinx_install ] : http://www.sphinx-doc.org/en/stable/
519
689
[ pip_install ] : https://pip.pypa.io/en/stable/installing/
520
690
[ sf_docs_standards ] : https://symfony.com/doc/current/contributing/documentation/standards.html
0 commit comments