summaryrefslogtreecommitdiff
path: root/buildstream/_frontend
Commit message (Collapse)AuthorAgeFilesLines
* Overwrite sys.excepthook to handle exceptions in the main application.tristan/except-hook-no-testTristan Van Berkom2018-04-231-0/+21
| | | | | | | | | | | | | This uses the existing messaging system to report errors in the main application as a BUG type. It requires the use of a global_app variable which isn't ideal; this may be replaced in future. This partially addresses issue #197. Theoretically, an exception could occur before Scheduler.loop is set up, hence the check for it when terminating all jobs. NOTE: This was originally submitted by Jim MacArthur, and manually reapplied after some refactoring took place.
* buildstream/_frontend/status.py: Fixing unused variablesTristan Van Berkom2018-04-191-1/+1
|
* buildstream/_frontend/app.py: Fixing unused variablesTristan Van Berkom2018-04-191-1/+1
|
* _frontend/cli.py: Set the track_selection argument to the deps parameterTristan Van Berkom2018-04-191-1/+1
| | | | | | | Tell the pipeline to only track either 'none' or 'all' PipelineSelection modes. This fixes issue #367
* _pipeline.py, _frontend/app.py: Added track_selection initialization argumentTristan Van Berkom2018-04-191-4/+10
| | | | | This informs the pipeline what PipelineSelection mode to use for constructing the list of elements to track.
* _pipeline.py: Added PipelineSelectionTristan Van Berkom2018-04-191-6/+6
| | | | | | | | Part of a slow, ongoing refactor to unmangle the pipeline into something which just creates pipelines of elements for a centerpiece to process. This also renames Pipeline.deps_elements() -> Pipeline.get_selection()
* frontend: Log which elements resolved new keysRichard Maw2018-04-181-0/+15
| | | | | | | | | | | It can be difficult to pick out important information in all the messages, so it's convenient to have classes of them collected into one place. One such class of important information is when the cache key of an element changes, such as when element's source is tracked or cached from a workspace, since it can be important to know what the cache key is for that artifact. Fixes issue #252
* _scheduler/scheduler.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-181-9/+5
| | | | | | | | | | Also added Scheduler.jobs_suspended() context manager to use in the App instead of exposing Scheduler.suspend_jobs() and Scheduler.resume_jobs() along with signal callback connect and disconnect APIs, this keeps things more private in the scheduler. This is a part of issue #285
* _frontend/cli.py: Add option to reset multiple workspacesChandan Singh2018-04-171-6/+16
| | | | | | !357 added support for closing multiple workspaces. Similarly, also allow `bst workspace reset` to work on multiple workspaces, with `--all` as a helper to reset all open workspaces.
* refactor: Do not assume there is only one workspace target in app.pyChandan Singh2018-04-172-9/+11
| | | | | | | | | | | While working with workspaces in _frontend/app.py, we currently assume that there is only workspace in the pippeline. This limits our ability to support multiple workspaces in a given command. Remove this assumption from _frontend/app.py which will allow for the possibility of supporting multiple workspaces from _frontend/cli.py in future. This commit does not change the behavior of these commands though as the target is instead passed as an argument.
* _frontend: Earlier assertion for `bst workspace open` when directory is not ↵Tristan Van Berkom2018-04-172-3/+10
| | | | | | | | empty This just raises the error to the user that the checkout directory where they intend to create a workspace in is not empty, a little bit earlier, without bothering to initialize the pipeline first.
* _frontend: Fix error messaging for closing workspacesTristan Van Berkom2018-04-172-5/+5
| | | | This fixes issue #182 again
* _frontend/widget.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-151-269/+307
| | | | This is a part of issue #285
* _frontend/status.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-151-141/+183
| | | | This is a part of issue #285
* _frontend/profile.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-151-3/+3
| | | | This is a part of issue #285
* _frontend/app.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-151-190/+221
| | | | This is a part of issue #285
* element.py: Rename _get_full_display_key() -> _get_display_key()Tristan Van Berkom2018-04-142-3/+3
| | | | | | The extra "full" was a bit redundant here, the Element does not export any "less than full" display key accessor, so lets use a more simple name for this.
* frontend: Redisplay failure messages in result summaryRichard Maw2018-04-121-1/+12
| | | | | It's more convenient than having to search back through all the output to find out what the cause of failure was.
* frontend: Control indentations of multi-line valuesRichard Maw2018-04-121-0/+5
|
* frontend: Summarise build log output in --no-verbose modeRichard Maw2018-04-121-10/+18
|
* frontend: Use textwrap.indent to indentRichard Maw2018-04-121-1/+2
| | | | The intent is more obvious by using an existing module.
* frontend: capture errors for later useRichard Maw2018-04-121-1/+12
| | | | This will be used to provide an error summary before the pipeline summary.
* Fix disaster while making cross junction tracking optional.Tristan Van Berkom2018-04-132-9/+13
| | | | | | | | | | | | | | | | | This disaster was introduced in fece8cc81e8d8412e32c6667682a33e7d2f9dafe When doing `bst build --track`, we were: o first scheduling every element to be tracked o later filtering out the cross junction elements o finally asserting consistency state, which would trigger an error because we previously scheduled for tracking. Fixed this by moving all code which resolves elements to track into Pipeline.initialize(), and removing special element list handling from the individual build/fetch/track commands.
* _frontend/cli.py, _pipeline.py: Add options for cross junction tracking.Tristan Van Berkom2018-04-122-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | This patch makes cross junction tracking disabled by default, which was the initial intention when landing project.refs but never got around to doing this (intended to get addressing of junctioned elements via command line sorted first, but didnt happen). This adds the following options to enable cross-junction tracking: o bst build -J / --track-cross-junctions o bst fetch -J / --track-cross-junctions o bst track -J / --cross-junctions This also fixes `bst fetch --track` which had a bug, it was avoiding to track and fetch elements which are in a `cached` consistency state, which is wrong when `--track` is specified. This also updates some test cases which were broken by this change. This fixes issue #354
* _frontend/widget.py: Fixed regression in logfile abbreviations.Tristan Van Berkom2018-04-121-0/+4
| | | | | | Added required size_request() method to new MessageOrLogFile() widget. This came up in merge request !377
* _frontend/status.py: Fixed status widgets to show full element names.Tristan Van Berkom2018-04-121-2/+2
|
* _frontend/widget.py: Correct log line if logdir is emptyjmac/logfile-widget-correctionJim MacArthur2018-04-101-2/+3
|
* _workspaces.py: Remove knowledge of Elements completelyTristan Van Berkom2018-04-101-2/+2
| | | | | | | | | | | | | This makes workspaces more cleanly separated from everything else. o Removed some methods from Workspace() o Added Element._open_workspace() to initialize workspaces on sources o Cleanup some code in the pipeline o Have the App() call Element._open_workspace() instead of Workspace.open()
* element.py: Factored out pointless extra Element._workspaced() methodTristan Van Berkom2018-04-091-1/+1
|
* element.py: Cache source consistency logic and refactor workspace logic into ↵Tristan Van Berkom2018-04-092-2/+2
| | | | | | | Element Workspaces are now element wide, so consistency edge cases must be handled at the element level instead of the source level.
* _frontend/app.py: Automatically launch interactive `bst init` when ↵Tristan Van Berkom2018-04-081-1/+13
| | | | | | | | | | project.conf is absent When running a command where a project.conf does not exist, ask the user if they would like to interactively create a project in the said directory. This is a part of issue #342
* _frontend/cli.py, _frontend/app.py: Implemented new `bst init` command.Tristan Van Berkom2018-04-082-2/+227
| | | | | | | This comes with an interactive mode unless the project name is specified on the command line. This fixes issue #342
* _frontend/cli.py: Remove --no-checkout option for `bst workspace reset`Tristan Van Berkom2018-04-072-7/+4
| | | | This option in `bst workspace reset` is just pointless.
* _frontend/cli.py: Add option to close multiple workspacesChandan Singh2018-04-071-4/+13
| | | | | | | | | | | | | At present, it is only possible to close workspaces for elements one at a time. This can become slightly tedious process when you have multiple workspaces open and you want to close all of them, maybe because you just finished working on a set of related elements. Instead of accepting a single element, accept a list of elements as argument for `bst workspace close`. Additionally, add `-a`/`--all` option to close all workspaces. Fixes #337 - Add option to close all workspaces.
* _frontend/app.py: More consistent error reportingTristan Van Berkom2018-04-051-6/+10
| | | | | Use App.print_error() in all error exit circumstances, this will automatically consider any detail strings reported in BstErrors.
* _frontend/widget.py: Print the workspace directory for %{workspace-dirs}Tristan Van Berkom2018-04-051-5/+4
| | | | | | | | Instead of printing the list of workspace directory for each source. This fixes some fallout from the changes to make workspaces element-wide instead of being on a per-source basis, which was merged as merge request !257 as a part of issue #209.
* _frontend/widget.py: Defend against empty string message detailTristan Van Berkom2018-04-051-1/+1
| | | | | | It appears we have some cases of empty detail strings that are not None, this was resulting in an IndexError when trying to strip the trailing newline from the message.detail.splitlines() result.
* _options package: Adhere to policy on private symbolsTristan Van Berkom2018-04-051-4/+3
| | | | | | | | This also adds a couple of methods to OptionPool to avoid exposing some internals to other parts of the codebase, and calls those new methods from _project.py and _frontend/widget.py This is a part of issue #285
* Fix strict setting to be consistent throughout the pipeline.Tristan Van Berkom2018-04-041-1/+1
| | | | | | | | | | | | I originally changed the configuration of strict mode to be on a per project basis in the user configuration, because the user should be able to set their preference on a per project basis. I however made the mistake to make the strict mode be considered on a per project basis within a single pipeline, this commit corrects the behavior such that when you are building a project with junctions, only the toplevel project is considered when deciding strict mode for the whole pipeline.
* _project.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-033-11/+11
| | | | | | | | | | | | | | | And adjust all surrounding sources for changed symbols. Additional details: o Added Project.get_shell_config() to report the shell configuration, instead of making those members all public o Moved assertions about project specified format versions required of plugins out of Plugin.__init__, and into Project.create_element() and Project.create_source(), so we can keep more things private This is a part of issue #285
* _context.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-032-7/+7
| | | | | | And adjust all surrounding sources for changed symbols. This is a part of issue #285
* Refactoring of highlevel workspace codeTristan Van Berkom2018-04-022-50/+142
| | | | | | | | | | | | | | | | | | Move all workspace related code out of Pipeline() and into the frontend App() object. Some changes in transition here include: o Workspaces() object methods for looking up and deleting workspaces now take an element name instead of an element. o Share code for partial App() initialization between the `workspace close` and `workspace list` commands o No longer require that an element exist in the project in order to close a workspace This fixes issue #249
* _frontend/app.py: Split up initialization into two parts.Tristan Van Berkom2018-04-021-78/+101
| | | | | | | Created partial_init() function to do a partial initialization which does not require loading the Pipeline, which is more expensive. This is useful for some bst commands which dont operate on a pipeline.
* _frontend/app.py: Renamed from main.pyTristan Van Berkom2018-04-022-1/+1
| | | | | Since the CLI and the App object was split up, we should name the file after the object which it implements.
* _frontend/widget.py: Change heading separator to use '=' instead of '~'Tristan Van Berkom2018-04-021-1/+1
| | | | | Seems that using `~` conflicts with some markdown when trying to paste build logs in, e.g. gitlab issues.
* _frontend/widget.py: Add "Strict Build Plan" setting to session headingTristan Van Berkom2018-04-021-0/+1
| | | | Looks like this quite interesting attribute was not getting logged.
* Include initialization time in the total session time of the build logTristan Van Berkom2018-04-012-113/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactors the frontend App object and touches a few internals. o The scheduler now takes a start time given to it at instantiation time, instead of considering the start time to commence in Scheduler.run() o The App.initialize() method has been swapped out for an App.initialized() context manager. This context manager now takes care of the main start/fail/success messages. For convenience and ensured consistency, this context manager is now responsible for: o Printing the startup heading o Printing the end of session summary o Exiting with a consistent error status in case of errors o The Pipeline() object no longer prints the start/fail/success messages, as they are now taken care of by the App() o The cli.py frontend code is much simplified by using the new context manager, also enforcing consistency in how we handle and report errors. This fixes issue #186
* Make workspaces use objects instead of pipeline helper methodsTristan Maat2018-03-271-6/+5
|
* Remove unused importsJürg Billeter2018-03-251-6/+2
|
* _message.py, _frontend/widget.py: Reviving MessageType.ERRORTristan Van Berkom2018-03-211-4/+9
| | | | | | | | | | We need to distinguish between: o Errors which occurred in a task, and are related to a log file and an elapsed time. o Errors which occurred in the main process and are not related to any timed activity