Code management: scc ==================== scc is a Python library with a set of utility commands used for code management and used in the OME :doc:`continuous-integration`. More information can be found in the :pypi:`Python package page ` or in the `source code page `_. If you find a bug or if you want an additional feature to be implemented, please `open an issue `_. Installation ------------ The scc tools are a set of Python_ based utility programs. The tools suite can be installed using :command:`pip`:: $ pip install -U scc This command will install and/or upgrade the **PyGithub** and **yaclifw** package dependencies. If the version of Python installed is older than 2.7, this may also install the **argparse** package. Github connection ----------------- .. _About Two-Factor Authentication: https://help.github.com/articles/about-two-factor-authentication/ .. _Creating an access token for command-line use: https://help.github.com/articles/creating-an-access-token-for-command-line-use/ Most of the scc commands instantiate a Github connection using the PyGithub package. GitHub strongly recommends to turn on two-factor authentification (2FA), see `About Two-Factor Authentication`_ for more details. If 2FA is activated, the only way to use scc commands creating a GitHub connection is to create an OAuth token, see `Creating an access token for command-line use`_ for details on how to create Personal Access Tokens via the GitHub interface. This token can then be stored in the global Git configuration file:: git config --global github.token REPLACE_BY_PERSONAL_ACCESS_TOKEN Unless the ``--token`` option is passed to the scc command, the command first looks for the ``github.token`` specified in the git config file and, if found, uses this token to connect to GitHub:: $ scc merge master --info -v 2013-01-16 22:03:49,633 [ scc.config] DEBUG Found github.token ... If no token is found, the command looks for a ``github.user`` in the git config file and, if found, uses this username to connect to Github:: $ scc merge master --info -v 2013-01-16 22:06:00,256 [ scc.config] DEBUG Found github.user Enter password for https://github.com/sbesson: .. note:: The password to be entered here is the GitHub password. Connecting using the GitHub username/password is NOT possible if 2FA has been activated. Finally, if no token or user is found, both the GitHub username and password are queried at the prompt:: $ scc merge master --info -v # github.token and github.user not found. # See `scc token` for simpifying use. Username or token: sbesson Enter password for https://github.com/sbesson: .. _scc merge: scc merge --------- Merge all the PRs based on specified branch matching the input filters including all submodules. Description ^^^^^^^^^^^ Filters of different types can be specified and combined to include and exclude a set of PRs in the merge command. Each filter needs to be formatted as ``key:value``. If no key but only a value is specified, it is assumed the filter is a label filter (see below). These filters can be passed to an :option:`scc merge --include` or :option:`scc merge --exclude` option. The available filter types are described below: - Label filters can be specified using the ``label`` key i.e. ``label: