lfxยถ

                                                                                
 Usage: lftools-uv lfx [OPTIONS] COMMAND [ARGS]...                              
                                                                                
 LFX v2 API interface. Reads LFX_TOKEN, or the output of 'lfx auth token'.      
                                                                                
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --help        <bool>  Show this message and exit.                            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Commands โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ committee   LFX committees, named by UID or SSO group name.                  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

The lfx commands talk to the LFX v2 API, where Linux Foundation project groups live as committees. A migrated group kept its LDAP group name as the committeeโ€™s name. The service generates each SSO group name as <project slug>-<name>, so the two differ: the group example-gerrit-foo-committers of project example became a committee with that name and the SSO group name example-example-gerrit-foo-committers.

Configurationยถ

API base URLยถ

lftools-uv takes the first of:

  1. the LFX_API_URL environment variable;

  2. url in the [lfx] section of lftools.ini;

  3. https://lfx-api.v2.cluster.lfx.dev, the production environment.

[lfx]
url = https://lfx-api.v2.cluster.lfx.dev

The other environments are:

  • staging: https://lfx-api.staging.v2.cluster.linuxfound.info

  • development: https://lfx-api.dev.v2.cluster.linuxfound.info

A token works against the environment that issued it and no other. lftools-uv refuses a URL that does not start with https://, so the token never travels in clear. It also refuses a URL with a query (?) or fragment (#), which would swallow the endpoint path lftools-uv appends to it. The error names where the URL came from but not the URL itself, since any part of it may hold the token.

Tokenยถ

lftools-uv sends a bearer token, which it takes from the LFX_TOKEN environment variable. When that is unset and the LFX CLI is on PATH, it runs lfx auth token and uses what that prints. With neither, the command fails and names both.

To get a token, install the LFX CLI and log in once:

lfx auth login

Then either leave LFX_TOKEN unset, or export the token:

export LFX_TOKEN="$(lfx auth token)"

lftools-uv never accepts the token as a command-line option or from lftools.ini, and never prints or logs it, --debug included. Where the token turns up in what it would print, such as the committee argument or a field of the APIโ€™s answer, it prints <redacted> in its place, and does the same for the tokenโ€™s URL-encoded forms. A number, true, false or null in which the token turns up prints as that text with the token replaced, so --json shows it as a string.

The API does not reject a missing, invalid or expired token: it serves the request as anonymous, which sees public committees and nothing else. So lftools-uv refuses a token that is a JWT whose exp claim has passed before it sends anything, and checks again before each later request, so a token that expires during a lookup stops it. It reads the claim without checking the signature; the API checks that.

lftools-uv also refuses a token holding whitespace, a control character or a non-ASCII character, such as a pasted token with a line break in it, since it cannot travel in an HTTP header.

Naming a committeeยถ

Commands that take a committee accept its UID, its SSO group name or its name, in that order of precedence. lftools-uv tries each in turn and stops at the first that matches:

  1. a UUID, taken as the UID without a lookup;

  2. a committee whose SSO group name equals the argument in full;

  3. a committee whose name equals the argument in full.

An SSO group name wins over another committee whose name is the same string. When a step matches more than one committee, the command exits 1 and lists each candidateโ€™s UID, project and SSO group name rather than pick one: committee names repeat across projects, as every project may have a Technical Steering Committee. Name the committee by its UID, or add --project SLUG, which every command that takes a committee accepts. It limits steps 2 and 3 to that projectโ€™s committees; a slug no visible project has exits 3. committee show prints both name and sso_group_name, so you can see which one matched.

The query service returns the committees the token may see and hides the rest. It also trails the committee service by a moment, so a lookup by name may miss a committee created a moment ago.

Exit statusยถ

Status

Meaning

0

Success.

1

Any other failure: no token, an expired or malformed token, a non-HTTPS URL, a name that matches more than one committee or a slug that matches more than one project, a redirect, or an HTTP error. A 403 means the token may be missing, expired or without access, or the committee may not exist: the API answers 403 for a UID that does not exist.

2

Usage error, such as a missing argument, an unknown option, or a category or join mode the committee service does not accept.

3

No step of the committee lookup matched, no project has that slug, no member of the committee matches, or a read answered 404. A committee or project the token cannot see looks the same. committee gerrit-bridge differs: it keeps 3 for a project with no committee that has an SSO group, and exits 1 for any LFX failure, an unknown slug or a 404 included.

Results go to stdout and errors to stderr, so --json output pipes cleanly:

lftools-uv lfx committee show example-gerrit-foo-committers --json | jq '.total_members'

Commandsยถ

committee showยถ

                                                                                
 Usage: lftools-uv lfx committee show [OPTIONS] {committee}                     
                                                                                
 Show one committee.                                                            
                                                                                
โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    committee      <str>  Committee UID, SSO group name or name, tried in   โ”‚
โ”‚                            that order.                                       โ”‚
โ”‚                            [required]                                        โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --project        <str>   Project slug; look for the committee among that     โ”‚
โ”‚                          project's committees only.                          โ”‚
โ”‚ --json           <bool>  Print the API response body as JSON.                โ”‚
โ”‚ --help           <bool>  Show this message and exit.                         โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Prints one key: value line each for uid, name, category, project_uid, project_name, sso_group_enabled, sso_group_name, join_mode, public and total_members. --json prints the API response body instead.

committee listยถ

                                                                                
 Usage: lftools-uv lfx committee list [OPTIONS]                                 
                                                                                
 List a project's committees, sorted by name.                                   
                                                                                
 Prints one line per committee: the SSO group name (empty when it has none),    
 the UID and the name, separated by tabs.                                       
                                                                                
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *  --project         <str>   Project slug.                                   โ”‚
โ”‚                              [required]                                      โ”‚
โ”‚    --sso-only        <bool>  Keep the committees with an SSO group enabled.  โ”‚
โ”‚    --json            <bool>  Print a JSON array of the committees.           โ”‚
โ”‚    --help            <bool>  Show this message and exit.                     โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Finds the project whose slug matches --project in full and prints one line per committee the token can see, in name order, with three tab-separated fields: the SSO group name (empty when the committee has none), the UID and the name. The SSO option drops the committees whose sso_group_enabled is not true. --json prints a JSON array of the committeesโ€™ data objects instead.

A project with no committee the token can see prints nothing, says so on stderr and exits 0. A slug no visible project has exits 3.

lftools-uv lfx committee list --project example | cut -f1

committee membersยถ

                                                                                
 Usage: lftools-uv lfx committee members [OPTIONS] {committee}                  
                                                                                
 List a committee's members, sorted by username.                                
                                                                                
 text prints each username and email address; csv prints the SSO group name,    
 username, full name and email; info-yaml prints INFO.yaml committer entries,   
 leaving out members without a username.                                        
                                                                                
โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    committee      <str>  Committee UID, SSO group name or name, tried in   โ”‚
โ”‚                            that order.                                       โ”‚
โ”‚                            [required]                                        โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --project        <str>                 Project slug; look for the committee  โ”‚
โ”‚                                        among that project's committees only. โ”‚
โ”‚ --format         <text|csv|info-yaml>  Output format: text (the default),    โ”‚
โ”‚                                        csv or info-yaml.                     โ”‚
โ”‚ --json           <bool>                Print the API's member array as JSON. โ”‚
โ”‚ --help           <bool>                Show this message and exit.           โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Reads every member of the committee from the committee service itself rather than the query index, which keeps the list current. The output lists members in username order, ignoring case, then members that have no username, in email order. A member has no username, which is their LFID, when no LF account owns their email address yet.

The endpoint needs the auditor relation on the committee, which a committee writer has. Without it, or without a valid token, the API answers 403 and the command exits 1.

--format chooses the output:

text, the default

username <email>, one member per line. A member without a username prints as (no username) <email>.

csv

Four fields and no header: the committeeโ€™s SSO group name (its name, when it has none), the username, the full name and the email address. Quotes surround a field holding a comma, a double quote or a line break, a bare carriage return included.

info-yaml

One INFO.yaml committer entry per member:

- name: 'Jane Doe'
  email: 'jdoe@example.org'
  company: 'Example Corp'
  id: 'jdoe'
  timezone: 'Unknown/Unknown'

company is the memberโ€™s organisation. When that is empty, the command takes the email domain without its last label, giving example for jdoe@example.org. lftools-uv doubles an apostrophe in a value, keeping a name such as Oโ€™Brien valid YAML. A value holding a line break or another control character takes double quotes instead, with that character escaped, so it stays on one line. The output leaves out the lfservices_releng account and members without a username; stderr gives the count of members without a username, but not their addresses.

--json prints the APIโ€™s member array as it came; the command refuses --json together with --format.

committee inactiveยถ

                                                                                
 Usage: lftools-uv lfx committee inactive [OPTIONS] {gerrit_url} {committee}    
                                                                                
 Report when each committee member last owned or reviewed a Gerrit change.      
                                                                                
 Prints one line per member with a username: OK when their newest change is     
 within --months, WARNING with its date when it is older, and ERROR when they   
 have no change or no Gerrit account.                                           
                                                                                
โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    gerrit_url      <str>  Gerrit host and path, such as                    โ”‚
โ”‚                             gerrit.example.org/r; https:// is optional.      โ”‚
โ”‚                             [required]                                       โ”‚
โ”‚ *    committee       <str>  Committee UID, SSO group name or name, tried in  โ”‚
โ”‚                             that order.                                      โ”‚
โ”‚                             [required]                                       โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --project        <str>               Project slug; look for the committee    โ”‚
โ”‚                                      among that project's committees only.   โ”‚
โ”‚ --months         <int range> [x>=1]  How many months back a change counts as โ”‚
โ”‚                                      recent activity.                        โ”‚
โ”‚                                      [default: 12]                           โ”‚
โ”‚ --json           <bool>              Print a JSON array of the report        โ”‚
โ”‚                                      entries.                                โ”‚
โ”‚ --help           <bool>              Show this message and exit.             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Reports when each member of the committee last owned or reviewed a change in Gerrit, so that a project can review its inactive committers. It replaces ldap inactivecommitters and the inactivecommitters script. That script, still installed, now runs this command with its two arguments and the default --months.

GERRIT_URL is the Gerrit host and path, such as gerrit.example.org/r, with or without https://. lftools-uv refuses any other scheme, since it sends the credentials ~/.netrc holds for the host, if any. It also refuses a URL carrying a user name or password, which the report would print: put those in ~/.netrc. It follows no redirect, since requests would send the ~/.netrc credentials to the new URL, in clear when that is http://; a Gerrit answer that redirects is a failed query. Give the URL Gerrit serves its REST API at. Gerrit answers change queries without credentials too.

It reads the members as committee members does, so the token needs the same auditor relation. Members without a username have no LFID to ask Gerrit about: the command skips them and gives their count on stderr. For each other member, in username order, it asks Gerrit for the newest change they own or reviewed with an update in the last --months months, 12 by default, then, when there is none, for the newest change at any time. It prints one line per member:

OK jdoe, Jane Doe, jdoe@example.org last submission or review 2026-10-30
WARNING bob, Bob Smith, bob@example.com inactive since 2025-02-11 655 days ago
ERROR amy, Amy Newcomer, amy@example.net has no activity
ERROR zed, Zed Nobody, zed@example.org has no Gerrit account

A line break in a memberโ€™s username, name or email prints as an escape, such as \n or \r, so each member stays on one line.

has no Gerrit account means Gerrit answered HTTP 400 Account 'USERNAME' not found. The old script printed the accountโ€™s registration date here, which it read with gerrit gsql; Gerrit 3.0 removed that command.

--json prints a JSON array instead, with one object per member holding username, name, email, status (ok, inactive, no_activity or no_account), last_activity and days_ago; the last two are null without a change.

A committee that is not found exits 3. Any Gerrit failure other than an unknown account exits 1, after the lines printed so far, so a Gerrit that does not answer never makes a member look inactive. The command needs neither the ldap extra, an LDAP server nor SSH access to Gerrit.

lftools-uv lfx committee inactive gerrit.example.org/r example-gerrit-foo-committers

committee gerrit-bridgeยถ

                                                                                
 Usage: lftools-uv lfx committee gerrit-bridge [OPTIONS] {gerrit_fqdn}          
                                                                                
 Include each committee's saml/SSO_GROUP_NAME group in its saml/NAME group.     
                                                                                
 Gerrit then grants the same rights whichever of the two names the identity     
 provider sends. Prints one line per change: create, include, ok or missing,    
 then each saml/ group no committee names. Writes nothing without --apply, and  
 never removes anything.                                                        
                                                                                
โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    gerrit_fqdn      <str>  Gerrit site, as its section in lftools.ini      โ”‚
โ”‚                              names it.                                       โ”‚
โ”‚                              [required]                                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *  --project        <str>   Project slug.                                    โ”‚
โ”‚                             [required]                                       โ”‚
โ”‚    --apply          <bool>  Make the changes; without it, only print them.   โ”‚
โ”‚    --json           <bool>  Print a JSON array of the plan or the result.    โ”‚
โ”‚    --help           <bool>  Show this message and exit.                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Lets a Gerrit site grant the same rights whichever group name the identity provider sends for a committee: the committeeโ€™s name or its SSO group name. A committee migrated from LDAP kept the LDAP group name as its name, and the siteโ€™s access rules grant rights to saml/<name>. Its SSO group name, <project slug>-<name>, is new.

Gerritโ€™s SAML module treats groups this way at each web login:

  • it maps each value of the group attribute to the internal group saml/<value>, creating that group when it does not exist;

  • it makes the user a direct member of those groups, and removes their direct membership of every other saml/ group;

  • it finds those groups by name, while access rules name groups by UUID and count the members of included groups.

So the command makes sure, for each committee, that saml/<sso_group_name> exists and that saml/<name> includes it. While the identity provider sends the old names, users stay direct members of saml/<name> and the included group stays empty. Once it sends the SSO group names, users become direct members of saml/<sso_group_name>, every rule granting to saml/<name> still reaches them through the include, and each login drops their stale direct membership of saml/<name>. Neither switch, nor a switch back, needs any change in Gerrit: the command renames nothing and changes no access rule.

GERRIT_FQDN names the lftools.ini section that holds the siteโ€™s username, password and endpoint, as the gerrit commands use them. The command reads the projectโ€™s committees as committee list --project does and keeps those with an SSO group, then lists the siteโ€™s groups in one request. For each committee, with old as saml/<name> and new as saml/<sso_group_name>, it prints one line per change:

create saml/<new>

new does not exist. The command creates it as an internal group, not visible to all, owned by Administrators, with a description naming the committeeโ€™s UID and old.

include saml/<new> in saml/<old>

old does not include new yet.

ok saml/<new> in saml/<old>

old already includes new. A committee whose two names agree prints ok saml/<name> alone, since it needs nothing.

missing saml/<old> (committee <UID>)

old is not on the site, so the command does nothing for that committee.

After those it prints unnamed saml/<group> for each saml/ group on the site that no committee names. The identity provider stops sending those once it switches, so their users lose what the groups grant at their next login.

When new already exists with direct members, includes other groups, whose members old would then grant its rights to, or another group already includes it, a warning on stderr says so, the dry run included, and the command still adds the include.

Without --apply the command is a dry run: it prints the plan and writes nothing. With --apply it makes each change as it prints its line, so a second run makes no change and prints ok lines in place of create and include. It adds and nothing else: it never removes a group, a member or an include. --json prints the plan or the result as a JSON array instead, one object per line, holding action, group, include_in, committee_uid, committee_name, applied and notes.

It exits 0 when complete and 3 when the project has no committee with an SSO group. Any LFX or Gerrit failure exits 1, a project slug that matches no project or an LFX read that answers 404 included; a Gerrit failure part way through comes after the lines for the changes already made, a group created before a failed include among them, which stay made. Neither the Gerrit password nor the LFX token appears in the output, the --json output, an LFX error and the log included, the request log --debug enables too. Where the password turns up, as written or URL-encoded, such as in a group name, in the request path a refused redirectโ€™s error quotes or in a project slug an error quotes, backslashes included, the command prints <redacted> in its place. It does not log Gerritโ€™s error responses, which may echo the credentials sent. An lftools.ini that Pythonโ€™s configparser cannot read stops every lftools-uv command with an error naming the file and the line numbers at fault, never the lines themselves, which may hold a password.

Run it on every Gerrit site of the project before the identity provider changes the group attribute, a dry run first, and again after adding committees. It works on any Gerrit site that uses the SAML group sync, whether it runs on a VM or on Kubernetes.

lftools-uv lfx committee gerrit-bridge --project example gerrit.example.org
lftools-uv lfx committee gerrit-bridge --project example gerrit.example.org --apply

committee createยถ

                                                                                
 Usage: lftools-uv lfx committee create [OPTIONS]                               
                                                                                
 Create a committee under a project.                                            
                                                                                
 Prints the SSO group name the service gave the committee, empty when it gave   
 none, and the committee UID, separated by a tab.                               
                                                                                
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *  --project                          <str>   Slug of the project the        โ”‚
โ”‚                                               committee belongs to.          โ”‚
โ”‚                                               [required]                     โ”‚
โ”‚ *  --name                             <str>   Committee name; the SSO group  โ”‚
โ”‚                                               name is built from it.         โ”‚
โ”‚                                               [required]                     โ”‚
โ”‚    --category                         <str>   Committee category.            โ”‚
โ”‚                                               [default: Committers]          โ”‚
โ”‚    --description                      <str>   Committee description.         โ”‚
โ”‚    --join-mode                        <str>   Who may join: open,            โ”‚
โ”‚                                               invite_only, application,      โ”‚
โ”‚                                               closed. 'closed' lets only a   โ”‚
โ”‚                                               committee writer add members.  โ”‚
โ”‚                                               [default: closed]              โ”‚
โ”‚    --sso-group      --no-sso-group    <bool>  Give the committee an SSO      โ”‚
โ”‚                                               group.                         โ”‚
โ”‚                                               [default: sso-group]           โ”‚
โ”‚    --public         --private         <bool>  Make the committee public.     โ”‚
โ”‚                                               [default: private]             โ”‚
โ”‚    --json                             <bool>  Print the API response body as โ”‚
โ”‚                                               JSON.                          โ”‚
โ”‚    --help                             <bool>  Show this message and exit.    โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Creates a committee under the project whose slug --project names, and replaces lfidapi create-group. The token must be a writer on the project; a 403 says the token may be missing or expired, or may not be a writer there.

lftools-uv finds the projectโ€™s UID through the query service first. When no visible project has the slug it exits 3 and sends nothing else. It then sends POST /committees with the committeeโ€™s name, category, project_uid, join_mode, public and sso_group_enabled, and its description when given. The defaults are:

  • --category Committers;

  • --join-mode closed, so a committee writer adds every member, which suits a group whose membership an INFO.yaml file decides;

  • --sso-group, so the committee gets an SSO group;

  • --private.

--category takes one of Ambassador, Board, Code of Conduct, Committers, Expert Group, Finance Committee, Government Advisory Council, Legal Committee, Maintainers, Marketing Committee/Sub Committee, Marketing Mailing List, Marketing Oversight Committee/Marketing Advisory Committee, Newsletter, Other, Product Security, Special Interest Group, Technical Advisory Committee, Technical Mailing List, Technical Oversight Committee, Technical Steering Committee and Working Group. --join-mode takes open, invite_only, application or closed. lftools-uv refuses any other value as a usage error before it sends a request.

On success it prints one line with two tab-separated fields: the SSO group name the service gave the committee, empty when it gave none, and the committeeโ€™s UID. --json prints the response body instead. When the project already has a committee of that name the service answers 409, and the command exits 1 with the serviceโ€™s message, as it does for any other error.

The SSO group nameยถ

The caller cannot choose the SSO group name. With an SSO group, or with --public, the service builds it from the projectโ€™s slug, a hyphen and the committeeโ€™s name: project example and name gerrit-foo-committers give example-gerrit-foo-committers. When another committee already holds that name it appends -2, then -3, and so on. So use the name this command prints, never one you worked out yourself: pass that name to gerrit create-saml-group and gerrit createproject.

Keep the commandโ€™s output and check its exit status before you take the first field. A pipeline such as create ... | cut -f1 reports the status of cut, so a failed create would leave an empty name and the script would go on:

created="$(lftools-uv lfx committee create --project example \
    --name gerrit-foo-committers)" || exit
group="$(printf '%s\n' "$created" | cut -f1)"
[ -n "$group" ] || { echo "no SSO group name" >&2; exit 1; }

The query service trails the committee service by a moment, so committee show may not find the new committee by its SSO group name straight away. Its UID skips the query service, but the service also grants access to a new committee asynchronously, so a read by UID straight after the create may still answer 403 and exit 1. A script that reads the new committee should use its UID and retry a bounded number of times before it gives up:

uid="$(printf '%s\n' "$created" | cut -f2)"
for try in 1 2 3 4 5; do
    lftools-uv lfx committee show "$uid" && break
    [ "$try" -lt 5 ] || exit 1
    sleep 2
done

A script that creates a missing group should first test for it with committee show, passing the same name and --project the creating step would. Exit 3 means no lookup step matched, so the group is missing; any other failure, such as 1 for a name more than one committee holds, must stop the script rather than lead to a create, which would add a second committee with a -2 SSO group name:

lftools-uv lfx committee show --project example gerrit-foo-committers >/dev/null
status=$?
if [ "$status" -eq 3 ]; then
    lftools-uv lfx committee create --project example --name gerrit-foo-committers
elif [ "$status" -ne 0 ]; then
    exit "$status"
fi

From lfidapi create-groupยถ

lfidapi create-group GROUP took the full group name. Split it into the projectโ€™s slug and the rest:

# Before
lftools-uv lfidapi create-group example-gerrit-foo-committers

# After
lftools-uv lfx committee create --project example --name gerrit-foo-committers

Committee membershipยถ

Membership is by email address. lfidapi user named an LFID alone; add-member needs the personโ€™s email address, and the committee service finds the LF account that owns it. --username checks that the address belongs to the LFID you meant.

The service emails a member it adds or removes. LDAP group changes sent no email, so these commands send X-Skip-Notification: true to stop it; --notify lets the email go.

No diagnostic on stderr carries an email address, not even one quoted in the serviceโ€™s message or given as a username or as the committeeโ€™s SSO group name, with an apostrophe in its local part such as o'connor@example.org or '@example.org, a quoted local part such as "j doe"@example.org or an address literal such as jdoe@[192.0.2.1]; results on stdout may carry the ones you supplied.

committee add-memberยถ

                                                                                
 Usage: lftools-uv lfx committee add-member [OPTIONS] {committee}               
                                                                                
 Add a member to a committee by email address.                                  
                                                                                
 Prints added, the username the service resolved from the address and the       
 member UID, separated by tabs.                                                 
                                                                                
โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    committee      <str>  Committee UID, SSO group name or name, tried in   โ”‚
โ”‚                            that order.                                       โ”‚
โ”‚                            [required]                                        โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚    --project             <str>   Project slug; look for the committee among  โ”‚
โ”‚                                  that project's committees only.             โ”‚
โ”‚ *  --email               <str>   Email address of the person to add; the     โ”‚
โ”‚                                  service finds their LF account by it.       โ”‚
โ”‚                                  [required]                                  โ”‚
โ”‚    --first-name          <str>   First name; the service takes it from the   โ”‚
โ”‚                                  LF account when omitted.                    โ”‚
โ”‚    --last-name           <str>   Last name; the service takes it from the LF โ”‚
โ”‚                                  account when omitted.                       โ”‚
โ”‚    --organization        <str>   Name of the member's organisation.          โ”‚
โ”‚    --username            <str>   LFID the address must belong to; a member   โ”‚
โ”‚                                  added under another is removed again.       โ”‚
โ”‚    --notify              <bool>  Let the service email the member.           โ”‚
โ”‚    --json                <bool>  Print the member object as JSON.            โ”‚
โ”‚    --help                <bool>  Show this message and exit.                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Sends POST /committees/{uid}/members with email and any of first_name, last_name and organization.name given. The token must be a writer on the committee.

  • The service sets the memberโ€™s username itself, from the LF account that owns the address, and stores none when no account owns it. It fills an empty first or last name from that account, then requires both.

  • A committee with voting or business email enabled also requires an organisation with an ID, or a name and a website, which this command cannot send.

On success it prints one line with three tab-separated fields: added, the username the service resolved, and the member UID. A member with no username prints (no username), and stderr warns that no LF account owns the address yet. --json prints the member object instead.

With --username LFID the command compares, ignoring case, the username the service resolved with LFID. When they differ, or the address resolved to no username, it removes the member it added a moment before and exits 1, saying which username the address resolved to. The command thus either makes that LFID a member or changes nothing. It leaves the member in place when the member no longer has the address given, as remove-member --email would. When the removal fails too, the error says so and gives the member UID, for you to remove by hand. An empty LFID is a usage error, exit 2, and sends nothing, since it would match a member with no username.

When the address is already a member the service answers 409. The command then finds that member in the member list by its address, ignoring case and surrounding whitespace as the service does, and reports its username and member UID on stderr. It exits 0, or 1 when --username names another account. It never removes a member that was there before it ran.

Any other error, such as a 400 for a missing name, exits 1 with the serviceโ€™s message.

committee remove-memberยถ

                                                                                
 Usage: lftools-uv lfx committee remove-member [OPTIONS] {committee}            
                                                                                
 Remove a member from a committee.                                              
                                                                                
 Name the member with exactly one of --username, --email and --member-uid.      
 Prints removed and the member UID, separated by a tab.                         
                                                                                
โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    committee      <str>  Committee UID, SSO group name or name, tried in   โ”‚
โ”‚                            that order.                                       โ”‚
โ”‚                            [required]                                        โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --project           <str>   Project slug; look for the committee among that  โ”‚
โ”‚                             project's committees only.                       โ”‚
โ”‚ --username          <str>   Username (LFID) of the member to remove.         โ”‚
โ”‚ --email             <str>   Email address of the member to remove.           โ”‚
โ”‚ --member-uid        <str>   UID of the member to remove.                     โ”‚
โ”‚ --notify            <bool>  Let the service email the member.                โ”‚
โ”‚ --help              <bool>  Show this message and exit.                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Name the member with one of --username, --email and --member-uid; giving none, or more than one, is a usage error. The command matches a username or an email address, ignoring case, against the member list, which needs the auditor relation that a committee writer has. An email address also matches without surrounding whitespace. No match exits 3; more than one exits 1 and lists their member UIDs, so you can name one with --member-uid. A --member-uid holding an email address is a usage error that sends nothing: the request path would carry the address percent-encoded, past the scrubbing that hides addresses in diagnostics.

The command reads the member for its ETag and sends DELETE /committees/{uid}/members/{member_uid} with that value in If-Match. When the member changed after that read, the service answers 409, and the command reads the member again and retries once. The service lets a memberโ€™s address change in place, so with --username or --email each read must show the member still has that username or address; otherwise the command exits 1 and removes nothing. The token must be a writer on the committee. On success it prints removed and the member UID, separated by a tab.

committee inviteยถ

                                                                                
 Usage: lftools-uv lfx committee invite [OPTIONS] {committee} {email}           
                                                                                
 Invite an email address to join a committee.                                   
                                                                                
 Prints the invite UID and its status, separated by a tab.                      
                                                                                
โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    committee      <str>  Committee UID, SSO group name or name, tried in   โ”‚
โ”‚                            that order.                                       โ”‚
โ”‚                            [required]                                        โ”‚
โ”‚ *    email          <str>  Email address to invite.                          โ”‚
โ”‚                            [required]                                        โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --project        <str>   Project slug; look for the committee among that     โ”‚
โ”‚                          project's committees only.                          โ”‚
โ”‚ --json           <bool>  Print the invite object as JSON.                    โ”‚
โ”‚ --help           <bool>  Show this message and exit.                         โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Sends POST /committees/{uid}/invites for the email address. The token needs the inviter relation on the committee. On success it prints the invite UID and its status, pending, separated by a tab; --json prints the invite object instead. When a pending invite exists for the address, or its holder is a member already, the service answers 409 and the command exits 1 with the serviceโ€™s message.

committee sync-infoยถ

                                                                                
 Usage: lftools-uv lfx committee sync-info [OPTIONS] {info_file} {committee}    
                                                                                
 Make a committee's members match the committers of an INFO.yaml file.          
                                                                                
 Adds each committer no member matches, by email address, and removes each      
 member no committer matches, except protected LFIDs. Prints one line per       
 action: added, removed, pending or failed, with the LFID, or the member UID of 
 a member without one. --noop prints add, pending, conflict and remove instead. 
                                                                                
โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    info_file      <path>  INFO.yaml file whose committers the committee    โ”‚
โ”‚                             must hold.                                       โ”‚
โ”‚                             [required]                                       โ”‚
โ”‚ *    committee      <str>   Committee UID, SSO group name or name, tried in  โ”‚
โ”‚                             that order.                                      โ”‚
โ”‚                             [required]                                       โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --project        <str>        Project slug; look for the committee among     โ”‚
โ”‚                               that project's committees only.                โ”‚
โ”‚ --noop           <bool>       Print the plan and change nothing.             โ”‚
โ”‚ --protect        <list[str]>  LFID never to remove, besides                  โ”‚
โ”‚                               lfservices_releng. Repeatable.                 โ”‚
โ”‚ --notify         <bool>       Let the service email each member added or     โ”‚
โ”‚                               removed.                                       โ”‚
โ”‚ --json           <bool>       Print the actions as a JSON array.             โ”‚
โ”‚ --help           <bool>       Show this message and exit.                    โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Makes the committeeโ€™s members match the committers of an INFO.yaml file. The INFO.yaml automation runs it each time a change to a projectโ€™s INFO.yaml merges, naming the committee by its old LDAP group name, so it decides who holds commit rights. The token must be a writer on the committee.

Each committer entry needs an id, the LFID, and an email; the command also reads name and company. An entry without an id or an email exits 1, naming the entry by its position, before the command sends anything. An entry repeating an earlier id with the same address, as a generated INFO.yaml repeats the project lead, counts once; with another address it exits 1 the same way, as does a file that is missing, unreadable or a directory. These errors call the file INFO.yaml and quote neither its path nor its content. LFIDs and email addresses compare ignoring case.

For each committer, the command takes the first outcome that applies:

Outcome

When

keep

A memberโ€™s username is the committerโ€™s id.

pending

The member with the committerโ€™s address has no username: no LF account owns that address yet.

conflict

The member with the committerโ€™s address has another username: the address belongs to a different LFID.

add

No member has the committerโ€™s id or address.

It then removes every member no committer kept or left pending, except a protected username. The command always protects lfservices_releng, and each --protect LFID adds another. It also removes the member a conflict names, unless another committer keeps it.

--noop prints the plan and changes nothing: one line per action, add <id>, pending <id>, conflict <id> or remove <username>, and exits 0. A member without a username appears as its member UID.

Without --noop the command adds, then removes:

  • It adds each committer with their email, the first word of name, split on any whitespace, as first_name and the rest as last_name, and company, when not empty, as organization.name.

  • It checks the username the service resolved from each address it adds. When that is not the committerโ€™s id, or is empty, it removes the member again and reports a failure, saying which LFID the address belongs to or that no LF account owns it. Correct the address in INFO.yaml, or add it to the committerโ€™s LF account. Each read before the removal must show the member still has the address and the username the service answered, or still none, so a member that has since gained the committerโ€™s LFID stays.

  • When the service accepts an addition but answers with something other than a member, such as an object without a member UID, or when an addition gets no answer, a timeout included, or a 5xx, so the member may exist, it reads the members again and checks the one member that holds the address and that it has not seen before, in its first read, in an answer or in an earlier read-back. It never sends the addition again. When it finds no such member, or more than one, or an earlier addition in the same run sent the same address, it reports a failure and removes nothing. Nothing ties the member it finds to the addition: another writer may have added the address since the plan, or replaced the new member, so it reports a member it finds under another LFID, or without one, with its member UID, and leaves it in place rather than removing it. The next run reports it again, as a conflict, which removes it unless a committer keeps it, or as pending when it has no username.

  • A conflict reports a failure and adds nothing.

  • A 409 on an addition means a member took the address after the command made its plan; it reports a failure and removes nothing for it.

  • It removes each member as remove-member does, and leaves alone a member that has since lost the username the plan chose it by. It also leaves alone a member the plan chose without a username once that member has one, or another address. It sends no request for a member whose UID holds an email address, and reports a failure.

  • A failed addition or removal does not stop the others.

  • It sends X-Skip-Notification: true; --notify lets the email go.

  • When every action succeeded, it reads the members again. Another writer may have removed a committer or added a member meanwhile; it reports each such difference as a failure and changes nothing more.

It prints one line per action: added <id>, removed <username>, pending <id> or failed <id>: <reason>. --json prints a JSON array of objects with action, name and, for a failure, reason. Neither stream carries an email address. The command exits 0 when every action succeeded and no committer remains pending or in conflict; otherwise it exits 1 after attempting every action. A committee lookup that matches nothing exits 3. A committee whose UID holds an email address exits 1 before any member request. After a run that exits 0, the members are the INFO.yaml committers and any protected LFIDs, and no one else.

From lfidapi match-ldap-to-infoยถ
# Before
lftools-uv lfidapi match-ldap-to-info INFO.yaml example-gerrit-foo-committers --noop

# After
lftools-uv lfx committee sync-info INFO.yaml example-gerrit-foo-committers --noop

lfidapi match-ldap-to-info added by LFID; sync-info adds by email address and checks the LFID, so a committer whose INFO.yaml address is not on their LF account fails, and the command adds no member for them. lfidapi match-ldap-to-info --githuborg, which syncs a GitHub team, does not move: sync-info does not replace it.

Replacing the LDAP and LFID API commandsยถ

Old

New

lfidapi search-members GROUP

lfx committee members GROUP

ldap csv GROUP

lfx committee members GROUP --format csv

ldap yaml4info GROUP

lfx committee members GROUP --format info-yaml

ldap inactivecommitters GERRIT_URL GROUP

lfx committee inactive GERRIT_URL GROUP

lfidapi user LFID GROUP

lfx committee add-member GROUP --email EMAIL --username LFID

lfidapi user LFID GROUP --delete

lfx committee remove-member GROUP --username LFID

lfidapi invite EMAIL GROUP

lfx committee invite GROUP EMAIL

lfidapi match-ldap-to-info INFO_FILE GROUP [--noop]

lfx committee sync-info INFO_FILE GROUP [--noop]

The member listings match the old commands for one group, with two fixes: CSV quotes a field holding a comma or a line break, and INFO.yaml doubles an apostrophe in a value and escapes a line break or other control character. committee inactive describes how its report differs. ldap csv took more than one group, and LDAP wildcards, in one call. The lfx committee commands take one committee: run them once per committee.

yaml4info and infofile create-info-fileยถ

The yaml4info script, and the legacy ldap yaml4info command that runs it, print what lfx committee members GROUP --format info-yaml prints, for the committee GROUP names, looked up as Naming a committee describes. infofile create-info-file lists the same entries as the committers of the INFO file it creates. All three read committees rather than LDAP, so they need a token with the auditor relation on the committee, and take one group per call: LDAP wildcards such as yaml4info 'project-gerrit-*' no longer list every matching group.