Issues fetching extensions in 3.32
Created by: alexfogg
- Sourcegraph version: 3.32
- Platform information: Kubernetes
Steps to reproduce:
- Upgrade from 3.31 to 3.32
- Extensions enabled
- See additional customer context below
Expected behavior:
Extensions working as normal.
Actual behavior:
Extensions not working (see below)
Impacted Customer
Feedback surfaced by https://github.com/sourcegraph/accounts/issues/8205
Additional Context from Customer
It looks like as part of the work to speed up extensions loading: https://github.com/sourcegraph/sourcegraph/pull/24632 was done, introducing a new argument for extension fetching, ExtensionIDs
: https://sourcegraph.com/github.com/sourcegraph/sourcegraph@a0241288f74fda9f01a3ece8c[…]/-/blob/cmd/frontend/graphqlbackend/extension_registry.go?L65 largely replacing PrioritizeExtensionIDs
. This works fine for remote fetches but for local listing, it leads to some issues.
Specifically, ExtensionIDs
is used to filter out extensions from the db and is expected to have form publisher/name
(e.g. alex/myextension
) https://sourcegraph.com/github.com/sourcegraph/sourcegraph@083f975a4e57b7559d235d490[…]terprise/cmd/frontend/internal/registry/extensions_db.go?L278, but it's possible that the extensions being fed in have form [registry|host]/publisher/name
(e.g. sourcegraph.company.com/alex/myextension
) (we enable extensions in our global settings using this [registry|host]/publisher/name
pattern, "extensions": { "sourcegraph.company.com/alex/myextension": true, }
), which is how our PrioritizeExtensionIDs
and now ExtensionIDs
are being passed in.
This was handled for PrioritizeExtensionIds
with https://sourcegraph.com/github.com/sourcegraph/sourcegraph@a0241288f74fda9f01a3ece8c[…]rontend/internal/registry/extension_connection_graphql.go?L20 (filterStripLocalExtensionIDs filters to local extension IDs and strips the host prefix.
but it doesn't make too much of a difference since all the PrioritizeExtensionIDs
arg did was sort them after) but not for the new ExtensionIDs
(which does make a big difference since this arg actually is used to filter out extensions whose ids aren't in ExtensionIDs
), so we weren't getting any extensions back (trying to fetch alex/myextension
with ExtensionIDs
: sourcegraph.company.com/alex/myextension).
I think there just needs to be a
if args.ExtensionIDs!= nil {
extids := filterStripLocalExtensionIDs(*args.ExtensionIDs)
args.ExtensionIDs= &extids
}
In the meantime, we've managed to workaround this by adding local extension ids to our global settings to force them to be passed in, i.e.,
"extensions": {
"alex/myextension": true, #only to be fed into ExtensionIDs
"sourcegraph.company.com/alex/myextension": true #actually used for enablement}