Skip to content

Commit ae52584

Browse files
authored
Merge branch 'matrix-org:main' into master
2 parents d77ba1e + fa479af commit ae52584

File tree

684 files changed

+25076
-28412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

684 files changed

+25076
-28412
lines changed

.buildkite/pipeline.yaml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
steps:
2-
- label: ":books: Build spec"
2+
- label: ":snake: Build swagger definitions for matrix.org"
33
command:
4-
- python3 -m venv env
5-
- env/bin/pip install -r scripts/requirements.txt
6-
- ". env/bin/activate; scripts/generate-matrix-org-assets"
4+
# Install the python dependencies necessary to build the spec
5+
- python3 -m venv env && . env/bin/activate
6+
- pip install -r scripts/requirements.txt
7+
# Build the spec
8+
- scripts/generate-matrix-org-assets
79
artifact_paths:
810
- assets.tar.gz
911
plugins:
10-
- docker#v3.0.1:
11-
image: "python:3.6"
12+
- docker#v3.7.0:
13+
image: python:3.9
1214

1315
- label: "rebuild matrix.org"
1416
trigger: "matrix-dot-org"
1517
async: true
16-
branches: "master"
18+
branches: "main"
19+
20+
- label: ":books: Build the spec"
21+
command:
22+
# Install package dependencies
23+
- apk add nodejs npm git hugo
24+
# Install the node dependencies necessary to build the spec
25+
- npm i
26+
# Pull all git submodules, required for the hugo theme
27+
- git submodule update --init --recursive
28+
# Pull current proposal information
29+
- npm run get-proposals
30+
# Build the spec, will build to './spec'
31+
# Set the baseURL as we're deploying to https://spec.matrix.org/unstable
32+
- hugo --baseURL "/unstable" -d "spec"
33+
# Compress the result and make it available as an artifact
34+
- tar -czf spec.tar.gz spec
35+
artifact_paths:
36+
- spec.tar.gz
37+
plugins:
38+
- docker#v3.7.0:
39+
image: alpine

.circleci/config.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
gendoc: &gendoc
22
name: Generate the docs
3+
# Note: Node dependencies are required for the hugo build.
4+
# Note: We use a custom config file for circleci due to some specifics with hosting the
5+
# site using CircleCI's artifacts platform. See config-circleci.toml for details.
36
command: |
4-
source /env/bin/activate
5-
scripts/gendoc.py
7+
apk add nodejs npm git hugo
8+
npm i
9+
cat config-circleci.toml config.toml > hugo-config.toml
10+
hugo --config hugo-config.toml --baseURL "/${CIRCLE_NODE_INDEX}/public"
611
712
genswagger: &genswagger
8-
name: Generate the swagger
13+
name: Validate sources and generate swagger json
914
command: |
1015
source /env/bin/activate
16+
scripts/check-swagger-sources.py
1117
scripts/dump-swagger.py
1218
1319
buildswaggerui: &buildswaggerui
@@ -27,36 +33,21 @@ checkexamples: &checkexamples
2733
name: Check Event Examples
2834
command: |
2935
source /env/bin/activate
30-
cd event-schemas
31-
./check_examples.py
32-
cd ../api
33-
./check_examples.py
34-
35-
genmatrixassets: &genmatrixassets
36-
name: Generate/Verify matrix.org assets
37-
command: |
38-
source /env/bin/activate
39-
./scripts/generate-matrix-org-assets
36+
scripts/check-event-schema-examples.py
4037
4138
validateapi: &validateapi
4239
name: Validate OpenAPI specifications
4340
command: |
44-
cd api
41+
cd scripts
4542
npm install
46-
node validator.js -s "client-server"
43+
node validator.js -s "../data/api/client-server"
4744
4845
buildspeculator: &buildspeculator
4946
name: Build Speculator
5047
command: |
5148
cd scripts/speculator
5249
go build -v
5350
54-
buildcontinuserv: &buildcontinuserv
55-
name: Build Continuserv
56-
command: |
57-
cd scripts/continuserv
58-
go build -v
59-
6051
version: 2
6152
jobs:
6253
validate-docs:
@@ -71,18 +62,21 @@ jobs:
7162
steps:
7263
- checkout
7364
- run: *checkexamples
74-
- run: *genmatrixassets # We don't actually use the assets, but we do want to make sure they build
7565
build-docs:
7666
docker:
77-
- image: uhoreg/matrix-doc-build
67+
- image: alpine
7868
steps:
69+
# Note: We install git in the image so we can pull git submodules. The hugo theme in use
70+
# is a git submodule, which has its own submodules, and all need to be loaded.
71+
- run: apk add git
7972
- checkout
73+
- run: git submodule update --init --recursive
8074
- run: *gendoc
8175
- store_artifacts:
82-
path: scripts/gen
76+
path: public
8377
- run:
8478
name: "Doc build is available at:"
85-
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/scripts/gen/index.html"; echo $DOCS_URL
79+
command: DOCS_URL="${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/public/index.html"; echo $DOCS_URL
8680
build-swagger:
8781
docker:
8882
- image: uhoreg/matrix-doc-build
@@ -104,8 +98,6 @@ jobs:
10498
name: Install Dependencies
10599
command: |
106100
go get -v github.com/hashicorp/golang-lru
107-
go get -v gopkg.in/fsnotify/fsnotify.v1
108-
- run: *buildcontinuserv
109101
- run: *buildspeculator
110102

111103
workflows:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Clarity problem
3+
about: Report an area of the spec that is unclear.
4+
title: ''
5+
labels: 'clarification'
6+
assignees: ''
7+
8+
---
9+
10+
**Link to problem area**:
11+
12+
**Issue**
13+
What is wrong? How can we improve?

.github/ISSUE_TEMPLATE/config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Matrix Spec Discussion
4+
url: "https://matrix.to/#/#matrix-spec:matrix.org"
5+
about: Questions about the spec and proposal process can be asked here.
6+
- name: Matrix Security Policy
7+
url: https://www.matrix.org/security-disclosure-policy/
8+
about: Learn more about our security disclosure policy.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Cosmetic issue
3+
about: Report an issue with how the spec looks.
4+
title: ''
5+
labels: 'aesthetic'
6+
assignees: ''
7+
8+
---
9+
10+
**Link to problem area**:
11+
12+
**Issue**
13+
What is wrong? What can we do to improve?

.github/ISSUE_TEMPLATE/idea.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Spec idea
3+
about: Suggest a future MSC idea.
4+
title: ''
5+
labels: 'improvement'
6+
assignees: ''
7+
8+
---
9+
10+
**Suggestion**
11+
What would you like to see in Matrix? If your idea is vaguely complete enough, we
12+
recommend submitting [an MSC](https://matrix.org/docs/spec/proposals) instead.

.github/ISSUE_TEMPLATE/spec-bug.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Documentation error
3+
about: Report an issue with the spec itself (incorrect text).
4+
title: ''
5+
labels: 'spec-bug'
6+
assignees: ''
7+
8+
---
9+
10+
**Link to problem area**:
11+
12+
**Issue**
13+
What is wrong?
14+
15+
**Expected behaviour**
16+
How can the issue be fixed? Links to implementations/documents which prove the spec is wrong are appreciated.

.github/workflows/main.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "Spec"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-openapi:
11+
name: "🐍 Build OpenAPI definitions for matrix.org"
12+
runs-on: ubuntu-latest
13+
container: "python:3.9"
14+
steps:
15+
- name: "📥 Source checkout"
16+
uses: actions/checkout@v2
17+
- name: "📦 Asset creation"
18+
run: |
19+
python3 -m venv env && . env/bin/activate
20+
pip install -r scripts/requirements.txt
21+
scripts/generate-matrix-org-assets
22+
- name: "📤 Artifact upload"
23+
uses: actions/upload-artifact@v2
24+
with:
25+
name: openapi-artifact
26+
path: assets.tar.gz
27+
28+
build-spec:
29+
name: "📖 Build the spec"
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: "➕ Setup Node"
33+
uses: actions/setup-node@v2
34+
with:
35+
node-version: '14'
36+
- name: "➕ Setup Hugo"
37+
uses: peaceiris/actions-hugo@c03b5dbed22245418539b65eb9a3b1d5fdd9a0a6
38+
with:
39+
hugo-version: '0.85.0'
40+
extended: true
41+
- name: "📥 Source checkout"
42+
uses: actions/checkout@v2
43+
with:
44+
submodules: 'recursive'
45+
- name: "⚙️ npm"
46+
run: |
47+
npm i
48+
npm run get-proposals
49+
- name: "⚙️ hugo"
50+
run: hugo --baseURL "/unstable" -d "spec"
51+
- name: "📦 Tarball creation"
52+
run: tar -czf spec.tar.gz spec
53+
- name: "📤 Artifact upload"
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: spec-artifact
57+
path: spec.tar.gz
58+
59+
rebuild-matrixdotorg:
60+
name: "👷 Rebuild matrix.org"
61+
needs: build-openapi
62+
runs-on: ubuntu-latest
63+
if: ${{ false && github.event_name == 'push' && github.ref == 'refs/head/main' }}
64+
steps:
65+
- name: "🪄 Triggering rebuild of matrix.org"
66+
run: |
67+
curl -XPOST -u "${{secrets.TRIGGER_MATRIXORG_REBUILD_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${{ github.repository_owner }}/matrix.org/actions/workflows/build-matrix.org.yml/dispatches --data '{"ref": "${{ github.ref }}" }'

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
/api/node_modules
22
/assets
33
/assets.tar.gz
4+
/data/msc
45
/env*
6+
/node_modules
7+
/resources
58
/scripts/gen
69
/scripts/continuserv/continuserv
710
/scripts/speculator/speculator
811
/scripts/swagger
912
/scripts/tmp
1013
/templating/out
14+
/hugo-config.toml
15+
/public
1116
*.pyc
1217
*.swp
1318
_rendered.rst
1419
/.vscode/
1520
/.idea/
21+
/spec/

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "themes/docsy"]
2+
path = themes/docsy
3+
url = https://github.com/matrix-org/docsy.git
4+
branch = master

CONTRIBUTING.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ some time to complete.
2929
Changes to the protocol (new endpoints, ideas, etc) need to go through the
3030
`proposals process <https://matrix.org/docs/spec/proposals>`_. Other changes,
3131
such as fixing bugs, typos, or clarifying existing behaviour do not need a proposal.
32-
If you're not sure, visit us at `#matrix-spec:matrix.org`_
33-
and ask.
34-
32+
If you're not sure, visit us at `#matrix-spec:matrix.org`_ and ask.
3533

3634
Other changes
3735
~~~~~~~~~~~~~
@@ -64,12 +62,17 @@ following:
6462
to fix. On the other hand, introducing new behaviour is best represented by a
6563
proposal.
6664

65+
* Design or aesthetic changes, such as improving accessibility, colour schemes,
66+
etc. Please check in with us at `#matrix-docs:matrix.org`_ with your proposed
67+
design change before opening a PR so we can work with you on it.
68+
6769
For such changes, please do just open a `pull request`_. If you're not sure if
6870
your change is covered by the above, please visit `#matrix-spec:matrix.org` and
6971
ask.
7072

7173
.. _`pull request`: https://help.github.com/articles/about-pull-requests
7274
.. _`#matrix-spec:matrix.org`: https://matrix.to/#/#matrix-spec:matrix.org
75+
.. _`#matrix-docs:matrix.org`: https://matrix.to/#/#matrix-docs:matrix.org
7376

7477

7578
Adding to the changelog
@@ -86,8 +89,8 @@ To create a changelog entry, create a file named in the format ``prNumber.type``
8689
the ``newsfragments`` directory. The ``type`` can be one of the following:
8790

8891
* ``new`` - Used when adding new endpoints. Please have the file contents be the
89-
method and route being added, surrounded in RST code tags. For example: ``POST
90-
/accounts/whoami``
92+
method and route being added, surrounded in markdown code tags. For example: \`POST
93+
/accounts/whoami\`.
9194

9295
* ``feature`` - Used when adding backwards-compatible changes to the API.
9396

@@ -100,8 +103,7 @@ the ``newsfragments`` directory. The ``type`` can be one of the following:
100103

101104
All news fragments must have a brief summary explaining the change in the
102105
contents of the file. The summary must end in a full stop to be in line with
103-
the style guide and and formatting must be done using `Restructured Text
104-
<http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_.
106+
the style guide and formatting must be done using Markdown.
105107

106108
Changes that do not change the spec, such as changes to the build script, formatting,
107109
CSS, etc should not get a news fragment.

0 commit comments

Comments
 (0)