summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/cli.py
Commit message (Collapse)AuthorAgeFilesLines
* Add --remote, -r option to bst build, inline with pull & pushTom Pollard2019-02-051-3/+6
| | | | | | Providing a remote will limit build's pull/push remote actions to the given remote specifically, ignoring those defined via user or project configuration.
* BREAK:remove unconditional 'are you sure?' promptsAngelos Evripiotis2019-01-291-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a breaking change, as it affects behaviour that people might be relying on. An entry has been added to NEWS. As proposed on the mailing list, this change removes the unconditional prompts on: o: bst workspace reset o: bst workspace close --remove-dir If interactive, these commands would always interrupt you with a prompt like this: This will remove all your changes, are you sure? This seems like it may just save someone's work some time. It may also condition folks to hit 'y' quickly without thinking. This change also makes the non-interactive behaviour consistent with the interactive behaviour in the default case. There is also the case of the prompt configured by 'really-workspace-close-project-inaccessible', which may be tackled in later work. This change also removes the new config options to suppress those prompts, and their associated news entry. The relevant bit of the mailing list conversation is here: https://mail.gnome.org/archives/buildstream-list/2018-December/msg00106.html The issue to make interactive and non-interactive behaviour consistent is here: https://gitlab.com/BuildStream/buildstream/issues/744
* Download buildtrees on demand for bst shell --use-buildtreetpollard/829Tom Pollard2019-01-281-14/+26
| | | | | | | | | | | | | | | | | Provide bst shell --use-buildtree the ability to attempt to acquire missing buildtrees, given respective option, user pull-buildtree context and remote availability. _frontend/cli.py: Refactor logic for determining --use-buildtree option with given opportunity to attempt pulling a non-local buildtree. Element loaded with artifact_config to allow remote querying. _stream.py: With given user option and element state, construct PullQueue to fetch remote buildtree. Continue or Error without buildtree if cannot be attained. tests/integration/build-tree.py: Update to support new usecases
* _frontend/cli.py: Ignore junctions in default targets where appropriateJürg Billeter2019-01-241-2/+17
| | | | | | | Junctions cannot be built, pulled, or pushed. Specifying a junction on the command line for these commands will result in an error. However, junctions may be in the list of default targets, so they need to be ignored for build, pull, and push commands.
* _project.py: Add get_default_target() and get_default_targets() methodsJürg Billeter2019-01-241-25/+68
| | | | | | _frontend/cli.py: Use new methods. Based on patches by Phillip Smyth.
* _frontend/cli.py: Guess element also for bst build --allJürg Billeter2019-01-241-1/+1
| | | | There is no reason to disallow guess_element() for bst build --all.
* cli.py: Add an obsoletion note to our deprecated commands.James Ennis2019-01-221-5/+5
| | | | | | | | | Click 7.0 allows us to declare commands as 'hidden'. However, sphinx-click and click-man still generate these hidden commands in the documentation and man pages, respectively. This is a stop gap solution until the upstream issues (tracked in issues #879 and #881) have been addressed.
* Mark 'old' checkout command as obsoleteJames Ennis2019-01-221-61/+27
| | | | | | | | | | | This commit marks 'bst checkout' as a 'hidden' command. If used, the user will be prompted to use the new 'bst artifact checkout' command. All tests which used 'bst checkout' have been modified to use the new artifact sub-command. This partially solves #822.
* cli: Add artifact checkout subcommandJames Ennis2019-01-221-0/+69
| | | | | | 'artifact checkout' has slightly different behaviour from 'checkout', that is, either '--directory' or '--tar' are now required options. This is a step towards allowing checkout to take multiple args.
* Move push and pull to the new artifact subcommand groupJames Ennis2019-01-221-72/+106
| | | | | This commit also ensures that if we try to use the 'old' commands, BuildStream will fail and instruct the user to use the new command.
* cli.py: add a hint about '--' to 'bst shell' helpAngelos Evripiotis2019-01-181-0/+6
|
* _frontend/cli.py: Also check original args for --config in bash completionJürg Billeter2019-01-141-7/+20
| | | | | | | The path of the config file generated by testutils for completion tests is passed as regular argument, not via COMP_WORDS. Use that config file in complete_artifact() to ensure the test uses the right artifact directory.
* _frontend/cli.py: Reinstate support for guessing targetsjuerg/source-guess-targetJürg Billeter2019-01-041-0/+10
| | | | | | Moving fetch and track to the source command group accidentally dropped the support for guessing targets for these commands when invoked from a workspace directory. This brings it back.
* _frontend/cli.py: Fixing new (unnecessary-pass) linter errorsTristan Van Berkom2018-12-261-3/+0
|
* Basic options for shell --build to use buildtreesWilliam Salmon2018-12-191-2/+25
| | | | Fixes issue #740
* Introduce new "source" command groupChandan Singh2018-12-141-102/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the message thread https://mail.gnome.org/archives/buildstream-list/2018-November/msg00106.html, implement a new command group called `source`. Move existing `track`, `fetch`, and the recently added `source-checkout` commands under this group. For `track` and `fetch`, this is a BREAKING change, as the old commands have been marked as obsolete. Using them will result in an error message that refers people to use the new versions, like `bst source fetch` instead of old `bst fetch`. `source-checkout` will now become `source checkout` (the dash has turned into a space), and is not a breaking change as it was added in the current development cycle. Note that the functionality to hide commands from help output was added only recently in Click, so the minimum version of Click that we now require is 7.0. Summary of changes: * _frontend/cli.py: Add `source` command group, mark previous versions as obsolete and hide them from the help output. * _frontend/complete.py: Fix completion for hidden commands. * setup.py: Bump Click minimum version to 7.0. * tests: Update to cope with the new command names. Fixes #814.
* cli: Add artifact log commandRichard Maw2018-12-121-0/+59
|
* cli: Add artifact command groupRichard Maw2018-12-121-0/+42
|
* cli: Add support for auto-completing artifact ref namesRichard Maw2018-12-121-7/+26
|
* Remove source bundle commandPhil Dawson2018-12-121-31/+0
| | | | This is part of the work towards #672
* Add option to source-checkout command to generate build scriptsPhil Dawson2018-12-121-4/+6
|
* Add --force / -f option to source-checkout commandPhil Dawson2018-12-121-1/+4
|
* Add --tar option to source-checkout commandPhil Dawson2018-12-121-2/+6
| | | | This commit is part of the work towards #672
* Make specifying elements optional in bst commandsJonathan Maw2018-12-111-13/+85
| | | | | | | | | | | | | | | | | | | | | | Known issues: * `bst shell` works, but `bst shell COMMANDS...` doesn't, because click has no way of separating optional args from variable-length args. * `bst checkout` and `bst source-checkout`'s usage strings mark LOCATION as an optional argument. Because click gets confused if there's an optional argument before a mandatory argument, I had to mark LOCATION as optional internally. * `bst workspace open` makes no sense with element being optional, so I skipped it. * `bst workspace close` will probably need to be revisited when multiple projects can own one workspace. * `bst workspace reset` will happily delete the directory you're currently in, requiring you to `cd $PWD` to see the contents of your directory. I could exclude the top-level directory of the workspace being deleted, but it is entirely valid to run workspace commands from deeper in the workspace. This is a part of #222
* cli: Interactively warn if the user is trying to close the workspace they're ↵Jonathan Maw2018-12-111-1/+9
| | | | | | | | | | | | | | | | | | | using to load the project This involves changes in: * _stream.py: * Add the helper Stream.workspace_is_required() * userconfig.yaml: * Add a default value for prompt.really-workspace-close-project-inaccessible * _context.py: * Load the prompt 'really-workspace-close-project-inaccessible' from user config. * cli.py: * If buildstream is invoked interactively, prompt the user to confirm that they want to close the workspace they're using to load this project. This is a part of #222
* cli.py: Use utils' search upwards helper when searching for project.confJonathan Maw2018-12-111-11/+2
| | | | This is a part of #222
* Refactor and simplify _prepare_sandbox for elementsBenjamin Schubert2018-12-031-1/+9
| | | | | | | | Before we would have a intricate logics with multiple arguments that might get ignored. This simplifies the design and introduces a bool `shell` instead of having two different variables concerned about scope
* Add `--deps build` option to `bst checkout`Chandan Singh2018-12-031-1/+1
| | | | | | | | | | | | | | | As discussed in https://mail.gnome.org/archives/buildstream-list/2018-September/msg00064.html, add `--deps build` option to `bst checkout`. This will allow users to checkout the all build dependencies of a given element using a single command. - _frontend/cli.py: Add `--deps build` option for `bst checkout`. - element.py: Support `deps='build'` in Element._prepare_sandbox(). - tests/frontend/buildcheckout.py: Ensure `--deps build` works as expected.
* cli.py: no autocomplete on files without .bstPhillip Smyth2018-11-301-1/+5
|
* _stream.py: Ability to pull missing buildtrees outside of pull/buildTom Pollard2018-11-301-0/+4
| | | | | | | | | | | | | | | | | | Adds helper function _buildtree_pull_required() to determine if a pullqueue should be constructed, for commands outside of bst pull and build where it is determined that an element's buildtree artifact is to be required given the respective semantics and config. Utilised in push() to attempt to mitigate skipping the push of partial elements without the user having to have preceded it with an explicit pull. cli.py: Add new behaviour to push command description element.py: Move _cached_buildtree() to be non local private method, use _KeyStrength types to reduce duplication. tests/integration/pullbuildtrees.py also updated to cover this use-case.
* Workspace CLI updateWilliam Salmon2018-11-211-17/+9
| | | | | | | This is to update the workspace CLI to as agreed on the mailing list https://mail.gnome.org/archives/buildstream-list/2018-September/msg00046.html This patch also introduces the default workspace directory.
* Add prompt.workspace-... optionsAngelos Evripiotis2018-11-201-2/+2
| | | | | | | | | | Provide options in project.conf to disable the 'Are you sure ...' prompts when making destructive changes: - Add prompt.really-workspace-close-remove-dir - Add prompt.really-workspace-reset-hard Add a NEWS item for these.
* Add `bst source-checkout` commandChandan Singh2018-11-191-0/+27
| | | | | | | | | | | | As discussed in https://mail.gnome.org/archives/buildstream-list/2018-September/msg00064.html, add `bst source-checkout` command. This will allow users to checkout sources for a given target. * _frontend/cli.py: Add source-checkout command * _pipeline.py: Add assert_sources_cached() method * _stream.py: Add source_checkout method, abstract out __check_location_writable() method that used to part of checkout()
* Add cli main and user config option for 'pull-buildtrees' context.Tom Pollard2018-11-171-0/+2
| | | | | | | | | | | | _context.py: Add pull_buildtrees global user context, the default of which is set to False via the addition of pull-buildtrees to userconfig.yaml cache group. _frontend/app.py & cli.py: Add --pull-buildtrees as a bst main option, which when passed will override the default or user defined context for pull_buildtrees. tests/completions/completions.py: Update for the added flag.
* Fix spelling of it's and itsRichard Dale2018-10-161-1/+1
|
* Set default mirror via command-line or user configJonathan Maw2018-07-271-0/+2
| | | | | | | In user config (buildstream.conf), it is set with the "default-mirror" field. On the command-line, it is set with "--default-mirror"
* Add support for creating a tarball on bst checkouttiagogomes/tarball_checkoutTiago Gomes2018-07-201-7/+17
| | | | | | | | One of the tests added is configured to be skipped for now, as dumping binary data is causing a bad descriptor exception when using the pytest capture module. Closes #263.
* source-bundle: Enable --except optionfranred/fix-except-argument-in-source-bundleFrancisco Redondo Marchena2018-07-191-1/+2
| | | | | | | Before this option was listed in help but was ignored when creating the source-bundle. Issue #468
* _frontend/cli.py: Fix help text for `bst checkout --deps`Jürg Billeter2018-07-171-1/+1
|
* buildstream/_frontend/cli.py: Added a `--deps` flag to `bst checkout`Phillip Smyth2018-07-171-1/+5
| | | | | buildstream/_stream.py: Added deps param to _prepare_sandbox function call buildstream/element.py: Added deps param and logic to _prepare_sandbox function
* Only redirect elements for workspace and track operationsPRE_CAS_MERGE_JULY_2018Jonathan Maw2018-07-161-0/+4
| | | | It was redirecting for checkout operations
* cli.py: Make buildstream check element paths instead of clickTristan Maat2018-06-291-18/+18
| | | | | This is to avoid inconsistencies when dealing with paths inside an elements directory
* Handle cross junction elements in workspaces.Valentin David2018-06-081-2/+2
| | | | | | | | | | | Workspaces are now index by colon separated junction path. This now allows to create workspaces for elements in external projects. Workspaces are owned by context instead of root project. However it is initialized once top-level project is registered as we need to resolve paths relatively to this top-level project. Part of #359.
* _frontend/cli.py: Allow specifying commands in `bst help`Tristan Van Berkom2018-06-071-9/+62
| | | | | | o This supports deeply nested commands as well as shallow commands o Automated support for bash completions included
* Implement bst helpEd Baunton2018-06-071-3/+15
|
* Make `bst help` workEd Baunton2018-06-071-0/+4
|
* _frontend/cli.py: Try to autocomplete element paths when running from a ↵Chandan Singh2018-06-061-1/+17
| | | | | | | | subdirectory The previous commit added support for running bst commands form subdirectories of the project root. Make autocomplete also work in a similar way.
* Redirect elements when performing tracking and workspace commandsJonathan Maw2018-05-171-9/+5
| | | | i.e. when an element is specified, it may be replaced with its source element.
* _frontend: Notify failures when on linuxtristan/platform-appTristan Van Berkom2018-05-171-1/+1
| | | | | | | | Opens the door to platform specific frontend features, and implements a platform specific "notify" method. This is based on Valentin David's patch on merge request 447, and this fixes issue #385.
* _frontend/cli.py: Remove bst show --downloadable optionJürg Billeter2018-05-111-5/+2
| | | | This is in preparation for moving away from summary files.