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

(feat): add universal "repo:has.meta" search filter syntax#52150

Merged
erzhtor merged 7 commits into
mainfrom
erzhtor/rename-repo-meta-search-syntax
May 19, 2023
Merged

(feat): add universal "repo:has.meta" search filter syntax#52150
erzhtor merged 7 commits into
mainfrom
erzhtor/rename-repo-meta-search-syntax

Conversation

@erzhtor

@erzhtor erzhtor commented May 18, 2023

Copy link
Copy Markdown
Contributor

Part of https://github.com/sourcegraph/pr-faqs/issues/96.

This PR:

  • makes universal has.meta(key:value) search filter. It works for all previous use-cases:
    • repo:has(key:value) -> repo:has.meta(key:value)
    • repo:has.tag(key) -> repo:has.meta(key:)
    • repo:has.key(key) -> repo:has.meta(key)
  • marks repo:has(), repo:has.key() and repo:has.tag() as deprecated

Test plan

  • sg start
  • Enable repository-metadata feature flag
  • Search using new repo:has.meta filter

Demo

Screen.Recording.2023-05-18.at.18.56.59.mov

@erzhtor erzhtor requested review from a team, camdencheek, rrhyne and toolmantim May 18, 2023 12:59
@erzhtor erzhtor self-assigned this May 18, 2023
@cla-bot cla-bot Bot added the cla-signed label May 18, 2023
@sourcegraph-bot

sourcegraph-bot commented May 18, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 0f08208...3a7a761.

Notify File(s)
@camdencheek internal/search/query/predicate.go
internal/search/query/predicate_test.go
internal/search/query/types.go
internal/search/searchcontexts/search_contexts.go
@fkling client/branded/src/search-ui/components/RepoMetadata.tsx
client/shared/src/search/query/completion.test.ts
client/shared/src/search/query/completion.test.ts
client/shared/src/search/query/decoratedToken.ts
client/shared/src/search/query/decoratedToken.ts
client/shared/src/search/query/hover.test.ts
client/shared/src/search/query/hover.test.ts
client/shared/src/search/query/hover.ts
client/shared/src/search/query/hover.ts
client/shared/src/search/query/predicates.test.ts
client/shared/src/search/query/predicates.test.ts
client/shared/src/search/query/predicates.ts
client/shared/src/search/query/predicates.ts
@jtibshirani internal/search/query/predicate.go
internal/search/query/predicate_test.go
internal/search/query/types.go
internal/search/searchcontexts/search_contexts.go
@keegancsmith internal/search/query/predicate.go
internal/search/query/predicate_test.go
internal/search/query/types.go
internal/search/searchcontexts/search_contexts.go
@limitedmage client/branded/src/search-ui/components/RepoMetadata.tsx
@sourcegraph/delivery doc/admin/repo/metadata.md

@sourcegraph-buildkite

sourcegraph-buildkite commented May 18, 2023

Copy link
Copy Markdown
Collaborator

Bundle size report 📦

Initial size Total size Async size Modules
0.03% (+0.78 kb) 0.01% (+1.69 kb) 0.01% (+0.92 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits 3a7a761 and 841e5c6 or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@sourcegraph-bot

sourcegraph-bot commented May 18, 2023

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@toolmantim toolmantim left a comment

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.

👍🏼 on the new API at a glance (someone else would need to review the code)

@sashaostrikov sashaostrikov left a comment

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.

LGTM! :shipit:

Comment thread internal/search/query/predicate.go Outdated
@erzhtor erzhtor removed the request for review from rrhyne May 18, 2023 14:27
@erzhtor erzhtor assigned ryphil and unassigned ryphil May 18, 2023
@erzhtor erzhtor requested a review from ryphil May 18, 2023 14:28
erzhtor added 2 commits May 18, 2023 23:31
…key:)" filter

(chore): remove "has.meta.key(), has.meta.tag()" filters in favor of "has.meta()"
@erzhtor erzhtor force-pushed the erzhtor/rename-repo-meta-search-syntax branch from 1202d5b to 4a23a82 Compare May 18, 2023 18:08
@erzhtor erzhtor force-pushed the erzhtor/rename-repo-meta-search-syntax branch from 4a23a82 to bf9144e Compare May 18, 2023 18:10
@erzhtor erzhtor requested a review from camdencheek May 18, 2023 18:11
@erzhtor erzhtor changed the title (feat): rename repo meta search syntax (feat): add universal "repo:has.meta" search filter syntax May 18, 2023
@erzhtor erzhtor merged commit 5e10635 into main May 19, 2023
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.

7 participants