Skip to content

Commit

Permalink
chore: add exception or non service lib (#7866)
Browse files Browse the repository at this point in the history
This library does not contain services so it should not have a version file. We should find a better way to handle such cases in future if there are more of these.
  • Loading branch information
codyoss committed May 2, 2023
1 parent 1829706 commit e5c3f7a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-go:latest
digest: sha256:8b4f6b8ecbd7fe80feb5c4449c0bca2abc6d2ecca0999120da23c4b1c90ca81d
digest: sha256:7f4378b2797923822b452565b346173e306e2587a75f0662437eaba12afd344f
2 changes: 1 addition & 1 deletion internal/postprocessor/main.go
Expand Up @@ -250,7 +250,7 @@ func (p *postProcessor) generateModule(modPath, importPath string) error {
func (p *postProcessor) generateVersionFile(moduleName, path string) error {
// These directories are not modules on purpose, don't generate a version
// file for them.
if strings.Contains(path, "debugger/apiv2") {
if strings.Contains(path, "debugger/apiv2") || strings.Contains(path, "orgpolicy/apiv1") {
return nil
}
pathSegments := strings.Split(filepath.Dir(path), "/")
Expand Down
5 changes: 2 additions & 3 deletions internal/postprocessor/main_test.go
Expand Up @@ -16,7 +16,6 @@ package main

import (
"flag"
"io/ioutil"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -143,13 +142,13 @@ func TestUpdateSnippetsMetadata(t *testing.T) {

// Assert result and restore testdata
f := filepath.FromSlash("testdata/internal/generated/snippets/video/stitcher/apiv1/snippet_metadata.google.cloud.video.stitcher.v1.json")
read, err := ioutil.ReadFile(f)
read, err := os.ReadFile(f)
if err != nil {
t.Fatal(err)
}
if strings.Contains(string(read), "3.45.6") {
s := strings.Replace(string(read), "3.45.6", "$VERSION", 1)
err = ioutil.WriteFile(f, []byte(s), 0)
err = os.WriteFile(f, []byte(s), 0)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit e5c3f7a

Please sign in to comment.