diff --git a/README.md b/README.md index 4de9d40..190dc93 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ For complete documentation, see [Read the Docs](https://phabfive.readthedocs.io/ # Install uv if you haven't already curl -LsSf https://astral.sh/uv/install.sh | sh +Configure in Linux: # Install phabfive uv tool install phabfive @@ -30,6 +31,34 @@ uv venv uv pip install phabfive ``` +Configure in Windows: + +Phabfive looks for configuration in the following sequence in Windows environment: + +```Commnad prompt +%ALLUSERSPROFILE%\phabfive\phabfive.yaml +%ALLUSERSPROFILE%\phabfive\phabfive.d\*.yaml +%LOCALAPPDATA%\phabfive\phabfive.yaml +%LOCALAPPDATA%\phabfive\phabfive.d\*.yaml +``` + +Make sure there is a minimum phabfive.yaml store in one of the location +e.g. +```Commnad prompt +echo "PHAB_TOKEN: cli-ABC123" > %LOCALAPPDATA%\phabfive\phabfive.yaml +``` + +Additionally, due to connection to Phabricator server on HTTPS requires certificate verification, it is also recommended to install [pip_system_certs](https://pypi.org/project/pip-system-certs/) to ensure system store are linked to python. + +```Commnad prompt +pip install pip_system_certs +``` + +Usage: + +```bash +phabfive passphrase K123 +phabfive --log-level=DEBUG user whoami **Install the latest development version:** ```bash # Install from git to get unreleased features and fixes diff --git a/phabfive/maniphest.py b/phabfive/maniphest.py index c83adda..e923609 100644 --- a/phabfive/maniphest.py +++ b/phabfive/maniphest.py @@ -2144,7 +2144,13 @@ def create_from_config(self, config_file, dry_run=False): root_data = yaml_loader.load(stream) # Fetch all users in phabricator, used by subscribers mapping later - users_query = self.phab.user.search() + users_query = raw_data = self.phab.user.search() + + while (len(raw_data.data) >= 100 and not raw_data.cursor["after"] is None): + raw_data = self.phab.user.search(after=raw_data.cursor["after"]) + users_query.data.extend(raw_data.data) + log.debug(users_query) + username_to_id_mapping = { user["fields"]["username"]: user["phid"] for user in users_query["data"] } @@ -2152,7 +2158,13 @@ def create_from_config(self, config_file, dry_run=False): log.debug(username_to_id_mapping) # Fetch all projects in phabricator, used to map ticket -> projects later - projects_query = self.phab.project.search(constraints={"name": ""}) + projects_query = raw_data = self.phab.project.search(constraints={"name": ""}) + + while (len(raw_data.data) >= 100 and not raw_data.cursor["after"] is None): + raw_data = self.phab.project.search(constraints={"name": ""},after=raw_data.cursor["after"]) + projects_query.data.extend(raw_data.data) + log.debug(projects_query) + project_name_to_id_map = { project["fields"]["name"]: project["phid"] for project in projects_query["data"]