Upgrading
How to move an existing deployment from any earlier release to the
current one — and, just as important, which repairs aveloxis migrate
does not do for you.
The four steps
Every upgrade is these four steps, in this order, on the primary host:
AVELOXIS_SRC=/path/to/aveloxis # the git checkout of this repository
cd "$AVELOXIS_SRC" && go install ./cmd/aveloxis && aveloxis version # 1. the new binary (running processes keep the old one until restarted)
aveloxis deploy-checklist --pending # every step this database still needs, oldest first, and the migrate for step 3 — read it now, before step 3 moves the stamp
aveloxis stop all # 2. nothing runs against the schema while it changes
aveloxis migrate --skip-views # 3. the schema — a plain `aveloxis migrate` instead when the checklist asks for one (a release that changed a view definition)
# # …then the checklist's checks, heals and audits, every block's, oldest first
aveloxis ack-deploy # …then record that they ran
aveloxis start all # 4. serve, web and api; then any step the checklist says needs the running release
deploy-checklist --pending reads this database’s last acknowledged
deploy and its schema stamp and prints the range aveloxis start serve
enforces — the same computation, not a copy of it: every release after the
acknowledged one; from the stamp, its own block included, when no deploy
was ever acknowledged (the stamp release’s steps were never acknowledged
either) or when the stamp is behind the acknowledgement (one recorded
after a migrate that did not complete — the stamp is the evidence); and the
new binary’s own steps when there is neither, or when the acknowledgements
cannot be read, which it says. A database from before v0.29.0 has no
deploy_ack table and counts as never acknowledged: its range starts at
the stamp. When the stamp is current and this release’s steps are
acknowledged (or it has none), it prints nothing pending — only then: a
missing, unreadable or malformed stamp prints the steps, saying why first,
and so does a fresh install with no collected data yet.
Otherwise its last line names the migrate step 3 runs. It reads the database in
aveloxis.json (--config for another) and changes nothing. Versions
compare as numbers (0.29.9 is before 0.29.10).
When more than one release in the range has deploy steps, deploy-checklist --pending (and --since) prints a header before the blocks: stop, migrate and start once,
not once per block, with the strongest migrate any block asks for (a plain
aveloxis migrate if any block needs it and no later release in the range
lifts it — 0.29.61 lifts 0.29.60’s, for example, because it moved the
supply-chain views out of the 8Knot batch — otherwise --skip-views) —
that is the migrate step 3 runs, and the one the start gate’s refusal names.
When the header names --skip-views although an older block in the range
asks for a plain migrate, a line under it says which later release lifts
that block’s instruction.
The header’s sequence ends with aveloxis ack-deploy, then aveloxis start all, as the steps above do. Consecutive releases with identical steps print as
one block labelled with the range they cover. Each block’s own stop, migrate
and start lines are covered by the four steps; its checks, heals and audits
are not, and run in step 3, oldest first; a step that needs the running
release (such as adopt-forge-id or the approvals page) runs after step 4.
A --since value that is not a version (dotted numbers such as 0.29.64)
is an error and exits non-zero, rather than printing an empty list.
aveloxis ack-deploy belongs to step 3. When the new binary’s release has
deploy steps, aveloxis start serve (and start all) asks at a terminal
whether they were completed and, without a terminal — a script, systemd,
an SSH command — refuses to start until they are acknowledged. Run it
after the heals, not before: it records that the steps ran. The gate is
aveloxis start’s: a systemd unit runs aveloxis serve directly, which
migrates at its own start with no gate, so under systemd run the ladder
by hand and start the target last (Production Deployment). If the schema
stamp cannot be read, --pending says so and starts the range from the
acknowledgements (the new binary’s own steps if there are none); the
section below says how to find the version you are
coming from, and aveloxis deploy-checklist --since <version> prints the
steps after it.
--skip-views skips only the 8Knot materialized-view batch (hours at
fleet scale); everything else — the schema, the ledgered backfills, the
two supply-chain views — runs either way (v0.29.61). aveloxis refresh-views is not one of the four steps: a release whose heals fed a
materialized view lists it in its own checklist (the “standard ladder”
below shows where it sits when a release asks for it). Since v0.29.68 web,
api and the scancode worker refuse to start while the schema stamp
is behind their binary, naming the migrate, instead of serving queries
against columns the schema does not have yet; and aveloxis start serve
prints the deploy steps of every release since the last acknowledged one,
oldest first, under the same once-only header and with the same collapsing
of identical blocks as deploy-checklist --pending, not only the current
version’s. Neither web nor api ever migrates. The
sections below are the detail behind step 3.
The two halves of an upgrade
aveloxis migrateapplies every schema change and every one-shot SQL backfill between your old version and the new one. It is idempotent and safe to re-run. Since v0.28.4 the expensive one-shot data steps record their completion inaveloxis_ops.migration_ledger, so a later migrate is seconds — only the first migrate across a large version gap pays the full walk.Operator-run heal commands repair data the migrate cannot: they call the GitHub/GitLab APIs, run for hours at fleet scale, or need a judgment call (merging duplicate repositories, for example). They are deliberately not migrations. The table further down lists every one with the release that introduced it, so you can skip the ones that predate the version you are coming from.
Find the version you are coming from before you start — it decides which rows of that table apply:
SELECT schema_version FROM aveloxis_ops.schema_meta;
If that fails with relation "aveloxis_ops.schema_meta" does not exist,
the database predates v0.14.5 (the release that introduced the stamp).
Every row of the table below applies to it — the earliest entry is
v0.23.6 — so you do not strictly need the exact version, but the binary
that last wrote data tells you where you were: aveloxis serve migrates
at startup, so the newest tool_version on collected rows is the last
binary that migrated the schema:
SELECT tool_version
FROM aveloxis_data.repo_info
ORDER BY data_collection_date DESC NULLS LAST, repo_info_id DESC
LIMIT 1;
The standard ladder
AVELOXIS_SRC=/path/to/aveloxis # the git checkout of this repository
cd "$AVELOXIS_SRC" && go install ./cmd/aveloxis
aveloxis version # confirm the new binary
aveloxis deploy-checklist --pending # the exact steps this database needs: follow them where they differ from these
aveloxis stop all # serve, web, api (also cleans stale pidfiles)
aveloxis migrate --skip-views # schema + ledgered backfills; skips the materialized views
# ... operator-run heals from the table below, in order ...
aveloxis refresh-views # refresh the materialized views' data (--set 8knot or supply-chain for one set; add --aggregates for the dm_ tables; slow)
aveloxis ack-deploy # record that the steps ran; a non-interactive `start serve` refuses without it
aveloxis start all
refresh-views refreshes each view’s data; it does not change a view’s
definition. A release that changes a view definition needs one plain
aveloxis migrate (without --skip-views), which drops and re-creates the
views from the new definitions; serve never does it at startup. v0.29.57 is
such a release (explorer_libyear_summary’s definition now orders unknown
repositories last): its deploy checklist (in the range aveloxis deploy-checklist --pending prints) uses a
plain aveloxis migrate in place of the --skip-views step above, then
checks that the new definition is in place. That check matters because the
migrate only logs a WARN (materialized view creation had errors) when the
views fail to re-create, and still exits 0 with the old definitions in place.
Since v0.29.68 the build enforces the rule: matviews.sql is pinned by
digest, and a change to it fails the test suite until the release shipping
it is named and that release’s checklist carries the plain migrate.
Run aveloxis migrate explicitly rather than letting aveloxis serve
migrate at startup: web and api never migrate and (since v0.29.68)
refuse to start while the schema stamp is behind their binary, and (since v0.27.131) serve trusts the
schema-version stamp and skips the migration walk entirely once it
matches — so after any hand edit to the schema, run aveloxis migrate
once. Verify the stamp matches the binary afterwards:
SELECT schema_version FROM aveloxis_ops.schema_meta; -- equals `aveloxis version`
What to watch for in the migrate output
0.29.102 adds two columns, moves web sessions into the database, and must be deployed with aveloxis-gui’s matching release. Stage 2 of the admin-console program. Run aveloxis migrate --skip-views (two columns and one index on aveloxis_ops.user_session_tokens; an index built CONCURRENTLY). What changes for people: web sessions are database rows (24 hours from sign-in; a restart of aveloxis web no longer signs everyone out), administrator privilege is read from the account’s row on every request (a demotion takes effect at once), and signing out of the web GUI ends the API tokens that sign-in minted. E-mail confirmation links outstanding at the deploy stop working (they are stored hashed from this release; the owner requests a new one from the account page). POST /auth/token and POST /logout are POST-only — deploy aveloxis-gui’s matching release with this one (its login page and sign-out send POST; check-setup.sh requires 0.29.102). web.session_secret is removed from the configuration (nothing ever read it); a file that still carries the key loads, and from 0.29.106 logs a warning naming it at start. Every POST to the web process is checked for its origin: if aveloxis-gui runs on another origin, web.spa_url must name it (it already should, for the sign-in return), and a reverse proxy must forward the public Host ($host, or $http_host on a non-default port — the guard compares the browser’s origin, port included). The pages now load their scripts and Chart.js from the web process itself (/static/; no CDN) and answer with a Content-Security-Policy and a framing refusal: a reverse proxy that sets its own CSP should let the web process’s through or match it.
0.29.101 tightens the two GitLab URL rules, not the schema. gitlab.base_url must now end in /api/v4 (the REST client appends paths to it as given; a bare https://gitlab.example.org loaded on 0.29.100 and sent every GitLab REST call to the wrong path) and web.gitlab_base_url must be the instance’s web URL (https://gitlab.example.org, not its /api/v4 URL; no query, fragment or user name): either refuses every process at start, naming the field. The defaults and any working value pass. Nothing else to run beyond the ladder.
0.29.100 changes two configuration rules and several API answers, not the schema. Stage 1 of the admin-console program. Before starting, check two blocks of aveloxis.json. The mail block: a half-filled one (gmail_user without gmail_app_password or the reverse, a user that is not an address, a password that is not a 16-letter App Password, a site_url that is not a URL) now refuses to start every process, naming the field — it used to run with mail off and a WARN. And gitlab.base_url: a value that is not an absolute http(s) URL of the instance’s API (no scheme, a query, a user name) now refuses to start as well — the default and any working value are unaffected. The API: a group that is not the caller’s answers 404 on every group route, as a group that does not exist does; a rejected group refuses an add with 409; every refusal body on the group, decision, role and forge-ID routes is JSON {"error": "…"}; a paste’s lines that are not repository URLs come back in invalid while the rest go through; a collection that does not exist is a 404 and a duplicate collection name a 409; the legacy pending-group approval (GET /admin/groups/pending, the approve decision) is gone — POST /admin/groups/{id}/reject remains. Administrator privilege is decided from the users row at every operation: an API token never administers, and an administrator’s open session loses its power the moment the row is demoted. GitLab groups registered in user groups are now enumerated by serve, by full group path, on the configured gitlab.base_url instance when GitLab API keys exist; an organization URL on that instance is registered as a GitLab group, and a repository URL on it is collected as a GitLab repository, whatever its host name says; a GitLab group on another instance (or on any instance when gitlab.base_url is empty) is refused at the add, as a GitHub organization off github.base_url is. The web GUI and the CLI loaders list no organizations themselves any more (aveloxis web loads no API keys; add-repo <org> registers and serve lists). A new install seeds the capacity refusal contact from mail.operator_email (or leaves it empty); a deployment seeded earlier keeps its address. Each changed route carries the reason in its own section of the REST API guide (the “Changes for API clients” sections there cover 0.29.99 and 0.29.102). aveloxis-gui’s check-setup.sh requires 0.29.100 from this release on.
0.29.99 changes API answers, not the schema. Stage 1b of the admin-console program: an unknown repository id is a 404 on every repository route (it was a 403 for tokens and sessions) and an id of 0 or less a 400; a date that does not parse is a 400 instead of a silent default; Augur’s end_date includes its day and the Augur commit metrics count by the UTC day of the author timestamp; empty lists are []; the Augur catalog routes are scoped for API tokens; /watchers carries the snapshot history; /repos/stats?ids= refuses an entry that is not an id and its rows carry archived, forked_from and last_activity_at; the searches match % and _ literally. The full list, with the reason for each, is “Changes for API clients” in the REST API guide. Nothing to run beyond the ladder; the repository-page cache re-keys itself on the version. aveloxis-gui’s check-setup.sh requires 0.29.99 from this release on.
0.29.98 is a maintenance release. Nothing changes for operators: the web GUI’s handlers now live in files by concern and its page templates are embedded files (the pages render byte for byte as before), the serve monitor on 127.0.0.1:5555 no longer registers the POST /api/repos route that only answered with the CLI command to run, and unused store and collector functions were removed. No schema change; the migrate’s step order is unchanged.
0.29.97 fixes the migrate on databases born between 0.29.82 and 0.29.88. On those, aveloxis migrate on 0.29.89 through 0.29.96 could log schema migration error step="v0.29.82 seed api_token_settings" … null value in column "default_rate_limit_per_hour" … (SQLSTATE 23502): the table’s rollback-mirror column is NOT NULL without a default on that schema generation, and the seed had stopped supplying it. The seed now supplies the shipped hourly allowance and the column gets the default the current schema declares. If your migrate logged that error, run aveloxis migrate --skip-views again on this version; no other step was affected and nothing is lost. No new schema object.
0.29.96 names the quota in a refused addition’s log line. The line organization repositories not linked, written when the organization reconcile cannot link everything, used to say the account’s repository quota was reached whatever refused; for an organization a user registered without an administrator’s decision, the daily additions quota refuses through the same path. Every line that logs a refusal (that one, the four once-a-day repository quota / daily additions quota lines, the two sign-up quota lines and the API’s two request refused lines, for a quota and for the auto-add cap) now carries the same fields: quota=, used=, allowed= and wanted=. The old names were reach=, added_today=, adding= and signups_today=; adjust any log filter on them. The API’s per-request rate quotas (requests_per_hour and the token quotas) are the one exception: their refusal is the once-per-window quota reached — refused until its window ends line, unchanged, which carries quota=, allowed=, used= and window_ends= instead of wanted=. No schema change.
0.29.95 keeps aveloxis data-test out of your clone folder. Each side of a data-test run now clones its repositories under the run’s work dir (<work-dir>/clones-released and <work-dir>/clones-new). Before, both sides inherited the deployment’s repo_clone_dir, and because a clone is stored by the repository’s row id in whichever database the binary talks to, a scratch run replaced the deployment’s own repo_1, repo_2, … with other repositories’ clones. Nothing to do by hand on a host where that happened: the collector checks a clone’s origin URL before reusing it, logs stale clone detected: origin URL mismatch, re-cloning, and re-clones the right repository, so the cost was one re-clone per affected repository, not wrong history. No schema change.
0.29.94 saves the API-token defaults whole. On the admin page, the hourly and daily allowances and the lifetime a new token gets are now saved in one transaction: before, each allowance was committed on its own, so a failure part-way (a lost connection, a refused write) left a mix the administrator never submitted. No schema change; a fleet already running 0.29.93 needs only the stop, the migrate and the start.
0.29.93 closes six smaller defects. The migrate rebuilds the commits and repo_labor duplicate-guard indexes when an earlier interrupted build left them INVALID (it took them as present before). Check before the migrate with SELECT c.relname, i.indisvalid FROM pg_index i JOIN pg_class c ON c.oid = i.indexrelid WHERE c.relname IN ('idx_commits_repo_hash_file', 'uq_repo_labor_natural_key'); — a false means this migrate rebuilds that index, which for commits is a full duplicate scan plus a concurrent build (hours on a large fleet), so plan the window; dropping invalid index from prior interrupted CONCURRENT build in the migrate log confirms it ran. The scancode worker refuses repository URLs git must not be handed. A dependency scan whose snapshot clear fails stops for that cycle instead of duplicating rows. aveloxis prioritize and aveloxis recollect refuse a URL that is not tracked instead of creating a repository row. The welcome email describes per-addition approval, and several dropped errors are now logged. No schema change: from 0.29.92 the upgrade is the stop, aveloxis migrate --skip-views and the start; from an older release, the 0.29.92 notes below apply in the same one migrate.
0.29.92 fixes a cross-site scripting hole in the built-in web GUI. The repository page, the compare page and the repository search on the dashboard and group pages wrote license names, ScanCode file paths and copyright lines, and repository names from the API into the page as markup, so text a package author or repository owner controls could run script in a signed-in viewer’s browser. They now render it as text, and /compare?repos= keeps only repository ids, at most five. No schema change: from 0.29.91 the upgrade is the stop, aveloxis migrate --skip-views and the start; from an older release, the 0.29.91 notes below apply in the same one migrate.
0.29.91 counts automatically approved organizations and never refuses sign-out. Repositories an organization scan links now count toward repo_links_per_day unless an administrator approved that organization for that group. Signing out is never refused by a spent quota. The api logs a warning naming api.trusted_proxy when a request from a loopback or exempt address carries X-Forwarded-For and the key is empty. Removing a repository that is not in the group answers 404. Automatically approved pastes count toward repo_links_per_day. The web’s /api proxy now forwards only the client address it resolved under web.trusted_proxy, so set both web.trusted_proxy and api.trusted_proxy to 127.0.0.1 when nginx, web and api share a host. No schema change: from 0.29.89 or 0.29.90 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.90 adds or refuses a paste of repositories whole. A paste of repositories by an account that is not an administrator is now added whole or refused whole, even when the same account adds from two places at once: the repositories already tracked are linked and the new ones recorded for approval in one step. No schema change: from 0.29.89 the upgrade is the stop, aveloxis migrate --skip-views and the start; from an older release, the 0.29.89 notes below apply in the same one migrate.
0.29.89 adds fair-use quotas. Each signed-in account, API token, account’s repositories and network address’s new accounts has a quota (see the configuration guide, “Capacity”, and the API guide, “Rate limits”). The migrate adds seven tables to aveloxis_ops and seeds one row per quota, adds api_tokens.rate_limit_per_day, and moves the API-token default allowance into the token_requests_per_hour quota (a value you saved is kept, except the old default 5,000, which becomes the new 1,000: if you chose 5,000 on purpose, set it again on the Capacity page; the old api_token_settings column stays, kept current, so an older release still reads its token default). Every new quota starts in shadow: counted and logged (quota reached (shadow) for requests, repository quota (shadow), daily additions quota (shadow) and sign-up quota (shadow) for the others), never refused, until you turn it on in the GUI’s Capacity page. The 0.29.88 session ceiling is replaced by them, so no signed-in session is refused until you do. A new API token’s default is now 1,000 calls an hour. Each process logs capacity quota in force for every quota at start. Behind nginx, set web.trusted_proxy, or every sign-up counts as nginx’s address (the web logs a warning naming it). Sign-up addresses are kept only as a hash that changes every UTC day; to keep each new account’s address sealed for a year for a lawful request, see Sign-up address escrow. Rolling back to 0.29.82–0.29.88 needs one cleanup, because older releases never delete the sign-up quota’s daily secret: the deploy checklist gives the command. From 0.29.88 the upgrade is the stop, aveloxis migrate --skip-views and the start.
The migrate seeds the contact address that every refusal names as aveloxis.io@gmail.com, the Aveloxis project’s address, on every deployment. If you host Aveloxis yourself, set your own address on the Capacity page (or with POST /api/v1/admin/capacity/contact from an administrator’s session; see the API guide, “Capacity (admin)”) before you enforce any quota; otherwise heavy users of your host are told to write to the Aveloxis project.
0.29.88 tags stored token hashes, scopes batch stats and bounds group writes. Stored session and API-token hashes now carry their algorithm (sha256$); the migrate tags the existing ones. An API token can no longer change its owner’s e-mail address; a group add carries at most 1,000 URLs and a group name at most 200 characters; batch stats (/repos/stats?ids=) are scoped for every non-administrator, sessions included; an API token is counted against its own allowance also from an exempt network (api.exempt_cidrs); and refusals are logged once a minute per user and kind. This release also added an hourly ceiling on signed-in sessions, which 0.29.89 replaced with requests_per_hour and requests_per_day. One-time sign-out: a database whose last migrate was by 0.29.82–0.29.86 signs every API session out once at this migrate (log line signed every API session out once, with the count), because a session an older binary wrote there could be stored raw but marked hashed, and no row says which; users sign in again. A database that never ran those releases signs nobody out. One case is not detected (a database that ran 0.29.82–0.29.86, then a release older than 0.29.82, then 0.29.87): if that can be true for yours, the deploy checklist gives the one statement that signs everyone out by hand. Stop every process before this migrate: an older web or api still running would write untagged rows the new api cannot read until the next migrate. Rollback hazard: after this migrate, going back to any of 0.29.82–0.29.87 makes every session and API token unusable while the older binary runs, because it looks for the untagged hash; upgrading again restores them, so do not re-grant API tokens. From 0.29.87 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.87 removes session tokens an older binary wrote. Every migrate from 0.29.87 on deletes a session token that an older binary wrote (after a rollback, or by a process still running the old version during the deploy) and logs removed session tokens an older binary wrote with the count; those users sign in again once. Below 0.29.82 such tokens were stored in plaintext, and they are no longer left behind. One case cannot be told apart: a session a pre-0.29.82 binary created during a rollback from 0.29.82–0.29.86, before this release first migrates, stays in plaintext and no longer signs in; it is deleted at the first sign-in of anyone after it expires (30 days after it was created). No schema change: from 0.29.86 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.86 keeps every API token to its owner’s groups. An API token reads only the repositories in its owner’s groups, also one granted to an administrator (before, such a token read every repository). A request for any other repository is refused with 403 and the way to add it (its URL, the owner’s groups, and the calls to add it to a group or create one), where since 0.29.82 the repository was added to Shared with Me; a script that relied on that must add the repositories to a group first. The batch stats route (/repos/stats?ids=) likewise answers a token only for its owner’s groups. Signed-in browser sessions are unchanged. No schema change: from 0.29.85 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.85 logs heavy signed-in sessions. An account whose session makes more requests in an hour than an API token is allowed is logged in api.log (signed-in session made more requests this hour than an API token is allowed), and again at each doubling; nothing is refused (0.29.89 replaced this line with the session quotas). Sign-out and the expired-session sweep also remove an old Augur refresh_tokens row that pointed at the session (before, such a session could not be signed out), and cross-origin browser clients can read the rate-limit headers. No schema change: from 0.29.84 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.84 serves a known API token from a busy address. An API token validated in the last minute is counted against its own hourly allowance even when its address has just sent a bad token and run out of its per-IP limit; before, it got the address’s 429. No schema change: from 0.29.83 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.83 is built with Go 1.26.9 and golang.org/x/net v0.60.0 (security fixes in net/http, crypto/tls and HTTP/2). A star or comparison that links a repository already in your groups no longer counts against the per-user cap on repositories added by viewing them. No schema change: from 0.29.82 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.82 limits only callers without a token, hashes session tokens, and adds API tokens. A request with a valid session token is no longer counted by the per-IP rate limit; an API token granted on the GUI’s API tokens page is counted against its own hourly allowance (see the API guide, “Rate limits”). The migrate adds aveloxis_ops.api_tokens, aveloxis_ops.api_token_settings and user_session_tokens.token_hashed, and on the run that adds that column replaces every stored session token with its SHA-256 hash: nobody is signed out. Rolling back to an older release afterwards signs every API session out once (the older release compares the raw token). Signing out of the GUI now also ends the API session token. An API token never works on admin routes, lives at most 365 days and stops at once when revoked; a signed-in user can add at most 100 repositories an hour to “Shared with Me” by viewing them. From 0.29.81 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.81 credits a merged contributor’s commits to the contributor it was merged into. Top contributors read from the daily commit table used to drop the commits of a contributor that a merge had folded into another. No schema change: from 0.29.80 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.80 keeps a quiet collection with a broken clone incremental. An incremental GitHub or GitLab collection whose clone fails and whose API phase found nothing new now completes with the clone’s error in last_error, instead of failing as “no data collected”, so the next collection stays incremental while you fix the clone. A first or forced collection is still judged and still fails that way. No schema change: from 0.29.79 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.79 marks a repository’s daily commit counts incomplete when a collection adds commits it could not record completely. The page then reads the commits table for that repository until its next clean collection, instead of leaving the new commits out. No schema change: from 0.29.78 the upgrade is the stop, aveloxis migrate --skip-views and the start.
0.29.78 keeps two answers with the response cache off. With api.response_cache_mb unset (the default), the API again keeps the weekly time series and the top contributors in memory, up to 1,000 answers, as it did before 0.29.73; every other answer stays uncached until the setting is turned on. No schema change: from 0.29.77 the upgrade is the stop, aveloxis migrate --skip-views and the start; from an earlier version, follow the checklist, which includes 0.29.77’s steps.
0.29.77 builds two indexes and sets a storage parameter. The top-contributors issue and pull-request arms read a large repository’s rows one heap page at a time (repository 94609 on the production fleet: 505K pull-request rows and 58K issue rows, 2.5M page reads with the review and message arms, past nginx’s 120 s). The migrate builds idx_issues_repo_created_reporter and idx_pull_requests_repo_created_author CONCURRENTLY — the v0.27.4 (repo_id, created_at) indexes with the author column INCLUDED, so those arms are index-only; the plain forms are dropped — and sets autovacuum_vacuum_insert_scale_factor = 0.01 on the five large tables, because an index-only scan is only as good as the visibility map and insert-mostly tables left half their pages unmarked under the default. The ladder then runs, after the start and once serve is up, one manual VACUUM (ANALYZE) on messages, pull_request_reviews, pull_requests and issues to catch the map up (online; its duration scales with the table sizes and is not measured; a migrate that runs DDL — aveloxis migrate, or a serve start whose stamp is behind the binary — waits behind it per table, while a serve start on a stamped fleet fast-paths past the DDL). Run the ladder as usual.
0.29.76 changes nothing in the schema. After the fleet-wide heal-commit-daily, the repository page’s /stats still answered 503 on the largest repositories: its last-activity bound fell back to a live scan of the commits table whenever the stored bound could not be used — not yet filled (it fills at the repository’s next collection), or bogus and so read as unfilled (every kernel fork carries one commit dated 2085 and some one dated at the epoch; the next walk repairs the stored value). The activity bounds now read the first and last plausible day of the complete daily picture before any live scan. Run the ladder as usual.
0.29.75 adds one column (repos.commit_daily_complete_at, nullable, an instant ALTER) and, on the run that adds it, stamps every repository that already has daily commit rows (one indexed probe per repository; seconds on a fleet). From here the repository page’s commit readers use the daily table only for a stamped repository — a facade walk whose every commit was proven written stamps it, heal-commit-daily stamps what it fills, a walk that swallowed writes never does — and heal-commit-daily lists the unstamped ones; a repository whose only walk swallowed writes shows the fuller commits table until its next clean walk. Also: every answer that depends on who asks — the routes behind a signed-in session, a signed-in caller’s search, compare or entity search, the one-time Shared-with-Me notice, and every 401/403 — carries Cache-Control: private, no-store (/api/v1/me was the one Copilot named). Run the ladder as usual.
0.29.74 changes nothing in the schema. It exists so that every cached repository answer is recomputed: the answers’ validators carry the binary’s version, and 0.29.73’s late fixes — the daily commit table’s readers and the plausible-date bounds — changed answers without changing it, so a restart on 0.29.73 kept serving an old time series as a 304. Run the ladder as usual; a fleet that skipped 0.29.73 gets its steps.
0.29.73 adds a column and a table (repos.data_changed_at, stamped
by every writer of a repository’s data so the API’s response cache can tell
a changed repository from an unchanged one; and repo_commit_daily, the
facade’s daily commit counts that the repository page’s commit answers
read): run aveloxis migrate --skip-views on the way to it; api and
web refuse to start until the stamp is current. Then aveloxis heal-commit-daily --apply (row 20) fills the new table for repositories
collected before — a background job, not a gate.
Migration steps are fail-closed (v0.19.4): a failing step fails the
migrate — every remaining step still runs, the error lists every
failed step, and serve refuses to start until they are fixed. Three
steps are deliberately warn-only because they wait for operator action
(a few other best-effort steps — the commits dedup index, the .git
suffix cleanup, the tool_version default sweep — also warn rather than
fail, but need nothing from you and simply re-run on the next migrate):
Log line |
Since |
What it means |
Action |
|---|---|---|---|
|
v0.25.32 |
|
|
|
v0.27.18 |
a writer bypassed the snapshot-replace path |
investigate the duplicates, then re-run migrate |
|
v0.25.30 (the index itself is v0.18.30; it was fatal from v0.19.4 until the v0.25.30 skip) |
the extension needs superuser to create |
performance only (monitor search falls back to sequential scans); |
One more gate is fail-closed rather than warn-only — it waits for
serve to be stopped:
Log line |
Since |
What it means |
Action |
|---|---|---|---|
|
v0.28.18 |
duplicate list registrations exist and a running |
stop |
The first migrate across a large gap can take a while. The long poles
(“ledgered” = recorded in migration_ledger after it completes and never
walked again; the others re-run on every migrate but converge to a cheap
no-op once their work is done):
Step |
Since |
Ledgered? |
Cost |
|---|---|---|---|
|
v0.25.6 |
yes |
scales with the commits table (about an hour at ~470M rows) |
|
v0.27.7 |
yes |
keyset windows over |
GitLab force-full flag (main-path comment-drop heal) |
v0.27.37 |
yes (v0.28.18) — seeded on upgrade from ≥ v0.27.37, so it does not re-run |
instant; on a database last migrated BELOW v0.27.37 it flags every collected GitLab repo for one full pass on its next cycle |
message-bridge |
v0.27.15 |
yes |
45–75 min on a fleet-scale |
|
v0.27.17 |
no — runs every migrate, a no-op once consolidated |
seconds to minutes once the FK-child indexes exist (v0.28.15); the first pass deletes one row per duplicate group with a deferred FK check per child table |
|
v0.27.38 |
no — but fast-skips once its final step has run |
keyset windows over |
PR meta-link backfill ( |
v0.27.104 |
yes |
tens of minutes over tens of millions of PR ids |
Configuration compatibility
An older aveloxis.json keeps working: unknown keys are ignored and
every new key takes its documented default (see
Configuration) — with one class of exception: a value
a release starts to validate is refused at load, by aveloxis migrate
and every process alike, so check the table before step 3. Defaults that
changed, and values now refused — check whether you relied on the old
behavior:
Key |
Old default |
New default |
Since |
|---|---|---|---|
|
30 |
0 — scancode subprocesses are killed immediately on |
v0.23.7 |
|
|
|
v0.26.0 |
|
silently fell back to Saturday |
honored (alias of |
v0.27.96 |
|
off |
on — lockfile closures + transitive findings + real SBOM graphs |
v0.27.136 |
|
(every repo on the same cadence) |
6 — archived repos recollect six times less often |
v0.28.1 |
|
any text; a host name, a CIDR or a non-canonical spelling silently never matched |
must be an IP address in canonical form ( |
v0.29.73 |
|
— |
a value without |
v0.29.73 |
Two behavior changes that need no configuration but are worth knowing:
since v0.27.139 incremental collection anchors since on the previous
round’s last_collected (the pre-v0.27.139 now − days_until_recollect
window silently skipped items last-updated between rounds), so the first
post-upgrade cycle per repo is transitional and heal-collection-gaps
below covers the history; and path values in aveloxis.json are never
$HOME-expanded — use absolute paths.
Operator-run heals, with the release that introduced each
Run every row whose Since cell names any release newer than the
version you are coming from, in table order. Several rows list later
extensions in parentheses — row 4 gained pull_request_repo owners in
v0.27.104 and row 6 gained platform_repo_id in v0.27.102, both long
after the row’s first release — so comparing against the first version
alone would skip a repair that does apply to you. Every command is idempotent and resumable;
re-running is always safe. Rows marked fleet-scale take hours on a
100K-repo fleet and minutes on a small one.
Order |
Command |
Since |
Repairs |
When |
|---|---|---|---|---|
1 |
|
v0.23.6 |
re-installs scc / scorecard / scancode and injects |
any install that predates v0.23.6 |
2 |
|
v0.25.32 (index precondition v0.28.18) |
case-variant duplicate repositories; the migrate skips the |
only when the migrate warns; needs the new binary’s migrate to have built the |
3 |
event-cohort SQL (below) |
v0.26.3 |
PR events silently dropped on quiet repos by the two-pass ETag self-alias bug; flags each affected repo for one full recollect |
any repo collected before v0.26.3 |
4 |
|
v0.26.5 (keyset batching v0.26.6; |
assignee / reviewer / PR-meta / PR-repo |
yes; fleet-scale — use |
5 |
|
v0.27.38 (probe index v0.27.67; per-pass stamps v0.28.1; cursor walk v0.28.8) |
message rows overwritten by the cross-kind platform-ID collision; the migrate captures the worklist, this consumes it |
yes; it also drains each repo’s leftover staging — run |
6 |
|
v0.27.79 ( |
description / languages / archived / |
yes; ~1.6 h per 94K repos |
7 |
|
v0.27.105 |
|
recommended; fleet-scale, marker-resumable, safe beside |
8 |
|
v0.27.140 (safe beside |
issues / PRs lost to the pre-v0.27.139 blind-window |
required for any repo collected before v0.27.139; must run on the new binary; fleet-scale (~65 h at |
9 |
|
— |
the materialized views over the healed data; add |
after rows 3–8 settle (the weekly rebuild also covers the views, and the |
10 |
|
v0.27.39 (index precondition v0.28.18) |
stranded repositories (a |
periodic, until the residue drains; its consolidation arms skip with a warning (and the run exits nonzero) until the new binary’s migrate has built the |
11 |
|
v0.28.1 (automatic recheck v0.29.7) |
the explicit “gone” state for deleted or privatized repositories that still hold data; until v0.29.7 it was also the ONLY path that noticed a gone repository had come back — |
optional — one run after the upgrade verifies the historical cohort immediately instead of over the first cadence |
12 |
|
v0.27.4 (scan-side version normalization v0.27.72) |
empty OSV stub findings and malformed-purl false positives |
optional — the scheduled scans self-heal on their normal cadence |
13 |
|
v0.28.20 |
|
only if you collect Apache mailing lists; needs the migrate to have built the |
14 |
|
v0.25.7 (forge-resolved lookups v0.27.152) |
registers Apache |
only if you enable mailing-list collection — see below |
15 |
|
v0.29.0 |
mailing-list sender attribution in one fast pass (email + canonical + alias chains; the alias arm alone reaches ~163K bodies nothing else can) — the hourly ticker does the same walk continuously afterwards |
only if you collect mailing lists; minutes-scale even on a 12.6M-body fleet |
16 |
|
v0.29.0 |
|
only if you collect mailing lists; ~30–45 min per 12.6M bodies, marker-resumable |
17 |
|
v0.29.0 |
Jira reporter + assignee identity and authoritative issue state, from the Jira Server API (comment-author identity is NOT in this one-shot — the ongoing Jira worker banks it as it collects each project’s comment blocks). Time-sensitive: the stable username this matches on does not exist in Jira Cloud’s API — run it before the ASF instance migrates |
only if you hold Jira-projected issues (Apache mailing lists); ~2–3 polite hours for the full ASF corpus |
18 |
|
v0.29.0 |
re-projects mailing-list messages a wrong-system drain pool processed without Layer-2 projection (the cross-system drain fix: 90%+ of Apache list mail was drained by the lore processor and never projected onto issues). The migrate itself restamps |
only if you collect mailing lists AND upgraded through an affected version; one clean run converges — rerun only after a mid-run error |
20 |
|
v0.29.73 |
|
any fleet upgrading to 0.29.73; one scan of each repository’s commit rows, largest first, each its own transaction; safe beside |
19 |
|
v0.29.57 |
libyear values stored as |
any fleet upgrading to v0.29.57; the dry run is the default and reports the count; walks the table in primary-key windows, safe beside |
Skipped as instance-specific: the load-foundation-* importers (only if
you track a foundation’s whole catalog) and register-mailing-list
(curated non-Apache lists).
The v0.26.3 event-cohort SQL
Before v0.26.3 the issue-event and PR-event feeds paginated the same
GitHub endpoint twice; on any repository where nothing changed between
the two passes the second one got a 304 and the entire PR-event history
was silently dropped. “Has PRs but no PR events” can be legitimate for
small quiet repos, so this is deliberately not an automatic migration.
Flag the affected cohort for one full recollect (lower the HAVING
threshold to taste):
UPDATE aveloxis_ops.collection_queue q
SET force_full_collect = TRUE
FROM (
SELECT pr.repo_id
FROM aveloxis_data.pull_requests pr
WHERE NOT EXISTS (SELECT 1 FROM aveloxis_data.pull_request_events e
WHERE e.repo_id = pr.repo_id)
GROUP BY pr.repo_id
HAVING COUNT(DISTINCT pr.pull_request_id) >= 50
) sub
WHERE q.repo_id = sub.repo_id
AND q.force_full_collect = FALSE;
Each flagged repo re-walks its full event history on its next cycle.
Mailing lists on an existing catalog
aveloxis load-apache-lists never inserts repositories. For each Apache
PMC it looks the PMC’s primary repository up in your catalog (URL
variants first, then a github.com redirect probe for renamed projects)
and registers that PMC’s lists only when the repository is found;
everything else is counted as skipped. On a catalog that already holds
some Apache repositories it therefore registers exactly those PMCs —
load-foundation-core-repos is only needed if you want every PMC’s
flagship repository imported first. A PMC whose sibling repository you
track (say apache/arrow-rs without apache/arrow) is skipped, because
mailing-list bodies attach to the PMC’s primary repository. The command
needs outbound network access (Apache’s projects.json /
podlings.json, lists.apache.org for list enumeration, and github.com
for the redirect probe) and moves each linked repository into an
Apache PMC: <slug> repo group.
aveloxis load-apache-lists --dry-run # [pmc] list → repo_id per PMC you hold; the rest are "skipped"
aveloxis load-apache-lists
Then enable the worker in aveloxis.json and restart serve:
{
"collection": {
"mailing_list_enabled": true,
"mailing_list_polite_email": "you@example.org",
"mailing_list_backfill_months": 6
}
}
mailing_list_polite_email is the contact address sent to the archive
admins in the User-Agent; mailing_list_backfill_months bounds the
first pass per list (0 = full history from each list’s first month).
aveloxis mailing-list-stats shows coverage as lists drain;
aveloxis verify-mailing-list reports which classification and routing
branches have produced rows. Run the mailing-list ingestion after the
issue / PR heals above have settled: messages are projected onto the
issues and pull requests already in the database, so a more complete
catalog links more mail. Full design in
Mailing-List Ingestion.
Recurring maintenance (not tied to a release)
A few checks are worth a calendar entry rather than an upgrade step. All but one run only when you run them; each exists because a fleet drifted without anyone noticing.
Cadence |
What |
Why |
|---|---|---|
quarterly, and after any incident where someone raised a limit |
run the |
the settings that OOM a host ( |
automatic since v0.29.7 ( |
|
a repository that returned 404/410/451 was dequeued, so no collection cycle ever looks at it again, and organizations do flip repositories private and back. On a release before v0.29.7 run the command quarterly by hand. The probe is an unauthenticated HEAD per candidate — it spends no API budget |
quarterly |
|
stranded |
yearly, or when disk is tight |
index audit before dropping anything: |
zero-scan indexes on |
once, then whenever the network changes |
confirm |
the PostgreSQL log’s |
If you run more than one host against the database, the second host’s role is a decision, not an accident — see Dedicated scancode host.
Where the per-release detail lives
Per-release notes are on the GitHub releases page. Every command above is documented in Commands; recovery procedures for specific incidents are in Troubleshooting; the transitional v0.25.x distribution-tracking knobs and their deprecation horizon are in Configuration.