lfxยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx [OPTIONS] COMMAND [ARGS]...[0m[1m [0m[1m [0m
[1m [0m
LFX v2 API interface. Reads LFX_TOKEN, or the output of 'lfx auth token'.
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
[2mโญโ[0m[2m Commands [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [1;36mcommittee [0m[1;36m [0m LFX committees, named by UID or SSO group name. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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:
the
LFX_API_URLenvironment variable;urlin the[lfx]section oflftools.ini;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.infodevelopment:
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:
a UUID, taken as the UID without a lookup;
a committee whose SSO group name equals the argument in full;
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 |
|---|---|
|
Success. |
|
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. |
|
Usage error, such as a missing argument, an unknown option, or a category or join mode the committee service does not accept. |
|
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.
|
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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee show [OPTIONS] {committee}[0m[1m [0m[1m [0m
[1m [0m
Show one committee.
[2mโญโ[0m[2m Arguments [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m committee [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Committee UID, SSO group name or name, tried in [2mโ[0m
[2mโ[0m that order. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Project slug; look for the committee among that [2mโ[0m
[2mโ[0m project's committees only. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-json[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Print the API response body as JSON. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee list [OPTIONS][0m[1m [0m[1m [0m
[1m [0m
List a project's committees, sorted by name.
[2mPrints one line per committee: the SSO group name (empty when it has[0m[2m [0m[2mnone), [0m
[2mthe UID and the name, separated by tabs.[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Project slug. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-sso[0m[1;36m-only[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Keep the committees with an SSO group enabled. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-json[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Print a JSON array of the committees. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee members [OPTIONS] {committee}[0m[1m [0m[1m [0m
[1m [0m
List a committee's members, sorted by username.
[2mtext prints each username and email address; csv prints the SSO[0m[2m [0m[2mgroup name, [0m
[2musername, full name and email; info-yaml prints INFO.yaml[0m[2m [0m[2mcommitter entries, [0m
[2mleaving out members without a username.[0m
[2mโญโ[0m[2m Arguments [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m committee [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Committee UID, SSO group name or name, tried in [2mโ[0m
[2mโ[0m that order. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Project slug; look for the committee [2mโ[0m
[2mโ[0m among that project's committees only. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-format[0m [1;2;33m<[0m[1;33mtext[0m[1;2;33m|[0m[1;33mcsv[0m[1;2;33m|[0m[1;33minfo-yaml[0m[1;2;33m>[0m Output format: text (the default), [2mโ[0m
[2mโ[0m csv or info-yaml. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-json[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m[1;33m [0m Print the API's member array as JSON. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m[1;33m [0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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 defaultusername <email>, one member per line. A member without a username prints as(no username) <email>.csvFour 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-yamlOne INFO.yaml committer entry per member:
- name: 'Jane Doe' email: 'jdoe@example.org' company: 'Example Corp' id: 'jdoe' timezone: 'Unknown/Unknown'
companyis the memberโs organisation. When that is empty, the command takes the email domain without its last label, givingexampleforjdoe@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 thelfservices_relengaccount 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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee inactive [OPTIONS] {gerrit_url} {committee}[0m[1m [0m[1m [0m
[1m [0m
Report when each committee member last owned or reviewed a Gerrit change.
[2mPrints one line per member with a username: OK when their newest[0m[2m [0m[2mchange is [0m
[2mwithin --months, WARNING with its date when it is older,[0m[2m [0m[2mand ERROR when they [0m
[2mhave no change or no Gerrit account.[0m
[2mโญโ[0m[2m Arguments [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m gerrit_url [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Gerrit host and path, such as [2mโ[0m
[2mโ[0m gerrit.example.org/r; https:// is optional. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโ[0m [31m*[0m committee [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Committee UID, SSO group name or name, tried in [2mโ[0m
[2mโ[0m that order. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Project slug; look for the committee [2mโ[0m
[2mโ[0m among that project's committees only. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-months[0m [1;2;33m<[0m[1;33mint range> [x>=1[0m[1;2;33m][0m How many months back a change counts as [2mโ[0m
[2mโ[0m recent activity. [2mโ[0m
[2mโ[0m [2m[default: 12] [0m [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-json[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m[1;33m [0m Print a JSON array of the report [2mโ[0m
[2mโ[0m entries. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m[1;33m [0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee gerrit-bridge [OPTIONS] {gerrit_fqdn}[0m[1m [0m[1m [0m
[1m [0m
Include each committee's saml/SSO_GROUP_NAME group in its saml/NAME group.
[2mGerrit then grants the same rights whichever of the two names the[0m[2m [0m[2midentity [0m
[2mprovider sends. Prints one line per change: create,[0m[2m [0m[2minclude, ok or missing, [0m
[2mthen each saml/ group no committee names.[0m[2m [0m[2mWrites nothing without --apply, and [0m
[2mnever removes anything.[0m
[2mโญโ[0m[2m Arguments [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m gerrit_fqdn [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Gerrit site, as its section in lftools.ini [2mโ[0m
[2mโ[0m names it. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Project slug. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-apply[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Make the changes; without it, only print them. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-json[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Print a JSON array of the plan or the result. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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>newdoes not exist. The command creates it as an internal group, not visible to all, owned byAdministrators, with a description naming the committeeโs UID andold.include saml/<new> in saml/<old>olddoes not includenewyet.ok saml/<new> in saml/<old>oldalready includesnew. A committee whose two names agree printsok saml/<name>alone, since it needs nothing.missing saml/<old> (committee <UID>)oldis 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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee create [OPTIONS][0m[1m [0m[1m [0m
[1m [0m
Create a committee under a project.
[2mPrints the SSO group name the service gave the committee, empty when[0m[2m [0m[2mit gave [0m
[2mnone, and the committee UID, separated by a tab.[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Slug of the project the [2mโ[0m
[2mโ[0m committee belongs to. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโ[0m [31m*[0m [1;36m-[0m[1;36m-name[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Committee name; the SSO group [2mโ[0m
[2mโ[0m name is built from it. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-category[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Committee category. [2mโ[0m
[2mโ[0m [2m[default: Committers] [0m [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-description[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Committee description. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-join[0m[1;36m-mode[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Who may join: open, [2mโ[0m
[2mโ[0m invite_only, application, [2mโ[0m
[2mโ[0m closed. 'closed' lets only a [2mโ[0m
[2mโ[0m committee writer add members. [2mโ[0m
[2mโ[0m [2m[default: closed] [0m [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-sso[0m[1;36m-group[0m [1;35m-[0m[1;35m-no[0m[1;35m-sso-group[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Give the committee an SSO [2mโ[0m
[2mโ[0m group. [2mโ[0m
[2mโ[0m [2m[default: sso-group] [0m [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-public[0m [1;35m-[0m[1;35m-private[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Make the committee public. [2mโ[0m
[2mโ[0m [2m[default: private] [0m [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-json[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Print the API response body as [2mโ[0m
[2mโ[0m JSON. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee add-member [OPTIONS] {committee}[0m[1m [0m[1m [0m
[1m [0m
Add a member to a committee by email address.
[2mPrints added, the username the service resolved from the address and[0m[2m [0m[2mthe [0m
[2mmember UID, separated by tabs.[0m
[2mโญโ[0m[2m Arguments [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m committee [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Committee UID, SSO group name or name, tried in [2mโ[0m
[2mโ[0m that order. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Project slug; look for the committee among [2mโ[0m
[2mโ[0m that project's committees only. [2mโ[0m
[2mโ[0m [31m*[0m [1;36m-[0m[1;36m-email[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Email address of the person to add; the [2mโ[0m
[2mโ[0m service finds their LF account by it. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-first[0m[1;36m-name[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m First name; the service takes it from the [2mโ[0m
[2mโ[0m LF account when omitted. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-last[0m[1;36m-name[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Last name; the service takes it from the LF [2mโ[0m
[2mโ[0m account when omitted. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-organization[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Name of the member's organisation. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-username[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m LFID the address must belong to; a member [2mโ[0m
[2mโ[0m added under another is removed again. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-notify[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Let the service email the member. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-json[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Print the member object as JSON. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee remove-member [OPTIONS] {committee}[0m[1m [0m[1m [0m
[1m [0m
Remove a member from a committee.
[2mName the member with exactly one of --username, --email and[0m[2m [0m[2m--member-uid. [0m
[2mPrints removed and the member UID, separated by a tab.[0m
[2mโญโ[0m[2m Arguments [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m committee [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Committee UID, SSO group name or name, tried in [2mโ[0m
[2mโ[0m that order. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Project slug; look for the committee among that [2mโ[0m
[2mโ[0m project's committees only. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-username[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Username (LFID) of the member to remove. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-email[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Email address of the member to remove. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-member[0m[1;36m-uid[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m UID of the member to remove. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-notify[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Let the service email the member. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee invite [OPTIONS] {committee} {email}[0m[1m [0m[1m [0m
[1m [0m
Invite an email address to join a committee.
[2mPrints the invite UID and its status, separated by a tab.[0m
[2mโญโ[0m[2m Arguments [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m committee [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Committee UID, SSO group name or name, tried in [2mโ[0m
[2mโ[0m that order. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโ[0m [31m*[0m email [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Email address to invite. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Project slug; look for the committee among that [2mโ[0m
[2mโ[0m project's committees only. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-json[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Print the invite object as JSON. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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ยถ
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv lfx committee sync-info [OPTIONS] {info_file} {committee}[0m[1m [0m[1m [0m
[1m [0m
Make a committee's members match the committers of an INFO.yaml file.
[2mAdds each committer no member matches, by email address, and removes[0m[2m [0m[2meach [0m
[2mmember no committer matches, except protected LFIDs. Prints one[0m[2m [0m[2mline per [0m
[2maction: added, removed, pending or failed, with the LFID, or[0m[2m [0m[2mthe member UID of[0m
[2ma member without one. --noop prints add, pending,[0m[2m [0m[2mconflict and remove instead.[0m
[2mโญโ[0m[2m Arguments [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [31m*[0m info_file [1;2;33m<[0m[1;33mpath[0m[1;2;33m>[0m INFO.yaml file whose committers the committee [2mโ[0m
[2mโ[0m must hold. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโ[0m [31m*[0m committee [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Committee UID, SSO group name or name, tried in [2mโ[0m
[2mโ[0m that order. [2mโ[0m
[2mโ[0m [2;31m[required] [0m [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
[2mโญโ[0m[2m Options [0m[2mโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ[0m[2mโโฎ[0m
[2mโ[0m [1;36m-[0m[1;36m-project[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Project slug; look for the committee among [2mโ[0m
[2mโ[0m that project's committees only. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-noop[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m[1;33m [0m Print the plan and change nothing. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-protect[0m [1;2;33m<[0m[1;33mlist[str][0m[1;2;33m>[0m LFID never to remove, besides [2mโ[0m
[2mโ[0m lfservices_releng. Repeatable. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-notify[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m[1;33m [0m Let the service email each member added or [2mโ[0m
[2mโ[0m removed. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-json[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m[1;33m [0m Print the actions as a JSON array. [2mโ[0m
[2mโ[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m[1;33m [0m Show this message and exit. [2mโ[0m
[2mโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ[0m
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 |
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 |
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 ofname, split on any whitespace, asfirst_nameand the rest aslast_name, andcompany, when not empty, asorganization.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-memberdoes, 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;--notifylets 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 |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.