Commit Graph

55 Commits

Author SHA1 Message Date
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
ef5dc64f2b Transition stale failed builds to the "garbage" state and untag their components 2017-11-17 12:07:51 -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
mprahl
243e8873d5 Don't trigger init handler when importing a local build and mark the build as done after import 2017-11-10 08:33:53 -05:00
mprahl
3ccbb3dd57 Fix duplicate state traces 2017-11-08 10:18:47 -05:00
mprahl
18e7f608b1 Solidify how the previous module state is determined when resuming a failed module build 2017-11-06 16:54:10 -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
1eb3c653dd Changed the filters so they execute when everything is build
Signed-off-by: Martin Curlej <mcurlej@redhat.com>
2017-10-31 16:04:31 -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
2de4b592d6 Set 'time_modified' at module creation 2017-10-16 14:45:04 -04:00
Jan Kaluza
ad6874b0e6 Fix #670 - Tag Content Generator Koji build to special tag based on the base module stream 2017-09-25 08:36:29 +02:00
Ralph Bean
3b93dc7143 Restore the old message format.
The message format broke in 3cb41aa5dc

The resulted in tracebacks in pdc-updater when it tried to learn things
about a module that was just submitted.  It relied on certain fields
(`stream`) being in the message body.  This change restores those fields
to get things working again.
2017-09-15 23:34:57 +02:00
Jan Kaluza
999baa2992 Wait for components to be tagged also in final tag before marking module as done. 2017-09-15 15:25:29 +02: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
2e2856169a Update and reformat README, CONTRIBUTING guide and sync code comments 2017-08-25 14:45:42 +02:00
Jan Kaluza
aac4227eb8 Add 'mbs-build local [[--add-local-build n:s:v], ...]' to use local builds as dependency. 2017-08-17 10:00:19 +02:00
Filip Valder
7ef2975984 PEP8 fixes 2017-07-17 18:29:10 +02:00
Neha Prasad
006efacb8e add scm url to api 2017-07-14 12:09:33 -04:00
Jan Kaluza
1621c1e4fd Create app_context before database session. 2017-07-11 09:41:55 +02:00
Ralph Bean
3f8cacd8e5 Convert all dates to ISO in the API.
This should fix #523.

There, @james is right.  Converting to "human" time values in an API
just makes things harder for API users.  We should leave
human-conversion to real UIs (like cli tools or web UIs).
2017-05-04 13:13:50 -04:00
Jan Kaluza
024877592c Do not build module-build-macros when all the components will be reused from previous module build. 2017-05-02 12:09:23 +02:00
Ralph Bean
65950304ca Merge #505 Allow querying for module builds by koji tag. 2017-04-11 13:02:15 +00:00
Jan Kaluza
8ebf1d8205 Show build id in ModuleBUild __repr__ 2017-04-11 14:11:47 +02:00
Ralph Bean
fae7848fa4 Allow querying for module builds by koji tag.
This way, if a component build fails and you want to find out who
submitted it, you can track the:

    koji build -> koji tag -> module build -> owner
2017-04-10 14:32:08 -04:00
mprahl
e7cbce51db Stop using .strip('-build') 2017-04-07 09:20:19 -04:00
Jan Kaluza
8bbe2d359f Trigger newRepo by MBS instead of waiting on Kojira in case when we have sucessfully tagged all the components 2017-04-06 17:19:35 +02:00
Jakub Kadlčík
61b74293b1 Rather extend koji message so we can have additional arguments for copr 2017-03-21 07:47:25 +01:00
Jan Kaluza
3318f48fc3 Fix the process_paused_module_builds in poller 2017-03-17 15:57:52 +01:00
Ralph Bean
4509367d3e Use JSON for component API instead of strings.
This is more flexible and is nicer to other programs that try to parse
or consume this data.
2017-03-03 15:59:17 -05:00
Ralph Bean
0822df7a30 Better logging here. 2017-03-03 06:25:54 -05:00
Ralph Bean
dac43c62b8 Please include the state name, even in the API json. 2017-03-02 11:45:04 -05: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
92dce63091 Allow submitting optional parameters such as copr_owner and copr_project 2017-02-23 20:51:31 +01:00
Matt Prahl
385045d778 Reuse components from previous module builds 2017-02-21 14:22:30 -05:00
Ralph Bean
92c3c1a90f Drop the modules table. 2017-02-15 12:11:40 -05:00
Jan Kaluža
59d070df35 Merge #278 Fix #276 - Use PDC to resolve buildroot components instead of MBS database 2017-01-12 14:34:13 +00:00
Ralph Bean
6cfe487d46 Change message topic service to be more short.
This is just so that the topic doesn't end up being super long like
`org.fedoraproject.prod.module_build_service.module.state.change`

The new value will be:
`org.fedoraproject.prod.mbs.module.state.change`

Currently, the only thing listening for this is pdc-updater, which I
will patch.
2017-01-10 12:34:17 -05:00
Jan Kaluza
0f797c2917 Remove fake base-runtime module from DB and old resolve_profiles method because they are not used anymore. Fix the tests to work with remove fake base-runtime. 2017-01-10 15:58:26 +01:00
Filip Valder
f82e3c8006 fix #264: failed 'failed module' handling due to missing koji tag 2016-12-15 12:08:03 +01:00
Jan Kaluza
d06c13d973 Fix the bug when module build freezes when all the components in batch have been already built by builder. 2016-12-12 21:03:44 +01:00
Jan Kaluza
1c66edc53e Include modulemd in the module.state.change messages so it can be handled by pdc-updater. 2016-12-07 13:18:39 +01:00
Matt Prahl
91af4a1840 Change cancel build API to be a PATCH instead 2016-11-30 15:00:32 -05:00
Ralph Bean
439721da99 Gather build groups from module profiles.
Fixes #181.

When initializing the buildroot for a module build, we used to set up
some build 'groups' for the tag: `build` and `srpm-build`.  These are
the lists of RPMs that koji is supposed to install into the buildroot
before anything else is done.  Crucial stuff goes here, like `git` in
the `srpm-build` group so that koji can clone the repo in the first
place.

We had those lists hardcoded before.  This list changes that to use the
`buildroot` and `srpm-buildroot` profiles of the modules which are our
dependencies (recursively).

This will allow people like @psabata and the base-runtime to make
changes to the build groups for the generational core and work around
their own problems, instead of having to ask us to expand that list.

There were a couple ways to do this:

- I could've cloned the SCM repos for all dependencies and gotten their
  profiles from the modulemd source there.  This seemed flimsy because
  we only want to depend on the profiles of modules that were *really*
  built.
- We could modify PDC to stuff the modulemd contents in there.  We
  already get some dep and tag info from PDC.  My thought here was that
  it would be too heavyweight to store every copy of the modulemd file
  in PDC for every build ever.  We already have it in MBS.
- Lastly, and this is what I did here, I just referred to MBS' own
  database to get the profiles.  This seems to work just fine.

One side-effect is that we need the build profiles from the manually
bootstrapped modules that were put together by hand, and were never
built in the MBS.  In order to work around that, I added an alembic
upgrade script which pre-populates the database with one fake
bootstrapped base-runtime module.  We can expand on that in the future
if we need.
2016-11-21 13:25:52 -05:00
Matt Prahl
244b77f54c Add component build throttling 2016-11-16 15:24:17 -05:00
Jan Kaluza
966a73251a Add support for modulemd-1.0 backward-incompatible changes like commit being replaced by ref 2016-11-14 15:32:51 +01:00
Filip Valder
0b7441e8fb imported but not used 2016-11-07 20:27:03 +01:00