Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
611e9f8
refactor: replace OrgResolver with LdxSyncService and cache-based app…
nick-y-snyk Jan 23, 2026
299061c
feat: support org-level config from ldx-sync. initial commit
andrewrobinsonhodges-snyk Jan 26, 2026
e9c35f2
refactor: clean up folder_handler tests and remove network mocking
nick-y-snyk Jan 26, 2026
63213f7
Merge branch 'main' into feat/IDE-1636
nick-y-snyk Jan 26, 2026
0a314e7
feat: add logic to categorise config from ldx-sync
andrewrobinsonhodges-snyk Jan 26, 2026
f887a8d
merge: merge upstream branch feat/IDE-1636
andrewrobinsonhodges-snyk Jan 26, 2026
2da341d
feat: send machine-wide config to IDE and process changes from IDE
andrewrobinsonhodges-snyk Jan 26, 2026
e3925dc
fix: machine-wide settings should be persisted in IDE global settings
andrewrobinsonhodges-snyk Jan 26, 2026
893411b
Merge branch 'main' into feat/IDE-1636
nick-y-snyk Jan 27, 2026
d8aff62
refactor: move per-org configuration to be fetched by underlying folder
andrewrobinsonhodges-snyk Jan 27, 2026
48dcf57
refactor: simplify per-folder product enablement checks
andrewrobinsonhodges-snyk Jan 27, 2026
bfc65ae
refactor: make LdxSyncService a complete facade by moving ResolveOrg …
nick-y-snyk Jan 27, 2026
52972e4
refactor: reduce disk access when checking enablement on folders
andrewrobinsonhodges-snyk Jan 27, 2026
d767a7f
Merge branch 'main' into feat/IDE-1636
nick-y-snyk Jan 28, 2026
0f72491
chore: gaf update
nick-y-snyk Jan 28, 2026
b432a7f
test: add comprehensive tests for LdxSyncService with API mocking
nick-y-snyk Jan 28, 2026
ddfae92
Merge branch 'feat/IDE-1636' into feat/IDE-1711_org-specific-config
andrewrobinsonhodges-snyk Jan 28, 2026
8f64446
chore: merge upstream changes, improve logging
andrewrobinsonhodges-snyk Jan 28, 2026
77f947f
feat: update fodlerconfigs for use by ide
andrewrobinsonhodges-snyk Jan 28, 2026
001caaf
feat: html settings page shows per-org settings with overrides
andrewrobinsonhodges-snyk Jan 29, 2026
01cf5fd
test: add coverage for sending config to IDE plugins
andrewrobinsonhodges-snyk Jan 29, 2026
6e05250
chore: bump LS protocol version to 23
andrewrobinsonhodges-snyk Jan 29, 2026
22de3ae
feat: ensure folder updates are triggered on LDX-sync running, add wa…
andrewrobinsonhodges-snyk Jan 29, 2026
0bdd643
refactor: clarify comments
andrewrobinsonhodges-snyk Jan 29, 2026
6a2ba27
refactor: simplify org resolution in ldx-sync folder config
andrewrobinsonhodges-snyk Jan 29, 2026
fb8f17f
Merge branch 'main' into feat/IDE-1711_org-specific-config
andrewrobinsonhodges-snyk Jan 30, 2026
9490f1f
refactor: simplify checks for product enablement
andrewrobinsonhodges-snyk Jan 30, 2026
d61f519
chore: update GAF reference in go.mod
andrewrobinsonhodges-snyk Jan 30, 2026
eff3cfb
fix: remove accidental checkin of vscode config
andrewrobinsonhodges-snyk Jan 30, 2026
d2a783e
refactor: simplify LDX-sync caching mechanism to only store per-org c…
andrewrobinsonhodges-snyk Jan 30, 2026
b5203ef
refactor: clarify use of LDX-Sync configs by renaming types
andrewrobinsonhodges-snyk Jan 30, 2026
902924d
fix: machine-wide ldx-sync config should be persisted to disk
andrewrobinsonhodges-snyk Jan 30, 2026
1d73b35
fix: fix unintentional change to org determination logic
andrewrobinsonhodges-snyk Jan 30, 2026
782bc28
fix: improve test performance by setting a default org, to avoid ldx-…
andrewrobinsonhodges-snyk Feb 2, 2026
4824d15
fix: update test to expect default org being present
andrewrobinsonhodges-snyk Feb 2, 2026
22dd290
fix: tests should use cached org for fodlers instead of making api ca…
andrewrobinsonhodges-snyk Feb 2, 2026
3cae437
fix: improve caching behaviour to reduce disk/network lookups of fold…
andrewrobinsonhodges-snyk Feb 3, 2026
afe9aa1
refactor: simplify configuration caching model for org lookups
andrewrobinsonhodges-snyk Feb 3, 2026
a9b1dd0
fix: product enablement logic should fall back to global config if pe…
andrewrobinsonhodges-snyk Feb 3, 2026
cf9be94
fix: smoke tests should not rely on internal LS feature flag field
andrewrobinsonhodges-snyk Feb 3, 2026
ecb7fe9
fix: tests should not assume order of folders in map
andrewrobinsonhodges-snyk Feb 3, 2026
2aff0a0
fix: fix inconsistencies in default org fallback behaviour
andrewrobinsonhodges-snyk Feb 3, 2026
fa01483
fix: only cache values from ldx-sync
andrewrobinsonhodges-snyk Feb 3, 2026
54ec08e
test: update tests to match caching behaviour
andrewrobinsonhodges-snyk Feb 3, 2026
0e22d2c
test: update tests to match caching behaviour
andrewrobinsonhodges-snyk Feb 3, 2026
c6edb94
chore: tidy up
andrewrobinsonhodges-snyk Feb 3, 2026
bacb652
fix: remove incorrect check in smoke tests - it is valid for config t…
andrewrobinsonhodges-snyk Feb 3, 2026
62916ac
fix: remove incorrect check in smoke tests - it is valid for config t…
andrewrobinsonhodges-snyk Feb 3, 2026
59fdd9d
fix: smoke tests should handle new org determination logic
andrewrobinsonhodges-snyk Feb 4, 2026
9dab111
chore: merge main
andrewrobinsonhodges-snyk Feb 4, 2026
493277e
fix: refactor smoke test ot use new cache structure
andrewrobinsonhodges-snyk Feb 4, 2026
331e72d
fix: NPE in test due to bad merge
andrewrobinsonhodges-snyk Feb 4, 2026
0a30bb1
refactor: use lazy intialization for new caches, to avoid errors on a…
andrewrobinsonhodges-snyk Feb 4, 2026
7a5ad9d
refactor: treat product enablement as separate booleans for consisten…
andrewrobinsonhodges-snyk Feb 4, 2026
cb112b9
refactor: update config html to use new settings format for product e…
andrewrobinsonhodges-snyk Feb 4, 2026
4acd04c
refactor: update config html to use new settings format for product e…
andrewrobinsonhodges-snyk Feb 4, 2026
c6b6801
fix: don't attempt to read from LDX-sync cache if it is empty; avoids…
andrewrobinsonhodges-snyk Feb 4, 2026
e928675
fix: always set an org in GAF for tests
andrewrobinsonhodges-snyk Feb 4, 2026
0e09d30
fix: set auth token before test setup
andrewrobinsonhodges-snyk Feb 4, 2026
5859496
fix: skip org lookup if we have an empty cache
andrewrobinsonhodges-snyk Feb 4, 2026
554c568
fix: remove bad test setup code
andrewrobinsonhodges-snyk Feb 4, 2026
b3e98e1
refactor: test setup code
andrewrobinsonhodges-snyk Feb 4, 2026
ad394fe
fix: cache initialization got lost during code merge
andrewrobinsonhodges-snyk Feb 4, 2026
4635c73
fix: normalize paths when storing folderconfigs
andrewrobinsonhodges-snyk Feb 4, 2026
435f16b
refactor: hide new settings in html by default, for backwards compati…
andrewrobinsonhodges-snyk Feb 4, 2026
2eb45ee
fix: normalize paths in text expectations to handle Windows paths
andrewrobinsonhodges-snyk Feb 4, 2026
3d50f5f
refactor: move FilePath helper methods to types package to allow for …
andrewrobinsonhodges-snyk Feb 4, 2026
4fca367
chore: update copyright, tidy up comments
andrewrobinsonhodges-snyk Feb 5, 2026
4817d67
refactor: rename folderConfig to separate LSP object from storage
andrewrobinsonhodges-snyk Feb 5, 2026
3d25f8c
chore: fix broken references, update test
andrewrobinsonhodges-snyk Feb 5, 2026
a183f2f
refactor: separate stored and transmitted folder configs. add convers…
andrewrobinsonhodges-snyk Feb 5, 2026
eface66
refactor: use lspFolderConfig type for messages to IDEs
andrewrobinsonhodges-snyk Feb 5, 2026
90ded9c
refactor: simplify config struct sent to IDEs
andrewrobinsonhodges-snyk Feb 5, 2026
8402875
feat: add JSON handling to distinguish between null and omitted fields.
andrewrobinsonhodges-snyk Feb 5, 2026
286ec13
feat: send global config notification to IDE when LDX-sync runs
andrewrobinsonhodges-snyk Feb 5, 2026
ee67713
chore: update mocks for testing
andrewrobinsonhodges-snyk Feb 6, 2026
98b55ae
chore: merge main
andrewrobinsonhodges-snyk Feb 6, 2026
7ef7956
test: update tests to use new folderConfig struct. Restore some param…
andrewrobinsonhodges-snyk Feb 6, 2026
a5f1b1b
test: fix test to use new folderconfig struct
andrewrobinsonhodges-snyk Feb 6, 2026
9b67eb9
fix: org migration tests should pre-populate stored config
andrewrobinsonhodges-snyk Feb 9, 2026
05e2d02
fix: race condition in test code
andrewrobinsonhodges-snyk Feb 9, 2026
0fe43c0
refactor: update comments to explain PATCH behavior for config from ides
andrewrobinsonhodges-snyk Feb 9, 2026
ac59954
fix: windows path normalization in tests
andrewrobinsonhodges-snyk Feb 9, 2026
31388a9
refactor: simplify html settings page so that ldx-sync fields are han…
andrewrobinsonhodges-snyk Feb 9, 2026
1e3688d
refactor: simplify config model - only store activateSnykCode, but pa…
andrewrobinsonhodges-snyk Feb 11, 2026
aa3f9ea
fix: make ldx-sync config cache and resolver self-locking
andrewrobinsonhodges-snyk Feb 11, 2026
edb0567
test: add LDX-Sync notification and concurrency tests
nick-y-snyk Feb 11, 2026
41cc724
refactor: don't export ldx sync cache initializer
andrewrobinsonhodges-snyk Feb 11, 2026
3d1fd92
Merge branch 'feat/IDE-1711_org-specific-config' of github.com:snyk/s…
andrewrobinsonhodges-snyk Feb 11, 2026
223e98e
refactor: introduce immutableFolderconfig for read-only operations
andrewrobinsonhodges-snyk Feb 11, 2026
3737a86
fix: oops, forgot to generate mocks
andrewrobinsonhodges-snyk Feb 11, 2026
006800f
fix: ldx_sync smoke tests, adding snyk.configuration checks instead of
nick-y-snyk Feb 12, 2026
339dcec
fix: type
nick-y-snyk Feb 12, 2026
05036ea
refactor: use imcache for ldx-sync config
andrewrobinsonhodges-snyk Feb 12, 2026
9069ac1
Merge branch 'feat/IDE-1711_org-specific-config' of github.com:snyk/s…
andrewrobinsonhodges-snyk Feb 12, 2026
5aa2177
refactor: better varialbe naming and log levels
andrewrobinsonhodges-snyk Feb 12, 2026
9255643
refactor: make boolToString a generic util func
andrewrobinsonhodges-snyk Feb 12, 2026
7b03a4a
refactor: make boolToString a generic util
andrewrobinsonhodges-snyk Feb 13, 2026
69cb982
feat: add extra fields from LDX-sync. note some are not currently use…
andrewrobinsonhodges-snyk Feb 13, 2026
a343ebe
fix: pass context down to LDX sync refresh to avoid doing unnecessary…
andrewrobinsonhodges-snyk Feb 13, 2026
c70d5c1
refactor: move configresolver out of config object and inject with di
andrewrobinsonhodges-snyk Feb 13, 2026
41b6621
refactor: inject configresolver instead of making it a child of config
andrewrobinsonhodges-snyk Feb 13, 2026
a465015
reafactor: remove redundant helper methods
andrewrobinsonhodges-snyk Feb 13, 2026
d2490e9
refactor: remove duplicated helper functions
andrewrobinsonhodges-snyk Feb 13, 2026
e4000c7
feat: track which config fields are enforced by ldx-sym (to allow for…
andrewrobinsonhodges-snyk Feb 13, 2026
dd4610f
fix: tests should check all ldx-sync fields
andrewrobinsonhodges-snyk Feb 13, 2026
5df80cd
fix: test should normalise paths
andrewrobinsonhodges-snyk Feb 13, 2026
0505698
refactor: use gomocks for test instead of custom handler
andrewrobinsonhodges-snyk Feb 13, 2026
0b06021
fix: improvements to settings html
andrewrobinsonhodges-snyk Feb 13, 2026
f33f6c8
refactor: move pointer utility method to util package
andrewrobinsonhodges-snyk Feb 13, 2026
1644a04
fix: path nomralisation and test setup
andrewrobinsonhodges-snyk Feb 13, 2026
bcf5103
chore: merge main
andrewrobinsonhodges-snyk Feb 13, 2026
438db5e
fix: missing refactor in test code
andrewrobinsonhodges-snyk Feb 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ dist: build
env:
- GO111MODULE=on
- CGO_ENABLED=0
- LS_PROTOCOL_VERSION=22
- LS_PROTOCOL_VERSION=23
32 changes: 22 additions & 10 deletions application/codeaction/codeaction.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* © 2023-2025 Snyk Limited
* © 2023-2026 Snyk Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,19 +46,20 @@ type CodeActionsService struct {

// actionsCache holds all the issues that were returns by the GetCodeActions method.
// This is used to resolve the code actions later on in ResolveCodeAction.
actionsCache map[uuid.UUID]cachedAction
c *config.Config
logger zerolog.Logger
fileWatcher dirtyFilesWatcher
notifier noti.Notifier
actionsCache map[uuid.UUID]cachedAction
c *config.Config
logger zerolog.Logger
fileWatcher dirtyFilesWatcher
notifier noti.Notifier
configResolver types.ConfigResolverInterface
}

type cachedAction struct {
issue types.Issue
action types.CodeAction
}

func NewService(c *config.Config, provider snyk.IssueProvider, fileWatcher dirtyFilesWatcher, notifier noti.Notifier, featureFlagService featureflag.Service) *CodeActionsService {
func NewService(c *config.Config, provider snyk.IssueProvider, fileWatcher dirtyFilesWatcher, notifier noti.Notifier, featureFlagService featureflag.Service, configResolver types.ConfigResolverInterface) *CodeActionsService {
return &CodeActionsService{
IssuesProvider: provider,
featureFlagService: featureFlagService,
Expand All @@ -67,6 +68,7 @@ func NewService(c *config.Config, provider snyk.IssueProvider, fileWatcher dirty
logger: c.Logger().With().Str("service", "CodeActionsService").Logger(),
fileWatcher: fileWatcher,
notifier: notifier,
configResolver: configResolver,
}
}

Expand All @@ -87,14 +89,17 @@ func (c *CodeActionsService) GetCodeActions(params types.CodeActionParams) []typ
issues := c.IssuesProvider.IssuesForRange(path, r)
c.logger.Debug().Any("path", path).Any("range", r).Msgf("Found %d issues", len(issues))

codeConsistentIgnoresEnabled := c.featureFlagService.GetFromFolderConfig(folder.Path(), featureflag.SnykCodeConsistentIgnores)
codeConsistentIgnoresEnabled := c.featureFlagService.GetFromStoredFolderConfig(folder.Path(), featureflag.SnykCodeConsistentIgnores)

var filteredIssues []types.Issue
if !codeConsistentIgnoresEnabled {
filteredIssues = issues
} else {
isViewingOpenIssues := c.c.IssueViewOptions().OpenIssues
isViewingIgnoredIssues := c.c.IssueViewOptions().IgnoredIssues
// Issue view options can be set per-folder, so use the folderConfig to fetch the effective value.
folderConfig := c.c.FolderConfig(folder.Path())
issueViewOptions := c.issueViewOptionsForFolder(folderConfig)
isViewingOpenIssues := issueViewOptions.OpenIssues
isViewingIgnoredIssues := issueViewOptions.IgnoredIssues
for _, issue := range issues {
if !isViewingOpenIssues && !issue.GetIsIgnored() {
continue
Expand Down Expand Up @@ -254,3 +259,10 @@ func (c *CodeActionsService) formatQuickFixTitle(originalTitle string, fixable,

return fmt.Sprintf("%s and fix %d issue%s%s", originalTitle, fixable, plural, unfixableSuffix)
}

func (c *CodeActionsService) issueViewOptionsForFolder(folderConfig types.ImmutableFolderConfig) types.IssueViewOptions {
if c.configResolver != nil {
return c.configResolver.IssueViewOptionsForFolder(folderConfig)
}
return c.c.IssueViewOptions()
}
6 changes: 3 additions & 3 deletions application/codeaction/codeaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func Test_GetCodeActions_NoIssues_ReturnsNil(t *testing.T) {
var issues []types.Issue
providerMock := mock_snyk.NewMockIssueProvider(ctrl)
providerMock.EXPECT().IssuesForRange(gomock.Any(), gomock.Any()).Return(issues)
service := codeaction.NewService(c, providerMock, watcher.NewFileWatcher(), notification.NewMockNotifier(), featureflag.NewFakeService())
service := codeaction.NewService(c, providerMock, watcher.NewFileWatcher(), notification.NewMockNotifier(), featureflag.NewFakeService(), nil)
codeActionsParam := types.CodeActionParams{
TextDocument: sglsp.TextDocumentIdentifier{
URI: documentUriExample,
Expand Down Expand Up @@ -280,7 +280,7 @@ func setupService(t *testing.T, c *config.Config) *codeaction.CodeActionsService

providerMock := mock_snyk.NewMockIssueProvider(gomock.NewController(t))
providerMock.EXPECT().IssuesForRange(gomock.Any(), gomock.Any()).Return([]types.Issue{}).AnyTimes()
service := codeaction.NewService(c, providerMock, watcher.NewFileWatcher(), notification.NewMockNotifier(), featureflag.NewFakeService())
service := codeaction.NewService(c, providerMock, watcher.NewFileWatcher(), notification.NewMockNotifier(), featureflag.NewFakeService(), nil)
return service
}

Expand All @@ -298,7 +298,7 @@ func setupWithSingleIssue(t *testing.T, c *config.Config, issue types.Issue) (*c
issues := []types.Issue{issue}
providerMock.EXPECT().IssuesForRange(path, converter.FromRange(r)).Return(issues).AnyTimes()
fileWatcher := watcher.NewFileWatcher()
service := codeaction.NewService(c, providerMock, fileWatcher, notification.NewMockNotifier(), featureflag.NewFakeService())
service := codeaction.NewService(c, providerMock, fileWatcher, notification.NewMockNotifier(), featureflag.NewFakeService(), nil)

codeActionsParam := types.CodeActionParams{
TextDocument: sglsp.TextDocumentIdentifier{
Expand Down
Loading
Loading