Skip to content
This repository was archived by the owner on Feb 18, 2018. It is now read-only.

Commit b4f9ac2

Browse files
authored
Merge pull request buildbot#2417 from tardyp/stable
port to stable and rc4 relnotes
2 parents 0a00999 + 845025c commit b4f9ac2

9 files changed

Lines changed: 121 additions & 14 deletions

File tree

‎master/buildbot/spec/api.raml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ types:
164164
This endpoint does not provide paging capabilities.
165165
For stream log types, the type line header characters are dropped.
166166
'text/plain' is used as the mime type except for html logs, where 'text/html' is used.
167-
The 'slug' is used as the filename for the resulting download. Some browsers are appending ".txt" or ".html" to this filename according to the mime-type.
167+
The 'slug' is used as the filename for the resulting download. Some browsers are appending ``".txt"`` or ``".html"`` to this filename according to the mime-type.
168168
is:
169169
- bbgetraw:
170170

‎master/buildbot/test/unit/test_util_raml.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,13 @@ def test_endpoints_by_type(self):
7676
self.assertIn(
7777
"/masters/{masterid}/builders/{builderid}/workers/{workerid}",
7878
self.api.endpoints_by_type['worker'].keys())
79+
80+
def test_iter_actions(self):
81+
build = self.api.endpoints_by_type['build']
82+
actions = dict(self.api.iter_actions(build['/builds/{buildid}']))
83+
self.assertEqual(sorted(actions.keys()), sorted(['rebuild', 'stop']))
84+
85+
def test_rawendpoints(self):
86+
self.assertIn(
87+
"/steps/{stepid}/logs/{log_slug}/raw",
88+
self.api.rawendpoints.keys())

‎master/buildbot/util/raml.py‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ def __init__(self):
3838
# waiting for raml1.0 support in ramlfications
3939
# we cannot use its raml parser
4040
# so we just use its loader
41-
self.api = ramlfications.load(os.path.join(
42-
os.path.dirname(__file__), os.pardir, 'spec', 'api.raml'))
41+
fn = os.path.join(os.path.dirname(__file__), os.pardir, 'spec', 'api.raml')
42+
self.api = ramlfications.load(fn)
43+
with open(fn) as f:
44+
self.rawraml = f.read()
45+
4346
endpoints = {}
4447
self.endpoints_by_type = {}
48+
self.rawendpoints = {}
4549
self.endpoints = self.parse_endpoints(endpoints, "", self.api)
4650
self.types = self.parse_types()
4751

@@ -65,6 +69,9 @@ def parse_endpoints(self, endpoints, base, api, uriParameters=None):
6569
v['eptype'] = _is['bbget']['bbtype']
6670
self.endpoints_by_type.setdefault(v['eptype'], {})
6771
self.endpoints_by_type[v['eptype']][base] = api
72+
if 'bbgetraw' in _is:
73+
self.rawendpoints.setdefault(base, {})
74+
self.rawendpoints[base] = api
6875
return endpoints
6976

7077
def reindent(self, s, indent):
@@ -77,3 +84,13 @@ def format_json(self, j, indent):
7784
def parse_types(self):
7885
types = self.api['types']
7986
return types
87+
88+
def iter_actions(self, endpoint):
89+
ACTIONS_MAGIC = '/actions/'
90+
for k, v in endpoint.iteritems():
91+
if k.startswith(ACTIONS_MAGIC):
92+
k = k[len(ACTIONS_MAGIC):]
93+
v = v['post']
94+
# simplify the raml tree for easier processing
95+
v['body'] = v['body']['application/json'].get('properties', {})
96+
yield (k, v)

‎master/docs/bbdocs/ext.py‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,17 @@ class BBDomain(Domain):
269269
names=('pathkey',), typenames=('type',),
270270
can_collapse=True),
271271
]),
272+
'raction': make_ref_target_directive('raction',
273+
indextemplates=[
274+
'single: Resource Action; %s',
275+
],
276+
name_annotation='POST with method:',
277+
has_content=True,
278+
doc_field_types=[
279+
TypedField('body', label='Body keys',
280+
names=('body',), typenames=('type',),
281+
can_collapse=True),
282+
]),
272283
}
273284

274285
roles = {
@@ -300,8 +311,9 @@ class BBDomain(Domain):
300311
make_index("cmdline", "Command Line Index"),
301312
make_index("msg", "MQ Routing Key Index"),
302313
make_index("event", "Data API Event Index"),
303-
make_index("rtype", "Data API Resource Type Index"),
304-
make_index("rpath", "Data API Path Index"),
314+
make_index("rtype", "REST/Data API Resource Type Index"),
315+
make_index("rpath", "REST/Data API Path Index"),
316+
make_index("raction", "REST/Data API Actions Index"),
305317
]
306318

307319
def resolve_xref(self, env, fromdocname, builder, typ, target, node,

‎master/docs/developer/rest.rst‎

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ It is also designed, in keeping with REST principles, to be discoverable.
1414
As such, the details of the paths and resources are not documented here.
1515
Begin at the root URL, and see the :ref:`Data_API` documentation for more information.
1616

17+
.. contents:: :local:
18+
1719
Versions
1820
~~~~~~~~
1921

@@ -168,9 +170,6 @@ Raml Specs
168170
The Data API is documented in `RAML 1.0 format <https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md>`_.
169171
RAML describes and documents all our data, rest, and javascript APIs in a format that can be easily manipulated by human and machines.
170172

171-
.. toctree::
172-
:maxdepth: 2
173-
174173
.. jinja:: data_api
175174

176175
{% for name, type in raml.types.items()|sort %}
@@ -211,7 +210,7 @@ RAML describes and documents all our data, rest, and javascript APIs in a format
211210

212211
{{type.description}}
213212
{% endif %}
214-
{% if name in raml.endpoints_by_type -%}
213+
{% if name in raml.endpoints_by_type -%}{# if type has endpoints #}
215214
Endpoints
216215
---------
217216
{% for ep, config in raml.endpoints_by_type[name].items()|sort -%}
@@ -230,7 +229,45 @@ RAML describes and documents all our data, rest, and javascript APIs in a format
230229
:bb:rtype:`collection` of :bb:rtype:`{{method_ep['eptype']}}`
231230
{% endif %}
232231

233-
{% endif %}
234-
{% endfor %}
235-
{% endif %}
232+
{% endif %}{# if ep has get #}
233+
234+
{% for method, action in raml.iter_actions(config) -%}
235+
.. bb:raction:: {{ep}}:{{method}}
236+
237+
:body string method: must be ``{{ method }}``
238+
239+
{% for key, value in action['body'].items() -%}
240+
:body {{value.type}} {{key}}: {{raml.reindent(value.description, 4*2)}}
241+
{% endfor %}
242+
243+
{% endfor %}{# endpoints #}
244+
{% endfor %}{# endpoints #}
245+
{% endif %}{# if type has endpoints #}
246+
{% endfor %}{# for each types #}
247+
248+
Raw endpoints
249+
.............
250+
251+
Raw endpoints allow to download content in their raw format (i.e. not within a json glue).
252+
The ``content-disposition`` http header is set, so that the browser knows which file to store the content to.
253+
254+
{% for ep, config in raml.rawendpoints.items()|sort %}
255+
256+
.. bb:rpath:: {{ep}}
257+
258+
{% for key, value in config.uriParameters.items() -%}
259+
:pathkey {{value.type}} {{key}}: {{raml.reindent(value.description, 4*2)}}
260+
{% endfor %}
261+
262+
{{config['get'].description}}
263+
236264
{% endfor %}
265+
266+
Raml spec verbatim
267+
..................
268+
269+
Sometimes Raml is just clearer than formatted text.
270+
271+
.. code-block:: yaml
272+
273+
{{raml.reindent(raml.rawraml, 4*1)}}

‎master/docs/indices.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ Indices and Tables
1212
* :bb:index:`event`
1313
* :bb:index:`rtype`
1414
* :bb:index:`rpath`
15+
* :bb:index:`raction`
1516
* :ref:`modindex`
1617
* :ref:`search`

‎master/docs/relnotes/0.9.0rc4.rst‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Release Notes for Buildbot ``0.9.0rc4``
2+
========================================
3+
4+
5+
The following are the release notes for Buildbot ``0.9.0rc4``.
6+
This version was released on September 28, 2016.
7+
8+
See :ref:`Upgrading to Nine` for a guide to upgrading from 0.8.x to 0.9.x
9+
10+
11+
Master
12+
------
13+
14+
Fixes
15+
~~~~~
16+
17+
* Fix the UI to better adapt to different screen width (:bug:`3614`)
18+
19+
* Add more REST api documentation (document ``/raw`` endpoints, and ``POST`` actions)
20+
21+
22+
Details
23+
-------
24+
25+
For a more detailed description of the changes made in this version, see the git log itself:
26+
27+
.. code-block:: bash
28+
29+
git log v0.9.0rc3..v0.9.0rc4

‎master/docs/relnotes/index.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ For a more detailed description of the changes made in this version, see the git
6060

6161
.. code-block:: bash
6262
63-
git log v0.9.0rc3..master
63+
git log v0.9.0rc4..master
6464
6565
Older Versions
6666
--------------
@@ -72,6 +72,7 @@ Newer versions are also available here:
7272
:maxdepth: 1
7373

7474
0.9.0
75+
0.9.0rc4
7576
0.9.0rc3
7677
0.9.0rc2
7778
0.9.0rc1

‎www/base/guanlecoja/config.coffee‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ config =
3030
# JavaScript libraries (order matters)
3131
deps:
3232
"guanlecoja-ui":
33-
version: '~1.6.1'
33+
version: '~1.6.2'
3434
files: ['vendors.js', 'scripts.js']
3535
moment:
3636
version: "~2.6.0"

0 commit comments

Comments
 (0)