Skip to content

feat: add Branches query type for listing repository branches#767

Open
sebagarayco wants to merge 4 commits into
grafana:mainfrom
sebagarayco:feat/branches-query-type
Open

feat: add Branches query type for listing repository branches#767
sebagarayco wants to merge 4 commits into
grafana:mainfrom
sebagarayco:feat/branches-query-type

Conversation

@sebagarayco

@sebagarayco sebagarayco commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Implementation

Backend (Go):

  • pkg/models/branches.goListBranchesOptions with owner, repository, and query filter
  • pkg/github/branches.go — GraphQL query against refs(refPrefix: "refs/heads/") with pagination, mirrors the existing Tags implementation
  • pkg/github/branches_handler.go + datasource.go + query_handler.go — handler wired into the query mux

Frontend (TypeScript/React):

  • src/views/QueryEditorBranches.tsx — editor with an optional Filter input (placeholder: release/)
  • src/types/query.ts / src/constants.tsBranchesOptions type and 'Branches' registered in the query type list

Test Plan

  • Go unit test passes: go test ./pkg/github/... -run TestListBranches
  • All Go tests pass: go test ./...
  • All frontend tests pass: npm test
  • In Grafana: create a Query variable using the GitHub datasource, select Branches, set owner/repo — branch names appear as variable options
  • Enter release/ in the Filter field — results narrow to matching branches only

@sebagarayco sebagarayco requested a review from a team as a code owner June 11, 2026 15:43
@cla-assistant

cla-assistant Bot commented Jun 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sebagarayco

Copy link
Copy Markdown
Author

Hi @alyssajoyner ! any chance to get this reviewed?
Thanks!

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