Skip to content

Commit

Permalink
Fix the "v2" behavior to match Go's git + mod functionality. (#563)
Browse files Browse the repository at this point in the history
Signed-off-by: Caleb Brown <[email protected]>
  • Loading branch information
calebbrown authored Mar 17, 2024
1 parent 947e68d commit 7af16f1
Show file tree
Hide file tree
Showing 60 changed files with 171 additions and 103 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ open source project:
## Usage

```shell
$ go install github.com/ossf/criticality_score/cmd/criticality_score@latest
$ go install github.com/ossf/criticality_score/v2/cmd/criticality_score@latest

$ export GITHUB_TOKEN=... # requires a GitHub token to work
$ gcloud auth login --update-adc # optional, add -depsdev-disable to skip
Expand Down
2 changes: 1 addition & 1 deletion cmd/collect_signals/localworker/loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/ossf/scorecard/v4/cron/worker"
"go.uber.org/zap"

"github.com/ossf/criticality_score/internal/iterator"
"github.com/ossf/criticality_score/v2/internal/iterator"
)

// maxAttempts is the maximum number of times a batch will be attempted before
Expand Down
2 changes: 1 addition & 1 deletion cmd/collect_signals/localworker/loop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"gocloud.dev/blob"
_ "gocloud.dev/blob/fileblob"

"github.com/ossf/criticality_score/internal/iterator"
"github.com/ossf/criticality_score/v2/internal/iterator"
)

type testWorker struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/collect_signals/localworker/scorecardcompat.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/ossf/criticality_score/cmd/collect_signals/vcs"
"github.com/ossf/criticality_score/v2/cmd/collect_signals/vcs"
)

var headSHA = clients.HeadSHA
Expand Down
8 changes: 4 additions & 4 deletions cmd/collect_signals/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

"github.com/ossf/criticality_score/cmd/collect_signals/localworker"
"github.com/ossf/criticality_score/cmd/collect_signals/vcs"
"github.com/ossf/criticality_score/internal/collector"
log "github.com/ossf/criticality_score/internal/log"
"github.com/ossf/criticality_score/v2/cmd/collect_signals/localworker"
"github.com/ossf/criticality_score/v2/cmd/collect_signals/vcs"
"github.com/ossf/criticality_score/v2/internal/collector"
log "github.com/ossf/criticality_score/v2/internal/log"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions cmd/collect_signals/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"go.opencensus.io/stats/view"
"go.uber.org/zap"

"github.com/ossf/criticality_score/cmd/collect_signals/vcs"
"github.com/ossf/criticality_score/internal/collector"
"github.com/ossf/criticality_score/internal/scorer"
"github.com/ossf/criticality_score/internal/signalio"
"github.com/ossf/criticality_score/v2/cmd/collect_signals/vcs"
"github.com/ossf/criticality_score/v2/internal/collector"
"github.com/ossf/criticality_score/v2/internal/scorer"
"github.com/ossf/criticality_score/v2/internal/signalio"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/criticality_score/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $ criticality_score \
## Install

```shell
$ go install github.com/ossf/criticality_score/cmd/criticality_score
$ go install github.com/ossf/criticality_score/v2/cmd/criticality_score
```

## Usage
Expand Down
4 changes: 2 additions & 2 deletions cmd/criticality_score/inputiter/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"net/url"
"os"

"github.com/ossf/criticality_score/internal/infile"
"github.com/ossf/criticality_score/internal/iterator"
"github.com/ossf/criticality_score/v2/internal/infile"
"github.com/ossf/criticality_score/v2/internal/iterator"
)

// osErrorWithFilename is an os-specific helper for determining if a particular
Expand Down
2 changes: 1 addition & 1 deletion cmd/criticality_score/inputiter/new_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"slices"
"testing"

"github.com/ossf/criticality_score/cmd/criticality_score/inputiter"
"github.com/ossf/criticality_score/v2/cmd/criticality_score/inputiter"
)

func TestNew_SingleURL(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions cmd/criticality_score/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

"github.com/ossf/criticality_score/cmd/criticality_score/inputiter"
"github.com/ossf/criticality_score/internal/collector"
log "github.com/ossf/criticality_score/internal/log"
"github.com/ossf/criticality_score/internal/outfile"
"github.com/ossf/criticality_score/internal/scorer"
"github.com/ossf/criticality_score/internal/signalio"
"github.com/ossf/criticality_score/internal/workerpool"
"github.com/ossf/criticality_score/v2/cmd/criticality_score/inputiter"
"github.com/ossf/criticality_score/v2/internal/collector"
log "github.com/ossf/criticality_score/v2/internal/log"
"github.com/ossf/criticality_score/v2/internal/outfile"
"github.com/ossf/criticality_score/v2/internal/scorer"
"github.com/ossf/criticality_score/v2/internal/signalio"
"github.com/ossf/criticality_score/v2/internal/workerpool"
)

const defaultLogLevel = zapcore.InfoLevel
Expand Down
2 changes: 1 addition & 1 deletion cmd/csv_transfer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

"github.com/ossf/criticality_score/internal/log"
"github.com/ossf/criticality_score/v2/internal/log"
)

const defaultLogLevel = zapcore.InfoLevel
Expand Down
4 changes: 2 additions & 2 deletions cmd/enumerate_github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $ enumerate_github \
## Install

```shell
$ go install github.com/ossf/criticality_score/cmd/enumerate_github
$ go install github.com/ossf/criticality_score/v2/cmd/enumerate_github
```

## Usage
Expand Down Expand Up @@ -136,4 +136,4 @@ $ go run ./cmd/enumerate_github \
-start=2022-06-14 \
-end=2022-06-21 \
-min-stars=20
```
```
2 changes: 1 addition & 1 deletion cmd/enumerate_github/githubsearch/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/hasura/go-graphql-client"
"go.uber.org/zap"

"github.com/ossf/criticality_score/internal/githubapi/pagination"
"github.com/ossf/criticality_score/v2/internal/githubapi/pagination"
)

// repo is part of the GitHub GraphQL query and includes the fields
Expand Down
16 changes: 8 additions & 8 deletions cmd/enumerate_github/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

"github.com/ossf/criticality_score/cmd/enumerate_github/githubsearch"
"github.com/ossf/criticality_score/cmd/enumerate_github/marker"
"github.com/ossf/criticality_score/cmd/enumerate_github/repowriter"
"github.com/ossf/criticality_score/internal/envflag"
"github.com/ossf/criticality_score/internal/githubapi"
log "github.com/ossf/criticality_score/internal/log"
"github.com/ossf/criticality_score/internal/outfile"
"github.com/ossf/criticality_score/internal/workerpool"
"github.com/ossf/criticality_score/v2/cmd/enumerate_github/githubsearch"
"github.com/ossf/criticality_score/v2/cmd/enumerate_github/marker"
"github.com/ossf/criticality_score/v2/cmd/enumerate_github/repowriter"
"github.com/ossf/criticality_score/v2/internal/envflag"
"github.com/ossf/criticality_score/v2/internal/githubapi"
log "github.com/ossf/criticality_score/v2/internal/log"
"github.com/ossf/criticality_score/v2/internal/outfile"
"github.com/ossf/criticality_score/v2/internal/workerpool"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/enumerate_github/marker/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"testing"

"github.com/ossf/criticality_score/cmd/enumerate_github/marker"
"github.com/ossf/criticality_score/v2/cmd/enumerate_github/marker"
)

func TestTransform(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/enumerate_github/marker/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"
"fmt"

"github.com/ossf/criticality_score/internal/cloudstorage"
"github.com/ossf/criticality_score/v2/internal/cloudstorage"
)

func Write(ctx context.Context, t Type, markerFile, outFile string) (err error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/enumerate_github/marker/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"testing"

"github.com/ossf/criticality_score/cmd/enumerate_github/marker"
"github.com/ossf/criticality_score/v2/cmd/enumerate_github/marker"
)

func TestWrite(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/enumerate_github/repowriter/scorecard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/google/go-cmp/cmp"

"github.com/ossf/criticality_score/cmd/enumerate_github/repowriter"
"github.com/ossf/criticality_score/v2/cmd/enumerate_github/repowriter"
)

func TestScorecardRepoWriter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/enumerate_github/repowriter/text_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/google/go-cmp/cmp"

"github.com/ossf/criticality_score/cmd/enumerate_github/repowriter"
"github.com/ossf/criticality_score/v2/cmd/enumerate_github/repowriter"
)

func TestTextRepoWriter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/enumerate_github/repowriter/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"testing"

"github.com/ossf/criticality_score/cmd/enumerate_github/repowriter"
"github.com/ossf/criticality_score/v2/cmd/enumerate_github/repowriter"
)

func TestTypeString(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/scorer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $ scorer \
## Install

```shell
$ go install github.com/ossf/criticality_score/cmd/scorer
$ go install github.com/ossf/criticality_score/v2/cmd/scorer
```

## Usage
Expand Down Expand Up @@ -168,4 +168,4 @@ https://github.com/georgetomzaridis/aade-publicity-search-js,JavaScript,MIT Lice
https://github.com/mobcode1337/Twitter-Account-Creator,Python,,19,2022-11-22T12:58:49Z,2022-11-23T00:10:02Z,0,0,1,0,0.04,0,0,0,0,0,,0.11128,2022-11-28T02:47:06Z
```

An example for the raw signal data can be found at: https://commondatastorage.googleapis.com/ossf-criticality-score/index.html?prefix=2022.11.28/024706/
An example for the raw signal data can be found at: https://commondatastorage.googleapis.com/ossf-criticality-score/index.html?prefix=2022.11.28/024706/
8 changes: 4 additions & 4 deletions cmd/scorer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

"github.com/ossf/criticality_score/internal/infile"
log "github.com/ossf/criticality_score/internal/log"
"github.com/ossf/criticality_score/internal/outfile"
"github.com/ossf/criticality_score/internal/scorer"
"github.com/ossf/criticality_score/v2/internal/infile"
log "github.com/ossf/criticality_score/v2/internal/log"
"github.com/ossf/criticality_score/v2/internal/outfile"
"github.com/ossf/criticality_score/v2/internal/scorer"
)

const defaultLogLevel = zapcore.InfoLevel
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ossf/criticality_score
module github.com/ossf/criticality_score/v2

go 1.21

Expand Down
Loading

0 comments on commit 7af16f1

Please sign in to comment.