From 987ac343127be7bb519650df8bd7bbba674aebc7 Mon Sep 17 00:00:00 2001 From: Henrik Holmboe Date: Tue, 26 Nov 2024 15:43:22 +0100 Subject: [PATCH] Some cleanups in the README and other small housekeeping --- .github/dependabot.yml | 1 + .github/workflows/tox.yml | 1 + .travis.yml | 1 + CHANGELOG.md | 4 +-- Dockerfile | 1 - MANIFEST.in | 2 +- README.md | 53 +++++++++++++++++++++++---------------- mkdocs.yml | 1 + phabfive/diffusion.py | 2 +- phabfive/maniphest.py | 2 +- setup.cfg | 2 +- test-template-v2.yml | 4 +-- 12 files changed, 44 insertions(+), 30 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index eff7b5f..78e32a4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,4 @@ +--- version: 2 updates: - package-ecosystem: pip diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 344ab4d..fa49661 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -1,3 +1,4 @@ +--- name: Tests on: diff --git a/.travis.yml b/.travis.yml index 072b15e..bdd422b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +--- sudo: false dist: xenial language: python diff --git a/CHANGELOG.md b/CHANGELOG.md index 379f04e..894107a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,6 @@ Supported Phabricator app endpoints: * [#24](https://github.com/dynamist/phabfive/pull/24) - Enable RTD build and docs updates * [#18](https://github.com/dynamist/phabfive/pull/18) - Add code coverage to tox * [#17](https://github.com/dynamist/phabfive/pull/17) - Proper flake8 with Black -* [#4](https://github.com/dynamist/phabfive/pull/4) - Add encrypted notification config to .travis.yml +* [#4](https://github.com/dynamist/phabfive/pull/4) - Add encrypted notification config to .travis.yml * [#2](https://github.com/dynamist/phabfive/pull/2) - Black-linting -* [#1](https://github.com/dynamist/phabfive/pull/1) - Added travis +* [#1](https://github.com/dynamist/phabfive/pull/1) - Added travis diff --git a/Dockerfile b/Dockerfile index d1beb7e..92fe70b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,4 +11,3 @@ RUN pip3 install -e . ENTRYPOINT ["/usr/bin/phabfive"] CMD ["$1"] - diff --git a/MANIFEST.in b/MANIFEST.in index 0d90008..775e019 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include CHANGELOG.md include README.md -include LICENSE \ No newline at end of file +include LICENSE diff --git a/README.md b/README.md index 7def315..8be0125 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ # phabfive -A command line tool to interact with Phabricator - -The complete documentation for Phabfive can be found at [Read the Docs](https://phabfive.readthedocs.io/en/latest/) +A command line tool to interact with Phabricator. +The complete documentation for Phabfive can be found at [Read the Docs](https://phabfive.readthedocs.io/en/latest/). ## Features @@ -11,6 +10,7 @@ A summary of the currently supported features: - Passphrase - Get specified secret + - Diffusion - List repositories - Get branches for specified repository @@ -18,61 +18,72 @@ A summary of the currently supported features: - Add repository - Edit URI - Create URI (observe repository) + - Paste - List pastes - Get specified paste - Add paste + - User - Who am I: information about the logged-in user + - Maniphest - Add comment to task - Show task summary or full details - Create multiple tasks via template config file - ## Example usage Grab a Phabricator token at `https:///settings/panel/apitokens/` Configure: - export PHAB_TOKEN=cli-ABC123 - --OR-- - echo "PHAB_TOKEN: cli-ABC123" > ~/.config/phabfive.yaml +```bash +export PHAB_TOKEN=cli-ABC123 +# --OR-- +echo "PHAB_TOKEN: cli-ABC123" > ~/.config/phabfive.yaml +``` Usage: - phabfive passphrase K123 - +```bash +phabfive passphrase K123 +``` ## Run local development phabricator instance -First add the following `127.0.0.1 phabricator.domain.tld` to your `/etc/hosts` file +First add the following to your `/etc/hosts` file: -Next start the mysql instance separate from the phabricator instance with +```text +127.0.0.1 phabricator.domain.tld +``` -`docker compose -f docker-compose-phabricator.yml up mysql` +Next start the mysql instance separate (in the first terminal) from the phabricator instance with -Then after the database is up and running yo ucan start the webserver with +```bash +docker compose -f docker-compose-phabricator.yml up mysql +``` -`docker compose -f docker-compose-phabricator.yml up phabricator` +Then after the database is up and running you can start the webserver with (in a second terminal) -This startup will take some time to setup the demo instance. Once completed you can access your instance in your browser at `http://phabricator.domain.tld/`. On first use you need to setup your admin account. Most development for phabfive requires an API token, create one here `http://phabricator.domain.tld/settings/user//page/apitokens/` +```bash +docker compose -f docker-compose-phabricator.yml up phabricator +``` -Note there is no persistance disks so if the container is shutdown any data will be lost and you have to restart +This startup will take some time to setup the demo instance. Once completed you can access your instance in your browser at `http://phabricator.domain.tld/`. On first use you need to setup your admin account. Most development for phabfive requires an API token, create one here `http://phabricator.domain.tld/settings/user//page/apitokens/`. +Note there is no persistence disks so if the container is shutdown any data will be lost and you have to restart. ## Building a release -For version schema we follow basic SemVer versioning schema system with the extensions that is defined by python in this PEP440 https://peps.python.org/pep-0440/ It allows for some post and dev releases if we need to, but in general we should only publish stable regular semver releases. - -Instructions how to build a release and upload it to PyPi can be found here in the official build tools documentation site https://packaging.python.org/en/latest/tutorials/packaging-projects/ +For version schema we follow basic [SemVer](https://semver.org/) versioning schema system with the extensions that is defined by python in this [PEP 440](https://peps.python.org/pep-0440/). It allows for some post and dev releases if we need to, but in general we should only publish stable regular semver releases. -In order to be allowed to upload a new release for phabfive, you need to be a Owner or maintainer for this project inside PyPi. Currently only Johan and Henrik is owners. Ask them for assistance if you need upload permissions for a new release. +Instructions how to build a release and upload it to PyPi can be found in the official [packaging documentation at Python.org](https://packaging.python.org/en/latest/tutorials/packaging-projects/). +In order to be allowed to upload a new release for phabfive, you need to be a *owner* or *maintainer* for this project inside PyPi. Currently only Johan and Henrik are owners. Ask them for assistance if you need permissions to upload a new release. ## LICENSE -Copyright (c) 2017-2023 Dynamist AB +Copyright (c) 2017-2024 Dynamist AB See the LICENSE file provided with the source distribution for full details. diff --git a/mkdocs.yml b/mkdocs.yml index 9c6de2f..c56418c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,3 +1,4 @@ +--- site_name: Phabfive theme: readthedocs repo_url: https://github.com/dynamist/phabfive diff --git a/phabfive/diffusion.py b/phabfive/diffusion.py index 0d3a014..c97b814 100644 --- a/phabfive/diffusion.py +++ b/phabfive/diffusion.py @@ -55,7 +55,7 @@ def get_object_identifier(self, repo_name=None, uri_name=None): if repo_name != name: continue - + # object identifier for uri if repo_name and uri_name: uris = repo["attachments"]["uris"]["uris"] diff --git a/phabfive/maniphest.py b/phabfive/maniphest.py index d93988e..a16209b 100644 --- a/phabfive/maniphest.py +++ b/phabfive/maniphest.py @@ -250,7 +250,7 @@ def recurse_commit_transactions(task_config, parent_task_config): if transactions_to_commit: # Parent ticket based on the task hiearchy defined in the config file we parsed is different - # from the explicit "ticket parent" that can be defined + # from the explicit "ticket parent" that can be defined if parent_task_config and "phid" in parent_task_config: add_transaction(transactions_to_commit, "parents.add", [parent_task_config["phid"]]) diff --git a/setup.cfg b/setup.cfg index fe29876..1a76156 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,4 +3,4 @@ ignore = E501 exclude = .git,.venv,.tox [bdist_wheel] -universal = 1 \ No newline at end of file +universal = 1 diff --git a/test-template-v2.yml b/test-template-v2.yml index da48281..8ce4d94 100644 --- a/test-template-v2.yml +++ b/test-template-v2.yml @@ -1,5 +1,5 @@ -# Requirements to run this example file is that you create the following things in -# your test phabricator instance before this file will go through +# Requirements to run this example file is that you create the following things +# in your test Phabricator instance before this file will go through # # - A user named: hholm # - A user named: grok