Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Revert "cody: replace access-control feature flag with RBAC (#58831)"#59540

Merged
burmudar merged 1 commit into
mainfrom
wb/revert-codycontext-rbac
Jan 12, 2024
Merged

Revert "cody: replace access-control feature flag with RBAC (#58831)"#59540
burmudar merged 1 commit into
mainfrom
wb/revert-codycontext-rbac

Conversation

@burmudar

Copy link
Copy Markdown
Contributor

This reverts commit cf59539.

Two failures:

  • internal/codycontext/context.go isCodyEnabled is a missing an argument
  • After fixing the above the tests fails
FAIL: TestContextResolver (1.78s)
    dbtest.go:150: testdb: postgres://postgres:postgres@127.0.0.1:5432/sourcegraph-test-12065421488212788711?sslmode=disable&timezone=UTC
    core.go:57: WARN TestContextResolver database/repos.go:531 failed to parse service type {"r.ExternalRepo.ServiceType": ""}
    core.go:57: WARN TestContextResolver database/repos.go:531 failed to parse service type {"r.ExternalRepo.ServiceType": ""}
    context_test.go:174:
        	Error Trace:	cmd/frontend/internal/context/resolvers/context_test.go:174
        	Error:      	Received unexpected error:
        	            	cody is not enabled for current user
        	            	(1) attached stack trace
        	            	  -- stack trace:
        	            	  | github.com/sourcegraph/sourcegraph/internal/codycontext.(*CodyContextClient).GetCodyContext
        	            	  | 	internal/codycontext/context.go:116
        	            	  | github.com/sourcegraph/sourcegraph/cmd/frontend/internal/context/resolvers.(*Resolver).GetCodyContext
        	            	  | 	cmd/frontend/internal/context/resolvers/context.go:53
        	            	  | github.com/sourcegraph/sourcegraph/cmd/frontend/internal/context/resolvers.TestContextResolver
        	            	  | 	cmd/frontend/internal/context/resolvers/context_test.go:168
        	            	  | testing.tRunner
        	            	  | 	GOROOT/src/testing/testing.go:1595
        	            	  | runtime.goexit
        	            	  | 	src/runtime/asm_amd64.s:1650
        	            	Wraps: (2) cody is not enabled for current user
        	            	Error types: (1) *withstack.withStack (2) *errutil.leafError
        	Test:       	TestContextResolver
FAIL

Test plan

CI + this is a revert

@burmudar burmudar requested review from a team, chwarwick and emidoots January 12, 2024 08:59
@cla-bot cla-bot Bot added the cla-signed label Jan 12, 2024
@burmudar burmudar self-assigned this Jan 12, 2024
@burmudar burmudar enabled auto-merge (squash) January 12, 2024 09:04
@sourcegraph-bot

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@burmudar burmudar merged commit 13923a7 into main Jan 12, 2024
@burmudar burmudar deleted the wb/revert-codycontext-rbac branch January 12, 2024 09:08
emidoots pushed a commit that referenced this pull request Jan 17, 2024
emidoots pushed a commit that referenced this pull request Jan 17, 2024
* Revert "Revert "cody: replace access-control feature flag with RBAC (#58831)" (#59540)"

This reverts commit 13923a7.

* context/resolvers: fix test by correctly mocking user role with Cody access

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>

---------

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants