Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions backend/pkg/httpserver/list_aggregated_baseline_status_counts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package httpserver

import (
"context"
"net/http"

"github.com/GoogleChrome/webstatus.dev/lib/gen/openapi/backend"
)

// ListAggregatedBaselineStatusCounts implements backend.StrictServerInterface.
// nolint: revive, ireturn // Name generated from openapi
func (s *Server) ListAggregatedBaselineStatusCounts(
ctx context.Context, request backend.ListAggregatedBaselineStatusCountsRequestObject) (
backend.ListAggregatedBaselineStatusCountsResponseObject, error) {
return backend.ListAggregatedBaselineStatusCounts400JSONResponse{
Code: http.StatusBadRequest,
Message: "TODO",
}, nil
}
10 changes: 10 additions & 0 deletions backend/pkg/httpserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,16 @@ type mockServerInterface struct {
callCount int
}

// ListAggregatedBaselineStatusCounts implements backend.StrictServerInterface.
// nolint: ireturn // WONTFIX - generated method signature
func (m *mockServerInterface) ListAggregatedBaselineStatusCounts(
ctx context.Context, _ backend.ListAggregatedBaselineStatusCountsRequestObject) (
backend.ListAggregatedBaselineStatusCountsResponseObject, error) {
assertUserInCtx(ctx, m.t, m.expectedUserInCtx)
m.callCount++
panic("unimplemented")
}

// CreateSavedSearch implements backend.StrictServerInterface.
// nolint: ireturn // WONTFIX - generated method signature
func (m *mockServerInterface) CreateSavedSearch(ctx context.Context, _ backend.CreateSavedSearchRequestObject) (
Expand Down
67 changes: 67 additions & 0 deletions openapi/backend/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,48 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/BasicErrorModel'
/v1/stats/baseline_status/low_date_feature_counts:
get:
summary: >
Returns the count of features supported that have reached baseline
according to the specified date type (currently only low_date).
operationId: listAggregatedBaselineStatusCounts
parameters:
- $ref: '#/components/parameters/startAtParam'
- $ref: '#/components/parameters/endAtParam'
- $ref: '#/components/parameters/paginationTokenParam'
- $ref: '#/components/parameters/paginationSizeParam'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/BaselineStatusMetricsPage'
'400':
description: Bad Input
content:
application/json:
schema:
$ref: '#/components/schemas/BasicErrorModel'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/BasicErrorModel'
'429':
description: Rate Limit
content:
application/json:
schema:
$ref: '#/components/schemas/BasicErrorModel'
'500':
description: Internal Service Error
content:
application/json:
schema:
$ref: '#/components/schemas/BasicErrorModel'
/v1/users/me/saved-searches:
get:
summary: List user saved searches
Expand Down Expand Up @@ -903,6 +945,31 @@ components:
$ref: '#/components/schemas/BrowserReleaseFeatureMetric'
required:
- data
BaselineStatusMetric:
type: object
properties:
timestamp:
type: string
format: date-time
count:
type: integer
description: Total count of features.
format: int64
required:
# For now, only require timestamp in case the definition
# of the metric needs to change. Similar to WPTRunMetric.
- timestamp
BaselineStatusMetricsPage:
type: object
properties:
metadata:
$ref: '#/components/schemas/PageMetadata'
data:
type: array
items:
$ref: '#/components/schemas/BaselineStatusMetric'
required:
- data
WPTRunMetric:
type: object
properties:
Expand Down