Skip to content

Commit

Permalink
Start using official styleguide protos in v1 (#614)
Browse files Browse the repository at this point in the history
* Start using official styleguide protos

* Start using official styleguide protos

* Small fixes for mime_type strings

* Run addlicense

* test fixes
  • Loading branch information
shrutiparabgoogle authored Jun 17, 2022
1 parent 0961ea5 commit 2f9a84a
Show file tree
Hide file tree
Showing 43 changed files with 2,344 additions and 2,153 deletions.
14 changes: 14 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2022 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.

coverage:
precision: 2
round: down
Expand Down
14 changes: 14 additions & 0 deletions .github/.in-solidarity.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2022 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.

rules:
ignore:
- ".github/in-solidarity.yml"
2 changes: 1 addition & 1 deletion cmd/registry/cmd/apply/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestApply(t *testing.T) {
// TODO: These should run as separate subtests to make it clear exactly which artifact types are failing.
// Creation and export should also be separated ideally. The error message should at least make it
// clear whether create or export is failing.
artifacts := []string{"lifecycle", "manifest", "taxonomies"}
artifacts := []string{"lifecycle", "manifest", "taxonomies", "styleguide"}
for _, a := range artifacts {
filename := fmt.Sprintf("%s/artifacts/%s.yaml", sampleDir, a)
cmd := Command()
Expand Down
24 changes: 24 additions & 0 deletions cmd/registry/cmd/apply/testdata/sample/artifacts/styleguide.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apigeeregistry/v1
kind: StyleGuide
metadata:
name: styleguide
data:
displayName: StyleGuide
mimeTypes:
- application/x.openapi+gzip;version=2
guidelines:
- id: refproperties
displayName: Govern Ref Properties
description: This guideline governs properties for ref fields on specs.
rules:
- id: norefsiblings
displayName: No Ref Siblings
description: An object exposing a $ref property cannot be further extended with additional properties.
linter: spectral
linterRulename: no-$ref-siblings
severity: ERROR
docUri: https://meta.stoplight.io/docs/spectral/4dec24461f3af-open-api-rules#no-ref-siblings
state: ACTIVE
linters:
- name: spectral
uri: https://github.com/stoplightio/spectral
4 changes: 3 additions & 1 deletion cmd/registry/cmd/compute/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ package compute

import (
"context"
"fmt"

"github.com/apigee/registry/cmd/registry/conformance"
"github.com/apigee/registry/cmd/registry/core"
"github.com/apigee/registry/cmd/registry/patch"
"github.com/apigee/registry/connection"
"github.com/apigee/registry/log"
"github.com/apigee/registry/rpc"
Expand All @@ -27,7 +29,7 @@ import (
"google.golang.org/protobuf/proto"
)

const styleguideFilter = "mime_type.contains('google.cloud.apigeeregistry.applications.v1alpha1.StyleGuide')"
var styleguideFilter = fmt.Sprintf("mime_type.contains('%s')", patch.MimeTypeForKind("StyleGuide"))

func conformanceCommand() *cobra.Command {
cmd := &cobra.Command{
Expand Down
Loading

0 comments on commit 2f9a84a

Please sign in to comment.