Browser extension: disable inline extensions firefox (#57881)

This disables the bundling of code intel extensions with the firefox browser extension. The bundled files are minified, and I failed to run the build steps for the extensions locally (they're pretty out of date), so I can't really test the changes needed to build a non-minified version.

For now, rather than spending more time on extensions that live in a hazy state of support, this just removes the extensions from the firefox addon so we don't get removed from the store.
This commit is contained in:
Camden Cheek 2023-10-25 19:43:45 -05:00 committed by GitHub
parent 33aec6bd0f
commit 55fdf1b105
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 33 additions and 17 deletions

View File

@ -227,7 +227,14 @@ const buildForBrowser = curry((browser: Browser, environment: BuildEnvironment):
writeSchema(buildDirectory)
copyExtensionAssets(buildDirectory)
copyInlineExtensions(buildDirectory)
// TODO(@camdencheek): figure out whether we actually want to continue
// shipping the inline extensions with the browser extensions. For now,
// skip them for the firefox extension because they are being detected
// as non-human-readable assets, and will cause removal from the addon store.
if (browser !== 'firefox') {
copyInlineExtensions(buildDirectory)
}
// Create a bundle by zipping the web extension directory.
const browserBundleZip = BROWSER_BUNDLE_ZIPS[browser]

View File

@ -55,7 +55,7 @@ describe('GitLab', () => {
}),
ResolveRepoName: () => ({
repository: {
name: 'gitlab.com/sourcegraph/jsonrpc2',
name: 'gitlab.com/SourcegraphCody/jsonrpc2',
},
}),
ResolveRev: () => ({
@ -115,9 +115,10 @@ describe('GitLab', () => {
}
}
const repoName = 'gitlab.com/sourcegraph/jsonrpc2'
const repoName = 'gitlab.com/SourcegraphCody/jsonrpc2'
const url = 'https://gitlab.com/sourcegraph/jsonrpc2/blob/4fb7cd90793ee6ab445f466b900e6bffb9b63d78/call_opt.go'
const url =
'https://gitlab.com/SourcegraphCody/jsonrpc2/blob/4fb7cd90793ee6ab445f466b900e6bffb9b63d78/call_opt.go'
await driver.page.goto(url)
await driver.page.waitForSelector('[data-testid="code-view-toolbar"] [data-testid="open-on-sourcegraph"]', {
@ -179,7 +180,7 @@ describe('GitLab', () => {
})
await driver.page.goto(
'https://gitlab.com/sourcegraph/jsonrpc2/blob/4fb7cd90793ee6ab445f466b900e6bffb9b63d78/call_opt.go'
'https://gitlab.com/SourcegraphCody/jsonrpc2/blob/4fb7cd90793ee6ab445f466b900e6bffb9b63d78/call_opt.go'
)
await driver.page.waitForSelector('[data-testid="code-view-toolbar"] [data-testid="open-on-sourcegraph"]')

View File

@ -23,7 +23,7 @@ describe('gitlab/codeHost', () => {
beforeAll(async () => {
document.documentElement.innerHTML = await readFile(__dirname + '/__fixtures__/merge-request.html', 'utf-8')
jsdom.reconfigure({ url: 'https://gitlab.com/sourcegraph/jsonrpc2/merge_requests/1/diffs' })
jsdom.reconfigure({ url: 'https://gitlab.com/SourcegraphCody/jsonrpc2/merge_requests/1/diffs' })
globalThis.gon = { gitlab_url: 'https://gitlab.com' }
})
@ -107,7 +107,7 @@ describe('gitlab/codeHost', () => {
)
})
it('returns an URL to the file on the same merge request if possible', () => {
const rawRepoName = 'gitlab.com/sourcegraph/jsonrpc2'
const rawRepoName = 'gitlab.com/SourcegraphCody/jsonrpc2'
// Update the resolved Sourcegraph repo name value
repoNameOnSourcegraph.next(rawRepoName)
@ -127,7 +127,7 @@ describe('gitlab/codeHost', () => {
{ part: 'head' }
)
).toBe(
'https://gitlab.com/sourcegraph/jsonrpc2/merge_requests/1/diffs#9e1d3828a925c1eca74b74c20b58a9138f886d29_3_5'
'https://gitlab.com/SourcegraphCody/jsonrpc2/merge_requests/1/diffs#9e1d3828a925c1eca74b74c20b58a9138f886d29_3_5'
)
})
})

View File

@ -57,7 +57,7 @@ export const getGitlabRepoURL = (): string => {
if (!projectLink) {
throw new Error('Unable to determine project name')
}
return projectLink.href // e.g. 'https://gitlab.com/sourcegraph/jsonrpc2'
return projectLink.href // e.g. 'https://gitlab.com/SourcegraphCody/jsonrpc2'
}
const parseFullProjectName = (fullProjectName: string): { owner: string; projectName: string } => {
@ -75,7 +75,7 @@ const parseGitLabRepoURL = (): { hostname: string; projectFullName: string; owne
}
/**
* Subject to store repo name on the Sourcegraph instance (e.g. 'gitlab.com/sourcegraph/jsonrpc2').
* Subject to store repo name on the Sourcegraph instance (e.g. 'gitlab.com/SourcegraphCody/jsonrpc2').
* It may be different from the repo name on the code host because of the name transformations applied
* (see {@link https://docs.sourcegraph.com/admin/external_service/gitlab#nameTransformations}).
* Set in `gitlabCodeHost.prepareCodeHost` method.

View File

@ -178,7 +178,7 @@ func GeneratePipeline(c Config) (*bk.Pipeline, error) {
wait,
addVsceReleaseSteps)
case runtype.BextNightly:
case runtype.BextNightly, runtype.BextManualNightly:
// If this is a browser extension nightly build, run the browser-extension tests and
// e2e tests.
ops = operations.NewSet(

View File

@ -18,12 +18,13 @@ const (
// Nightly builds - must be first because they take precedence
ReleaseNightly // release branch nightly healthcheck builds
BextNightly // browser extension nightly build
VsceNightly // vs code extension nightly build
AppRelease // app release build
AppInsiders // app insiders build
WolfiBaseRebuild // wolfi base image build
ReleaseNightly // release branch nightly healthcheck builds
BextNightly // browser extension nightly build
BextManualNightly // browser extension nightly build, triggered with a branch pattern
VsceNightly // vs code extension nightly build
AppRelease // app release build
AppInsiders // app insiders build
WolfiBaseRebuild // wolfi base image build
// Release branches
@ -98,6 +99,10 @@ func (t RunType) Matcher() *RunTypeMatcher {
"BEXT_NIGHTLY": "true",
},
}
case BextManualNightly:
return &RunTypeMatcher{
Branch: "bext-nightly/",
}
case VsceNightly:
return &RunTypeMatcher{
EnvIncludes: map[string]string{
@ -197,6 +202,8 @@ func (t RunType) String() string {
return "Release branch nightly healthcheck build"
case BextNightly:
return "Browser extension nightly release build"
case BextManualNightly:
return "Manually triggered browser extension nightly release build"
case VsceNightly:
return "VS Code extension nightly release build"
case WolfiBaseRebuild:

View File

@ -270,6 +270,7 @@ This command is useful when:
Supported run types when providing an argument for 'sg ci build [runtype]':
* _manually_triggered_external - Manually Triggered External Build
* bext-nightly - Manually triggered browser extension nightly release build
* main-dry-run - Main dry run
* docker-images-patch - Patch image
* docker-images-patch-notest - Patch image without testing