Release Notes¶
v0.3.1-31¶
New Features¶
Added a centralised, opt-in logging framework (
gerrit_to_platform._logging) that operators can configure viaG2P_LOG_*environment variables or a new[logging]section ingerrit_to_platform.ini. Default behaviour is unchanged (WARNINGto stderr).
Logging supports a human-readable text format and a one-object- per-line JSON format (
schema_version"1") suitable for aggregation in Loki / ELK / GitHub Actions log artefacts.
Each hook invocation carries a short correlation id, attached to every log line as
cid=…. The id can be inherited from a parent process (e.g. thegerrit-actionhook wrapper) by settingcorrelation_id_envto the relevant env-var name.
Hook entry-points (
patchset-created,comment-added,change-merged) and thefind_and_dispatchlifecycle now emit structuredhook=…,platform detected,workflow lookup,dispatch attempt,dispatch success/failureandhook=… exit elapsed_ms=…lines so operators can diagnose ephemeral container deployments (Docker, GitHub-CI sandboxes) without source access.
The GitHub client wrapper logs every workflow dispatch and workflows-list call with timing, owner/repo and outcome.
A
RedactingFilteris attached to every handler installed byconfigure()and scrubs GitHub token shapes,Authorizationheaders,token=query-string parameters and labelledtoken=/secret=/password=values from log records before any handler sees them.
Added four annotated example workflows in
examples/workflows/demonstrating how to build Gerrit-integrated GitHub Actions workflows:github-vanilla-verify.yaml— Baseline GitHub workflow (no Gerrit)gerrit-verify.yaml— Gerrit verify pattern with vote lifecycle andcheckout-gerrit-change-actiongerrit-merge.yaml— Post-merge pattern using comment-only mode and standardactions/checkoutgerrit-verify-manual-dispatch.yaml— Hybrid pattern supporting both Gerrit dispatch and manual runs from the GitHub Actions UI
Added a Workflow Migration Guide to the README covering:
Verify vs. merge workflow patterns and when to use each
Checkout rules (
checkout-gerrit-change-actionvsactions/checkout)Voting rules (full voting, comment-only, advisory modes)
Concurrency groups keyed on
GERRIT_CHANGE_IDReplication delay best practices
Manual dispatch bypass pattern for advisory workflows
Required (organization-wide) workflow configuration
Companion GitHub Actions (
gerrit-review-action,checkout-gerrit-change-action)Vanilla-to-Gerrit migration checklist
Upgrade Notes¶
No action is required for existing deployments: the framework is backwards-compatible at default verbosity. See
docs/LOGGING.mdfor the new operator-facing configuration surface.
No operator action required. Existing deployments that did not trigger this crash (because their
replication.confighappened to keepfetchto a single line per remote) see no behaviour change. Deployments that did crash after every hook event — notably any pull-replication setup mirrored from a Gerrit source — will start dispatching workflows successfully after this release.
Behaviour for Gerrit servers that emit the legacy triplet shape is unchanged. Servers that emit the modern compact shape (Gerrit 3.x and later, or any older server configured to use the new shape) will start successfully dispatching workflows after this release; no operator action is required.
get_change_idnow raisesValueErrorinstead ofIndexErrorfor unrecognised input, which makes triage easier when inspecting hook tracebacks.
Bug Fixes¶
Fix
configparser.DuplicateOptionErrorraised from every hook invocation whenreplication.configcontains multi-valuedfetch = ...refspecs under a single[remote "..."]section. This is the canonical shape Gerrit’s pull-replication plugin writes (and is valid git-config syntax for representing a list), but Python’sconfigparserdefaults tostrict=Trueand refuses to parse repeated keys.get_config()now constructs the parser withstrict=False, which allows the multi-valued keys through with “last value wins” semantics.g2ponly reads the single-valuedurl,authgroupandremotenamestylekeys from the remote sections, never the multi-valuedfetchkey, so the relaxed semantics have no functional impact.
Fix
IndexError: list index out of rangeraised from every hook invocation against Gerrit 3.x servers that pass the modern compact--changeargument (<URL-encoded project>~<number>, e.g.ccsdk%2Fapps~1). The previousget_change_idimplementation only matched the legacy triplet form (project~branch~Iabc123...) and crashed for anything else, dropping everypatchset-created,comment-addedandchange-mergedevent before workflow dispatch could run.
get_change_idnow returns the legacyI...Change-Id when the legacy triplet form is supplied, and returns the modern compactproject~numberidentifier verbatim otherwise. The compact form is still a unique, stable identifier per change and works as aGERRIT_CHANGE_IDworkflow input (e.g. forconcurrency.groupkeys).
v0.2.1¶
Bug Fixes¶
Magic repos may not have the same branches that the source repo does make the assumption / requirement that the magic repo uses refs/heads/main for everything
v0.2.0¶
New Features¶
Required workflows are now searched for out of the ORGANIZATION/.github magic repository which matches with ‘required’ as part of the workflow filename.
Upgrade Notes¶
Only workflow files will be searched for relevant jobs to execute. They must now also contain ‘gerrit’ in the filename.
ex gerrit-verify.yaml or verify-gerrit.yaml instead of a verify.yaml
Workflows must now all contain ‘gerrit’ as part of their filename
Workflows must now have the search filter word as part of their filename
Workflow names (friendly name inside the workflow) are no longer searched for triggering purposes
v0.1.0¶
Prelude¶
This is the initial release of gerrit_to_platform.