pwclient: allow per-directory settings

Open
#38 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Start by tracing the pwclient entry point and its handling of ~/.pwclientrc, then compare the two proposed configuration approaches: per-project dir matching or a per-directory .pwclientrc. The desired approach and matching rules need to be decided before implementation; done should include selecting a project automatically without requiring an explicit project argument.

Written by the indexing model from the issue text.

Description

enhancement

Currently, pwclient settings are stored in a single file (~/.pwclientrc), where multiple projects can be defined, but there is only one default.

[options]
default=linuxppc-dev

[linuxppc-dev]
url=https://patchwork.ozlabs.org/patchwork/xmlrpc/

[skiboot]
url=https://patchwork.ozlabs.org/patchwork/xmlrpc/

[snowpatch]
url=https://patchwork.ozlabs.ibm.com/patchwork/xmlrpc/ # Use our internal test patchwork

I use pwclient across a number of projects. pwclient should be able to figure out which project I'm looking at without me always having to explicitly specify it.

I'm thinking something along the lines of:

[options]
default=linuxppc-dev

[linuxppc-dev]
url=https://patchwork.ozlabs.org/patchwork/xmlrpc/
dir=/home/ajd/code/linux/

[skiboot]
url=https://patchwork.ozlabs.org/patchwork/xmlrpc/
dir=/home/ajd/code/skiboot*/ # Match a few different skiboot worktrees

[snowpatch]
url=https://patchwork.ozlabs.ibm.com/patchwork/xmlrpc/ # Use our internal test patchwork
dir=/home/ajd/code/snowpatch/

(the dir option is added)

Alternatively, a per-directory .pwclientrc, which could perhaps be distributed through the project's git repo.

[default]
project=snowpatch
url=https://patchwork.ozlabs.org/patchwork/xmlrpc/

(I haven't taken a good look at the pwclient source, so I haven't worked out how much work would be involved in doing this properly...)

Dominant language
Python
Stars
317
Forks
91
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getpatchwork/patchwork

All issues in getpatchwork/patchwork

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.