Commit Graph

64 Commits

Author SHA1 Message Date
mprahl
b752a9741a Return a friendly error when the 'id' is provided as a query parameter 2017-11-27 11:58:56 -05:00
mprahl
0e7dd2dad3 Add a "short" query parameter to show less detail on the "module-builds" API 2017-11-17 13:19:48 -05:00
mprahl
9890277620 Make "state_url" optional in the "extended_json" function since creating an app context causes SQLAlchemy issues on the backend 2017-11-17 12:07:51 -05:00
Martin Curlej
c76c5dcf15 mbs-build now builds modules only from yaml files 2017-11-10 12:33:42 -05:00
Martin Curlej
03cff80e4a Streamlined cmd line options for local builds
Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2017-11-10 12:33:42 -05:00
mprahl
104480d365 Set Access-Control-Allow-Origin to * on GET API routes 2017-11-08 21:37:25 -05:00
mprahl
d8f126e978 Allow resuming from a failure during the "init" phase
This also shifts build failure transitions from individual functions
in utils.py to the init module handler.
2017-11-06 14:15:12 -05:00
mprahl
089a0c3db4 Fix typo 2017-11-02 08:37:59 -04:00
mprahl
45cce653eb Add the ability to specify different rebuild methods 2017-11-01 15:39:43 -04:00
Martin Curlej
60b3d97c97 flake8 cleanup
Signed-off-by: Martin Curlej <mcurlej@redhat.com>

removed some noqa tags
2017-10-25 12:13:59 +02:00
mprahl
eedf0a1684 Default verbose to false but present a lot more information when verbose is false 2017-10-23 20:19:51 -04:00
mprahl
9f9cfc358b Default PATCH return value to be the extended_json like POST 2017-10-05 16:17:20 -04:00
mprahl
27250263ea Default verbose to on ordering by id in the module-builds API 2017-10-05 16:17:18 -04:00
Ralph Bean
eed37eced6 Remove some code duplication in views.py
This is mostly just cosmetic.

Fixes #605.
2017-10-03 13:58:42 -04:00
mprahl
6165fd5088 Add an API that exposes information about the MBS server 2017-09-19 16:48:28 -04:00
Filip Valder
3cb41aa5dc Changes in MBS restful API:
- Refactor MBS API code
- Unify module-/component_build API philosophy/design/approach
- Naming fixes
- _utc_datetime_to_iso moved from ModuleBuildAPI and is now a module-level function.
- Existing v1 API remains unchanged. ComponentBuildAPI now supports individual component build listing + verbose mode.
- documented in README
- various component_build API tests added
2017-09-11 14:48:22 +02:00
Filip Valder
7ef2975984 PEP8 fixes 2017-07-17 18:29:10 +02:00
Yashvardhan Nanavati
d79a9584c7 Find module build using attributes of a component build in koji 2017-07-07 14:37:43 -04:00
mprahl
3e819abcb6 Include the query arguments in the pagination metadata 2017-07-06 09:09:17 -04:00
Jakub Kadlčík
a86084746d Rename ALLOW_CUSTOM_URLS to ALLOW_CUSTOM_SCMURLS 2017-05-02 11:29:47 +02:00
Jakub Kadlčík
6dde52f377 Add config option for allowing custom scmurls 2017-04-19 15:25:22 +02:00
Jakub Kadlčík
b0ae5f98ef Have default NSV for modules submitted by yaml file 2017-04-18 08:23:38 +02:00
Jan Kaluža
9c60457dda Merge #461 NO_AUTH bugfix and improvement 2017-04-07 06:01:42 +00:00
Jan Kaluza
acf0e7097c Use FAS groups to manage MBS admins 2017-04-04 16:39:10 +02:00
Jakub Kadlčík
dcba6c8995 Support NO_AUTH changing owner in patch method 2017-03-30 12:21:01 +02:00
Jakub Kadlčík
0753c6be2d Move validate_optional_params to BaseHandler 2017-03-30 11:21:39 +02:00
Jakub Kadlčík
05bdece65a Don't allow NO_AUTH to be anything 2017-03-30 11:21:39 +02:00
Jakub Kadlčík
10d3c98381 Construct optional_params in base class 2017-03-30 11:01:13 +02:00
Jakub Kadlčík
ec0ed91d45 Allow to submit owner when NO_AUTH 2017-03-30 11:01:13 +02:00
Jakub Kadlčík
48808547f7 Refactor post methods to separate handlers 2017-03-30 11:01:13 +02:00
Jan Kaluza
c5f9d713cc Introduce 'admins' config option and allow users defined there to cancel any module build. 2017-03-29 12:58:44 +02:00
Ralph Bean
a8314cba09 Merge #425 Use the 403 Forbidden result in case the user is unauthorized 2017-03-14 13:11:10 +00:00
Ralph Bean
20671748ca Coerce submitted branch name from unicode to bytes.
I hit this in prod on the latest 1.3.4 release.
2017-03-13 14:48:51 -04:00
Patrick Uiterwijk
a4763ee316 Use the 403 Forbidden result in case the user is unauthorized
The difference between 401 Unauthorized and 403 Forbidden is that 403 Forbidden is "permanent":
it indicates that the user was authenticated correctly, but was not allowed to access this endpoint.
In contrast, 401 Unauthorized means that the request as posted was not allowed, but if the user
were to try again with (new) authorization tokens, it might actually succeed.

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2017-03-13 07:34:36 +00:00
Jan Kaluza
4b3e295e48 Expect 'branch' while handling submission of module and use it to set the stream of module. Also verify that the commit hash belongs to that branch. 2017-03-07 11:25:06 +01:00
Filip Valder
6b343896dd s/rida/mbs/ 2017-02-28 17:59:02 +01:00
Filip Valder
13b7bcd03e Support for state tracing of modules and components
- DB migration scripts.
- Models: ComponentBuildTrace, ModuleBuildTrace.
- ModuleBuild.state_trace method for querying for a particular module's
state history.
- SQLAlchemy before commit session event handler for recording
module/component state changes.
- REST API verbose mode for getting state trace of a particular module.
- Tests use make_session, so that event handlers are in effect.
- Short info in README about verbose mode.
- Tests verifying whether state trace information about a module appears
in verbose mode.
- Other minor fixes (RidaBase -> MBSBase, PEP8...)
2017-02-28 16:15:43 +01:00
Jakub Kadlčík
9429114836 Get empty string if Content-Type is not in headers 2017-02-27 16:20:01 +01:00
Jakub Kadlčík
34ea4a8efe Move validate_optional_params function to utils.py 2017-02-26 22:23:50 +01:00
Jakub Kadlčík
7799515994 Use function for validating optional params to reduce code duplicity 2017-02-23 20:51:31 +01:00
Jakub Kadlčík
62e26ba652 Use better way of checking for forbidden columns 2017-02-23 20:51:31 +01:00
Jakub Kadlčík
5a65f50b52 Use built-in to_dict() function 2017-02-23 20:51:31 +01:00
Jakub Kadlčík
92dce63091 Allow submitting optional parameters such as copr_owner and copr_project 2017-02-23 20:51:31 +01:00
Matt Prahl
a5cc4eb280 Add a module's commit hash, scmurl, and the buildrequires' commit hashes, stream, and version in the modulemd 2017-02-21 09:53:05 -05:00
Jakub Kadlčík
1630c5f14f Raise user friendly exception when yaml submission is not allowed 2017-02-19 22:38:43 +01:00
Jakub Kadlčík
3e2ee93dd8 Rename conf option to YAML_SUBMIT_ALLOWED 2017-02-19 22:35:55 +01:00
Jakub Kadlčík
43b653097a Add config option for allowing of direct submitting yaml files to mbs 2017-02-19 22:35:55 +01:00
Jakub Kadlčík
43acbdbdba Implement possibility to submit yaml files (See #310) 2017-02-19 22:35:55 +01:00
Ralph Bean
88aca055ce Replace query to FAS with OIDC groups scope check.
This removes our query to FAS and fixes #304.

It is more flexible too, where we can now configure production to only
allow in members of the `modularity-wg` group, and then later open it up
to all packagers after F26 is out (as was agreed with FESCo).

In the process of working on this, I discovered that #305 is not
necessary.  We don't need our own scope; we can just use the `groups`
scope as done here.
2017-02-10 15:50:41 -05:00
Ralph Bean
d13c7991ed Cleanup in preparation for package review.
I'm taking on #235.  This is all stuff that came up while doing a
cursory package review myself.

- The source files all state that they are MIT, but the specfile and
  repo claimed to be GPL.  I switched everything to MIT (even though I
  favor GPL.. the source was MIT first before it was incorrectly
  labelled GPL).
- There are various bugs and lint issues in the specfile fixed here.
- Notably, the systemd service file is missing from the 1.0.0 tarball on
  PyPI, so I'll need to do a new release after this.
2016-12-12 15:09:58 -05:00