Skip to content

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

Merged
michaelkedar merged 3 commits into
auth-shmauthfrom
web-emu
Sep 1, 2026
Merged

refactor(go-website): implement non-datastore dev server for testing#5843
michaelkedar merged 3 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
Comment thread go/cmd/website-devserver/store.go
Comment thread go/cmd/website-devserver/store.go Outdated
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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We do the new pagination first, the legacy pagination is just 1 line of code which we might as well add for feature parity.
Added a small comment.

// 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)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added simple matching to repo names.
Really, this search matching is a database implementation detail, and will probably be done differently again with postgres, so I'm not too concerned on 1-to-1 matching the behaviour.

@michaelkedar
michaelkedar merged commit b31c39c into master Sep 1, 2026
25 of 26 checks passed
@michaelkedar
michaelkedar deleted the web-emu branch September 1, 2026 06:31
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