Skip to content

Commit 62293d4

Browse files
authored
Merge branch '6-dev' into color-mode-bootstrap5
2 parents 95862a9 + 3bf623b commit 62293d4

29 files changed

+2966
-156
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See our [contributing guidelines](https://6.dev-docs.plone.org/contributing/index.html).
1+
See our [contributing guidelines](https://6.docs.plone.org/contributing/index.html).

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ Thank you for your contribution to the Plone Documentation.
22

33
Before submitting this pull request, please make sure you follow our guides:
44

5-
- [ ] [Contributing to Plone Documentation](https://6.dev-docs.plone.org/contributing/index.html)
6-
- [ ] [Building and Checking the Quality of Documentation](https://6.dev-docs.plone.org/contributing/setup-build.html)
7-
- [ ] [General Guide to Writing Documentation](https://6.dev-docs.plone.org/contributing/writing-docs-guide.html)
5+
- [Contributing to Plone documentation](https://6.docs.plone.org/contributing/index.html)
6+
- [Building and checking the quality of documentation](https://6.docs.plone.org/contributing/setup-build.html)
7+
- [Authors guide](https://6.docs.plone.org/contributing/authors.html)
8+
- [MyST reference](https://6.docs.plone.org/contributing/myst-reference.html)
89

910
## Issue Number
1011

.github/workflows/build_deploy.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ jobs:
99
build_deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v1
13-
14-
- name: Set up Python ${{ matrix.python-version }}
15-
uses: actions/setup-python@v2
12+
- uses: actions/checkout@v3
13+
- name: Setup Graphviz
14+
uses: ts-graphviz/setup-graphviz@v1
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v4
1617
with:
17-
python-version: "3.10"
18-
18+
python-version: '3.10'
19+
cache: 'pip'
1920
- name: Install dependencies
2021
run: |
2122
pip install -q -r requirements-initial.txt
@@ -32,31 +33,34 @@ jobs:
3233
run: make deploy
3334

3435
# node setup
35-
- name: Use Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v1
36+
- name: Use Node.js 16
37+
uses: actions/setup-node@v3
3738
with:
38-
node-version: ${{ matrix.node-version }}
39-
39+
node-version: '16'
40+
- name: Install Yarn
41+
run: npm install -g yarn
4042
# node cache
4143
- name: Get yarn cache directory path
4244
id: yarn-cache-dir-path
4345
working-directory: submodules/volto
44-
run: echo "::set-output name=dir::$(yarn cache dir)"
45-
- uses: actions/cache@v1
46+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
47+
- uses: actions/cache@v3
4648
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
4749
with:
4850
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
4951
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
5052
restore-keys: |
5153
${{ runner.os }}-yarn-
5254
53-
5455
- name: StoryBook build
55-
run: cd submodules/volto && yarn && yarn build-storybook -o ../../_build/html/storybook
56+
run: |
57+
cd submodules/volto
58+
yarn install --immutable
59+
yarn build-storybook -o ../../_build/html/storybook
5660
5761
- name: Deploy to server
5862
id: deploy
59-
uses: Pendect/action-rsyncer@v1.1.0
63+
uses: Pendect/action-rsyncer@v2.0.0
6064
env:
6165
DEPLOY_KEY: ${{secrets.DEPLOY_KEY_DOCS}}
6266
with:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ docs/volto:
6262
@echo "Documentation of volto initialized."
6363

6464
.PHONY: deps
65-
deps: bin/python docs/volto docs/plone.restapi docs/plone.api ## Create Python virtual environment, install requirements, initialize or update the volto, plone.restapi, and plone.api submodules, and finally create symlinks to the source files.
65+
deps: bin/python docs/volto docs/plone.restapi docs/plone.api ## Create Python virtual environment, install requirements, initialize or update the volto, plone.restapi, and plone.api submodules, and finally create symlinks to the source files.
6666

6767

6868
.PHONY: html

coredev/agreement.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "Contributing to Plone"
5+
"property=og:description": "Contributing to Plone"
6+
"property=og:title": "Contributing to Plone"
7+
"keywords": "Contributing, Plone"
8+
---
9+
10+
(contributing-to-plone-label)=
11+
12+
# Contributing to Plone
13+
14+
There are many people and companies who rely on Plone on a day-to-day basis, so we must enforce some level of code quality control.
15+
16+
Plone's source code is hosted in git repositories at <https://github.com/plone>, but only members of the developer team have commit rights.
17+
18+
Sending in a contributors agreement does not guarantee your commit access to the repositories, but once you send it in we will always have it on file for when you are ready to contribute.
19+
20+
We ask that before requesting core access you familiarize yourself a little with the community since they will help you get ramped up:
21+
22+
- Ask and (especially) answer questions on [the Plone forum](https://community.plone.org/) and in {doc}`Plone chat <culture>` with a focus on getting to know the active developers a bit.
23+
24+
- Attend a [conference](https://plone.org/news-and-events/events/plone-conferences), [symposium](https://plone.org/news-and-events/events/regional), or participate in a [sprint](https://plone.org/news-and-events/events/sprints).
25+
26+
There are plenty of opportunities to meet the community and start contributing through various coding sessions, either in person or on the web.
27+
28+
You may even be able to get immediate core access at a conference if you are flexing your mad coding skills and the right people are attending.
29+
30+
- Get your feet wet by contributing to the [collective](https://collective.github.io/).
31+
Don't worry about getting it perfect or asking for help.
32+
This way you get to know us and we improve our code together as a community.
33+
34+
- **Patches:** Historically we encouraged people to submit patches to the ticket collector.
35+
These tickets are usually ignored forever.
36+
Technically, for us to accept your patch, you must sign the contributors agreement.
37+
If you want to contribute fixes, please just sign the agreement and go through the standard GitHub pull request process described below until you feel comfortable to bypass review.
38+
If the ticket is trivial, you do not need to sign a contributor's agreement.
39+
40+
Once you have familiarized yourself with the community and you are excited to contribute to the core:
41+
42+
- Sign the contributor agreement at <https://plone.org/foundation/contributors-agreement/agreement.pdf>, then either send by postal mail to the address provided, or scan and email it to <[email protected]>.
43+
This offers both copyright protection and ensures that the Plone Foundation is able to exercise some control over the codebase, ensuring it is not appropriated for someone's unethical purposes.
44+
For questions about why the agreement is required, please see [About the Plone Contributor Agreement
45+
](https://plone.org/foundation/contributors-agreement).
46+
47+
If you aren't sure where to start or just want more direction, feel free to get in the forum or in chat, and ask for help.
48+
While there is no official mentoring process, there are plenty of people willing to act in that role and guide you through the steps of getting involved in the community.
49+
A common way to start contributing is to participate in a [Plone sprint](https://plone.org/news-and-events/events/sprints).
50+
51+
**Welcome to the Plone community!**
52+
53+
54+
## Dealing with pull requests on GitHub
55+
56+
Before we can merge a pull request, we have to check that the author has signed the contributor's agreement.
57+
58+
If they're listed in <https://github.com/orgs/plone/teams/developers/members>, the author has signed so we can go ahead and merge.
59+
60+
If they aren't listed there, there's still a chance they have signed the contributor's agreement.
61+
62+
If they have signed before the move to GitHub, you can ask <[email protected]> to check.
63+
64+
Pull requests without contributor's agreement can only be merged in trivial cases, and only by the release manager.

coredev/continous-integration.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "Essential continuous integration practices"
5+
"property=og:description": "Essential continuous integration practices"
6+
"property=og:title": "Essential continuous integration practices"
7+
"keywords": "Plone, continuous integration, best practices"
8+
---
9+
10+
# Essential continuous integration practices
11+
12+
The CI system at [jenkins.plone.org](https://jenkins.plone.org) is a shared resource for Plone core developers to notify them of regressions in Plone core code.
13+
14+
Build breakages are a normal and expected part of the development process.
15+
Our aim is to find errors and eliminate them as quickly as possible, without expecting perfection and zero errors.
16+
Though, there are some essential rules that needs to be followed in order to achieve a stable build.
17+
18+
19+
## 1) Don't check in on a broken build
20+
21+
Do not make things more complicated for the developer who is responsible for breaking the build.
22+
23+
If the build breaks, the developer has to identify the cause of the breakage as soon as possible and should fix it.
24+
If we adopt this strategy, we will always be in the best position to find out what caused the breakage and fix it immediately.
25+
If one of the developers has made a check-in and broken the build as a result, we have the best chance of fixing the build if we have a clear look at the problem.
26+
Checking in further changes and triggering new builds will just lead to more problems.
27+
28+
If the build is broken over a longer period of time (more than a couple of hours) you should either notify the developer who is responsible for the breakage, fix the problem yourself, or just revert the commit in order to be able to continue to work.
29+
30+
```note
31+
There is one exception to this rule.
32+
Sometimes there are changes or tests that depend on changes in other packages.
33+
If this is the case, there is no way around breaking a single build for a certain period of time.
34+
In this case run the all tests locally with all the changes and commit them within a time frame of ten minutes.
35+
```
36+
37+
38+
## 2) Always run all commit tests locally before committing
39+
40+
Following this practice ensures the build stays green, and other developers can continue to work without breaking the first rule.
41+
42+
There might be changes that have been checked in before your last update from the version control that might lead to a build failure in Jenkins in combination with your changes.
43+
Therefore it is essential that you check out ({command}`git pull`) and run the tests again before you push your changes to GitHub.
44+
45+
Furthermore, a common source of errors on check-in is to forget to add some files to the repository.
46+
47+
If you follow this rule and your local build passes, you can be sure that this is because someone else checked in in the meantime, or because you forgot to add a new class or configuration file that you have been working on into the version control system.
48+
49+
50+
## 3) Wait for commit tests to pass before moving on
51+
52+
Always monitor the build's progress, and fix the problem right away if it fails.
53+
You have a far better chance of fixing the build, if you just introduced a regression than later.
54+
Also another developer might have committed in the meantime (by breaking rule 1), making things more complicated for yours.
55+
56+
57+
## 4) Never go home on a broken build
58+
59+
Taking into account the first rule of CI ("Don't check in on a broken build"), breaking the build essentially stops all other developers from working on it.
60+
Therefore going home on a broken build (or even on a build that has not finished yet) is **not** acceptable.
61+
It will prevent all the other developers to stop working on the build or fixing the errors that you introduced.
62+
63+
64+
## 5) Always be prepared to revert to the previous revision
65+
66+
In order for the other developers to be able to work on the build, you should always be prepared to revert to the previous (passing) revision.
67+
68+
69+
## 6) Time-box fixing before reverting
70+
71+
When the build breaks on check-in, try to fix it for ten minutes.
72+
If, after ten minutes, you aren't finished with the solution, revert to the previous version from your version control system.
73+
This way you will allow other developers to continue to work.
74+
75+
76+
## 7) Don't comment out failing tests
77+
78+
Once you begin to enforce the previous rule, the result is often that developers start commenting out failing tests in order to get the build passing again as quick as possible.
79+
While this impulse is understandable, it is **wrong**.
80+
81+
The tests have been passing for a while and then start to fail.
82+
This means that we either caused a regression, made assumptions that are no longer valid, or the application has changed the functionality being tested for a valid reason.
83+
84+
You should always either fix the code (if a regression has been found), modify the test (if one of the assumptions has changed), or delete it (if the functionality under test no longer exists).
85+
86+
87+
## 8) Take responsibility for all breakages that result from your changes
88+
89+
If you commit a change and all the tests you wrote pass, but others break, the build is still broken.
90+
This also applies to tests that fail in `buildout.coredev` and don't belong directly to the package you worked on.
91+
This means that you have introduced a regression bug into the application.
92+
93+
It is **your responsibility**—because you made the change—to fix all tests that are not passing as a result of your changes.
94+
95+
There are some tests in Plone that fail randomly, we are always working on fixing those.
96+
If you think you hit such a test, try to fix it (better) or re-run the Jenkins job to see if it passes again.
97+
98+
In any case the developer who made the commit is responsible to make it pass.
99+
100+
101+
## Further Reading
102+
103+
Those rules were taken from the excellent book "Continuous Delivery" by Jez Humble and David Farley (Addison Wesley), and have been adopted and rewritten for the Plone community.
104+
105+
If you want to learn more about continuous integration and continuous delivery, I'd recommend that you buy this book.

0 commit comments

Comments
 (0)