Skip to content

refactor(go-website): implement non-datastore dev server for testing - #5843

Open
michaelkedar wants to merge 2 commits into
auth-shmauthfrom
web-emu
Open

refactor(go-website): implement non-datastore dev server for testing#5843
michaelkedar wants to merge 2 commits into
auth-shmauthfrom
web-emu

Conversation

@michaelkedar

Copy link
Copy Markdown
Member

This serves the same function as run-website-emulator, but doing it with implementations of the XyzStore interfaces to read and serve vulnerability JSON files from disk.

This way, we can test the website without needed to spin up the datastore (and gcs) emulator, and without having to populate every datastore tables.

The vuln json files (and metadata yaml files) should be able to be hot-loaded, which should make testing easier.

The code assumes that aliases, upstream, related are all fully computed in the vulnerability JSON - it does not the the transitive alias/upstream calculations.


Stack created with GitHub Stacks CLIGive Feedback 💬

@michaelkedar michaelkedar changed the title refactor(go-webiste): implement non-datastore dev server for testing refactor(go-website): implement non-datastore dev server for testing Aug 18, 2026
@michaelkedar
michaelkedar force-pushed the web-emu branch 2 times, most recently from 7bcafe9 to 5197390 Compare August 24, 2026 05:53
@michaelkedar
michaelkedar force-pushed the web-emu branch 2 times, most recently from 3f0ff83 to 5197390 Compare August 25, 2026 02:03
continue
}

vuln, _, err := readRecordFromFile(filepath.Join(ds.dataDir, entry.Name()))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this errors, can we log an error?

pageSize = 16
}

// Cursor and legacy pagination

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm? why do we need legacy pagination here. Is this just the best way to paginate locally?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so please update the comment explaining why.

// models.VulnerabilitySearchStore Implementation
// =========================================================================

func (ds *DevStore) Search(_ context.Context, query models.VulnerabilitySearchQuery) (*models.VulnerabilitySearchResult, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I can tell this doesn't search for repos names (this is something datastore indexes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants