Resolve offline advisory vendor directories to v3 when present
What does this MR do?
Air-gapped instances don't call the distribution service. They read advisories from a vendored directory, and that directory can hold either the v2 or the v3 layout. So for offline instances, the storage type alone isn't enough to pick the format. If we assumed v3 for offline, an instance that has only ever mirrored v2 would break.
This MR changes advisories_version_format so that:
- Everything stays v2 unless the new
sync_v3_advisoriesfeature flag is on. - With the flag on, PDS gets v3.
- With the flag on, an offline instance gets v3 only if its vendored directory has a
v3subdirectory. Otherwise it stays on v2. - The public bucket always stays v2, since it only holds v2 data.
#631389 (closed) will use the same flag when it switches advisories to PDS, so there's one switch for v3 advisories instead of two.
The check only looks at whether the v3 directory exists. It doesn't validate what's inside. That's how v2 and the licenses sync already work. Making sure the data is complete is up to whatever writes it, and the download script publishes v3 with a single rename, so a half-written directory isn't a concern.
References
- #631391 (closed)
- Rollout issue: #631392