Move the cron job to internal package (#1960)

Co-authored-by: Azeem Shaikh <azeems@google.com>
This commit is contained in:
Azeem Shaikh 2022-05-25 15:37:22 -07:00 committed by GitHub
parent 6a21afb410
commit d1714a289a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
78 changed files with 94 additions and 94 deletions

18
.gitignore vendored
View File

@ -2,15 +2,15 @@
scorecard scorecard
gitblobcache gitblobcache
clients/githubrepo/roundtripper/tokens/server/github-auth-server clients/githubrepo/roundtripper/tokens/server/github-auth-server
cron/data/add/add cron/internal/data/add/add
cron/data/validate/validate cron/internal/data/validate/validate
cron/data/update/projects-update cron/internal/data/update/projects-update
cron/controller/controller cron/internal/controller/controller
cron/worker/worker cron/internal/worker/worker
cron/cii/cii-worker cron/internal/cii/cii-worker
cron/shuffle/shuffle cron/internal/shuffle/shuffle
cron/webhook/webhook cron/internal/webhook/webhook
cron/bq/data-transfer cron/internal/bq/data-transfer
# Binaries for programs and plugins. # Binaries for programs and plugins.
*.exe *.exe

View File

@ -74,16 +74,16 @@ check-osv: $(install)
go list -m -f '{{if not (or .Main)}}{{.Path}}@{{.Version}}_{{.Replace}}{{end}}' all \ go list -m -f '{{if not (or .Main)}}{{.Path}}@{{.Version}}_{{.Replace}}{{end}}' all \
| stunning-tribble | stunning-tribble
add-projects: ## Adds new projects to ./cron/data/projects.csv add-projects: ## Adds new projects to ./cron/internal/data/projects.csv
add-projects: ./cron/data/projects.csv | build-add-script add-projects: ./cron/internal/data/projects.csv | build-add-script
# Add new projects to ./cron/data/projects.csv # Add new projects to ./cron/internal/data/projects.csv
./cron/data/add/add ./cron/data/projects.csv ./cron/data/projects.new.csv ./cron/internal/data/add/add ./cron/internal/data/projects.csv ./cron/internal/data/projects.new.csv
mv ./cron/data/projects.new.csv ./cron/data/projects.csv mv ./cron/internal/data/projects.new.csv ./cron/internal/data/projects.csv
validate-projects: ## Validates ./cron/data/projects.csv validate-projects: ## Validates ./cron/internal/data/projects.csv
validate-projects: ./cron/data/projects.csv | build-validate-script validate-projects: ./cron/internal/data/projects.csv | build-validate-script
# Validate ./cron/data/projects.csv # Validate ./cron/internal/data/projects.csv
./cron/data/validate/validate ./cron/data/projects.csv ./cron/internal/data/validate/validate ./cron/internal/data/projects.csv
tree-status: | all-targets-update-dependencies ## Verify tree is clean and all changes are committed tree-status: | all-targets-update-dependencies ## Verify tree is clean and all changes are committed
# Verify the tree is clean and all changes are commited # Verify the tree is clean and all changes are commited
@ -103,11 +103,11 @@ build: ## Build all binaries and images in the repo.
build: $(build-targets) build: $(build-targets)
build-proto: ## Compiles and generates all required protobufs build-proto: ## Compiles and generates all required protobufs
build-proto: cron/data/request.pb.go cron/data/metadata.pb.go build-proto: cron/internal/data/request.pb.go cron/internal/data/metadata.pb.go
cron/data/request.pb.go: cron/data/request.proto | $(PROTOC) cron/internal/data/request.pb.go: cron/internal/data/request.proto | $(PROTOC)
protoc --go_out=../../../ cron/data/request.proto protoc --go_out=../../../ cron/internal/data/request.proto
cron/data/metadata.pb.go: cron/data/metadata.proto | $(PROTOC) cron/internal/data/metadata.pb.go: cron/internal/data/metadata.proto | $(PROTOC)
protoc --go_out=../../../ cron/data/metadata.proto protoc --go_out=../../../ cron/internal/data/metadata.proto
generate-mocks: ## Compiles and generates all mocks using mockgen. generate-mocks: ## Compiles and generates all mocks using mockgen.
generate-mocks: clients/mockclients/repo_client.go clients/mockclients/repo.go clients/mockclients/cii_client.go checks/mockclients/vulnerabilities.go cmd/packagemanager_mockclient.go generate-mocks: clients/mockclients/repo_client.go clients/mockclients/repo.go clients/mockclients/cii_client.go checks/mockclients/vulnerabilities.go cmd/packagemanager_mockclient.go
@ -147,24 +147,24 @@ build-releaser: ## Runs goreleaser on the repo
build-controller: ## Runs go build on the cron PubSub controller build-controller: ## Runs go build on the cron PubSub controller
# Run go build on the cron PubSub controller # Run go build on the cron PubSub controller
cd cron/controller && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o controller cd cron/internal/controller && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o controller
build-worker: ## Runs go build on the cron PubSub worker build-worker: ## Runs go build on the cron PubSub worker
# Run go build on the cron PubSub worker # Run go build on the cron PubSub worker
cd cron/worker && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o worker cd cron/internal/worker && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o worker
build-cii-worker: ## Runs go build on the CII worker build-cii-worker: ## Runs go build on the CII worker
# Run go build on the CII worker # Run go build on the CII worker
cd cron/cii && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o cii-worker cd cron/internal/cii && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o cii-worker
build-shuffler: ## Runs go build on the cron shuffle script build-shuffler: ## Runs go build on the cron shuffle script
# Run go build on the cron shuffle script # Run go build on the cron shuffle script
cd cron/shuffle && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o shuffle cd cron/internal/shuffle && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o shuffle
build-bq-transfer: ## Runs go build on the BQ transfer cron job build-bq-transfer: ## Runs go build on the BQ transfer cron job
build-bq-transfer: ./cron/bq/*.go build-bq-transfer: ./cron/internal/bq/*.go
# Run go build on the Copier cron job # Run go build on the Copier cron job
cd cron/bq && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o data-transfer cd cron/internal/bq && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o data-transfer
build-github-server: ## Runs go build on the GitHub auth server build-github-server: ## Runs go build on the GitHub auth server
build-github-server: ./clients/githubrepo/roundtripper/tokens/* build-github-server: ./clients/githubrepo/roundtripper/tokens/*
@ -174,25 +174,25 @@ build-github-server: ./clients/githubrepo/roundtripper/tokens/*
build-webhook: ## Runs go build on the cron webhook build-webhook: ## Runs go build on the cron webhook
# Run go build on the cron webhook # Run go build on the cron webhook
cd cron/webhook && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o webhook cd cron/internal/webhook && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o webhook
build-add-script: ## Runs go build on the add script build-add-script: ## Runs go build on the add script
build-add-script: cron/data/add/add build-add-script: cron/internal/data/add/add
cron/data/add/add: cron/data/add/*.go cron/data/*.go cron/data/projects.csv cron/internal/data/add/add: cron/internal/data/add/*.go cron/internal/data/*.go cron/internal/data/projects.csv
# Run go build on the add script # Run go build on the add script
cd cron/data/add && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o add cd cron/internal/data/add && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o add
build-validate-script: ## Runs go build on the validate script build-validate-script: ## Runs go build on the validate script
build-validate-script: cron/data/validate/validate build-validate-script: cron/internal/data/validate/validate
cron/data/validate/validate: cron/data/validate/*.go cron/data/*.go cron/data/projects.csv cron/internal/data/validate/validate: cron/internal/data/validate/*.go cron/internal/data/*.go cron/internal/data/projects.csv
# Run go build on the validate script # Run go build on the validate script
cd cron/data/validate && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o validate cd cron/internal/data/validate && CGO_ENABLED=0 go build -trimpath -a -ldflags '$(LDFLAGS)' -o validate
build-update-script: ## Runs go build on the update script build-update-script: ## Runs go build on the update script
build-update-script: cron/data/update/projects-update build-update-script: cron/internal/data/update/projects-update
cron/data/update/projects-update: cron/data/update/*.go cron/data/*.go cron/internal/data/update/projects-update: cron/internal/data/update/*.go cron/internal/data/*.go
# Run go build on the update script # Run go build on the update script
cd cron/data/update && CGO_ENABLED=0 go build -trimpath -a -tags netgo -ldflags '$(LDFLAGS)' -o projects-update cd cron/internal/data/update && CGO_ENABLED=0 go build -trimpath -a -tags netgo -ldflags '$(LDFLAGS)' -o projects-update
ko-targets = scorecard-ko cron-controller-ko cron-worker-ko cron-cii-worker-ko cron-bq-transfer-ko cron-webhook-ko cron-github-server-ko ko-targets = scorecard-ko cron-controller-ko cron-worker-ko cron-cii-worker-ko cron-bq-transfer-ko cron-webhook-ko cron-github-server-ko
.PHONY: ko-build-everything $(ko-targets) .PHONY: ko-build-everything $(ko-targets)
@ -212,7 +212,7 @@ cron-controller-ko:
--push=false \ --push=false \
--sbom=none \ --sbom=none \
--platform=$(PLATFORM)\ --platform=$(PLATFORM)\
--tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/controller --tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/internal/controller
cron-worker-ko: cron-worker-ko:
$(call_create_kocache_path) $(call_create_kocache_path)
KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-batch-worker LDFLAGS="$(LDFLAGS)" \ KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-batch-worker LDFLAGS="$(LDFLAGS)" \
@ -220,7 +220,7 @@ cron-worker-ko:
--push=false \ --push=false \
--sbom=none \ --sbom=none \
--platform=$(PLATFORM)\ --platform=$(PLATFORM)\
--tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/worker --tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/internal/worker
cron-cii-worker-ko: cron-cii-worker-ko:
$(call_create_kocache_path) $(call_create_kocache_path)
KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-cii-worker LDFLAGS="$(LDFLAGS)" \ KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-cii-worker LDFLAGS="$(LDFLAGS)" \
@ -228,7 +228,7 @@ cron-cii-worker-ko:
--push=false \ --push=false \
--sbom=none \ --sbom=none \
--platform=$(PLATFORM)\ --platform=$(PLATFORM)\
--tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/cii --tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/internal/cii
cron-bq-transfer-ko: cron-bq-transfer-ko:
$(call_create_kocache_path) $(call_create_kocache_path)
KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-bq-transfer LDFLAGS="$(LDFLAGS)" \ KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-bq-transfer LDFLAGS="$(LDFLAGS)" \
@ -236,7 +236,7 @@ cron-bq-transfer-ko:
--push=false \ --push=false \
--sbom=none \ --sbom=none \
--platform=$(PLATFORM)\ --platform=$(PLATFORM)\
--tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/bq --tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/internal/bq
cron-webhook-ko: cron-webhook-ko:
$(call_create_kocache_path) $(call_create_kocache_path)
KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-cron-webhook LDFLAGS="$(LDFLAGS)" \ KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-cron-webhook LDFLAGS="$(LDFLAGS)" \
@ -244,7 +244,7 @@ cron-webhook-ko:
--push=false \ --push=false \
--sbom=none \ --sbom=none \
--platform=$(PLATFORM)\ --platform=$(PLATFORM)\
--tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/webhook --tags latest,$(GIT_VERSION),$(GIT_HASH) github.com/ossf/scorecard/v4/cron/internal/webhook
cron-github-server-ko: cron-github-server-ko:
$(call_create_kocache_path) $(call_create_kocache_path)
KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-github-server LDFLAGS="$(LDFLAGS)" \ KO_DATA_DATE_EPOCH=$(SOURCE_DATE_EPOCH) KO_DOCKER_REPO=${KO_PREFIX}/$(IMAGE_NAME)-github-server LDFLAGS="$(LDFLAGS)" \
@ -261,15 +261,15 @@ dockerbuild: $(docker-targets)
scorecard-docker: scorecard-docker:
DOCKER_BUILDKIT=1 docker build . --file Dockerfile --tag $(IMAGE_NAME) DOCKER_BUILDKIT=1 docker build . --file Dockerfile --tag $(IMAGE_NAME)
cron-controller-docker: cron-controller-docker:
DOCKER_BUILDKIT=1 docker build . --file cron/controller/Dockerfile --tag $(IMAGE_NAME)-batch-controller DOCKER_BUILDKIT=1 docker build . --file cron/internal/controller/Dockerfile --tag $(IMAGE_NAME)-batch-controller
cron-worker-docker: cron-worker-docker:
DOCKER_BUILDKIT=1 docker build . --file cron/worker/Dockerfile --tag $(IMAGE_NAME)-batch-worker DOCKER_BUILDKIT=1 docker build . --file cron/internal/worker/Dockerfile --tag $(IMAGE_NAME)-batch-worker
cron-cii-worker-docker: cron-cii-worker-docker:
DOCKER_BUILDKIT=1 docker build . --file cron/cii/Dockerfile --tag $(IMAGE_NAME)-cii-worker DOCKER_BUILDKIT=1 docker build . --file cron/internal/cii/Dockerfile --tag $(IMAGE_NAME)-cii-worker
cron-bq-transfer-docker: cron-bq-transfer-docker:
DOCKER_BUILDKIT=1 docker build . --file cron/bq/Dockerfile --tag $(IMAGE_NAME)-bq-transfer DOCKER_BUILDKIT=1 docker build . --file cron/internal/bq/Dockerfile --tag $(IMAGE_NAME)-bq-transfer
cron-webhook-docker: cron-webhook-docker:
DOCKER_BUILDKIT=1 docker build . --file cron/webhook/Dockerfile --tag ${IMAGE_NAME}-webhook DOCKER_BUILDKIT=1 docker build . --file cron/internal/webhook/Dockerfile --tag ${IMAGE_NAME}-webhook
cron-github-server-docker: cron-github-server-docker:
DOCKER_BUILDKIT=1 docker build . --file clients/githubrepo/roundtripper/tokens/server/Dockerfile --tag ${IMAGE_NAME}-github-server DOCKER_BUILDKIT=1 docker build . --file clients/githubrepo/roundtripper/tokens/server/Dockerfile --tag ${IMAGE_NAME}-github-server
############################################################################### ###############################################################################

View File

@ -18,5 +18,5 @@ steps:
'--build-arg', 'COMMIT_SHA=$COMMIT_SHA', '--build-arg', 'COMMIT_SHA=$COMMIT_SHA',
'-t', 'gcr.io/openssf/scorecard-cii-worker:$COMMIT_SHA', '-t', 'gcr.io/openssf/scorecard-cii-worker:$COMMIT_SHA',
'-t', 'gcr.io/openssf/scorecard-cii-worker:latest', '-t', 'gcr.io/openssf/scorecard-cii-worker:latest',
'-f', 'cron/cii/Dockerfile'] '-f', 'cron/internal/cii/Dockerfile']
images: ['gcr.io/openssf/scorecard-cii-worker'] images: ['gcr.io/openssf/scorecard-cii-worker']

View File

@ -18,5 +18,5 @@ steps:
'--build-arg', 'COMMIT_SHA=$COMMIT_SHA', '--build-arg', 'COMMIT_SHA=$COMMIT_SHA',
'-t', 'gcr.io/openssf/scorecard-batch-controller:$COMMIT_SHA', '-t', 'gcr.io/openssf/scorecard-batch-controller:$COMMIT_SHA',
'-t', 'gcr.io/openssf/scorecard-batch-controller:latest', '-t', 'gcr.io/openssf/scorecard-batch-controller:latest',
'-f', 'cron/controller/Dockerfile'] '-f', 'cron/internal/controller/Dockerfile']
images: ['gcr.io/openssf/scorecard-batch-controller'] images: ['gcr.io/openssf/scorecard-batch-controller']

View File

@ -17,5 +17,5 @@ steps:
args: ['build', '.', args: ['build', '.',
'-t', 'gcr.io/openssf/scorecard-bq-transfer:$COMMIT_SHA', '-t', 'gcr.io/openssf/scorecard-bq-transfer:$COMMIT_SHA',
'-t', 'gcr.io/openssf/scorecard-bq-transfer:latest', '-t', 'gcr.io/openssf/scorecard-bq-transfer:latest',
'-f', 'cron/bq/Dockerfile'] '-f', 'cron/internal/bq/Dockerfile']
images: ['gcr.io/openssf/scorecard-bq-transfer'] images: ['gcr.io/openssf/scorecard-bq-transfer']

View File

@ -17,5 +17,5 @@ steps:
args: ['build', '.', args: ['build', '.',
'-t', 'gcr.io/openssf/scorecard-webhook-releasetest:$COMMIT_SHA', '-t', 'gcr.io/openssf/scorecard-webhook-releasetest:$COMMIT_SHA',
'-t', 'gcr.io/openssf/scorecard-webhook-releasetest:latest', '-t', 'gcr.io/openssf/scorecard-webhook-releasetest:latest',
'-f', 'cron/webhook/Dockerfile'] '-f', 'cron/internal/webhook/Dockerfile']
images: ['gcr.io/openssf/scorecard-webhook-releasetest'] images: ['gcr.io/openssf/scorecard-webhook-releasetest']

View File

@ -20,5 +20,5 @@ steps:
args: ['build', '.', args: ['build', '.',
'-t', 'gcr.io/openssf/scorecard-batch-worker:$COMMIT_SHA', '-t', 'gcr.io/openssf/scorecard-batch-worker:$COMMIT_SHA',
'-t', 'gcr.io/openssf/scorecard-batch-worker:latest', '-t', 'gcr.io/openssf/scorecard-batch-worker:latest',
'-f', 'cron/worker/Dockerfile'] '-f', 'cron/internal/worker/Dockerfile']
images: ['gcr.io/openssf/scorecard-batch-worker'] images: ['gcr.io/openssf/scorecard-batch-worker']

View File

@ -25,5 +25,5 @@ ARG TARGETARCH
RUN CGO_ENABLED=0 make build-bq-transfer RUN CGO_ENABLED=0 make build-bq-transfer
FROM gcr.io/distroless/base:nonroot@sha256:19d927c16ddb5415d5f6f529dbbeb13c460b84b304b97af886998d3fcf18ac81 FROM gcr.io/distroless/base:nonroot@sha256:19d927c16ddb5415d5f6f529dbbeb13c460b84b304b97af886998d3fcf18ac81
COPY --from=transfer /src/cron/bq/data-transfer cron/bq/data-transfer COPY --from=transfer /src/cron/internal/bq/data-transfer cron/internal/bq/data-transfer
ENTRYPOINT ["cron/bq/data-transfer"] ENTRYPOINT ["cron/internal/bq/data-transfer"]

View File

@ -27,8 +27,8 @@ import (
"google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/protojson"
"github.com/ossf/scorecard/v4/cron/config" "github.com/ossf/scorecard/v4/cron/internal/config"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
type shardSummary struct { type shardSummary struct {

View File

@ -25,5 +25,5 @@ ARG TARGETARCH
RUN CGO_ENABLED=0 make build-cii-worker RUN CGO_ENABLED=0 make build-cii-worker
FROM gcr.io/distroless/base:nonroot@sha256:46d4514c17aca7a68559ee03975983339fc548e6d1014e2d7633f9123f2d3c59 FROM gcr.io/distroless/base:nonroot@sha256:46d4514c17aca7a68559ee03975983339fc548e6d1014e2d7633f9123f2d3c59
COPY --from=cii /src/cron/cii/cii-worker cron/cii/cii-worker COPY --from=cii /src/cron/internal/cii/cii-worker cron/internal/cii/cii-worker
ENTRYPOINT ["cron/cii/cii-worker"] ENTRYPOINT ["cron/internal/cii/cii-worker"]

View File

@ -24,8 +24,8 @@ import (
"strings" "strings"
"github.com/ossf/scorecard/v4/clients" "github.com/ossf/scorecard/v4/clients"
"github.com/ossf/scorecard/v4/cron/config" "github.com/ossf/scorecard/v4/cron/internal/config"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
const ciiBaseURL = "https://bestpractices.coreinfrastructure.org/projects.json" const ciiBaseURL = "https://bestpractices.coreinfrastructure.org/projects.json"

View File

@ -23,7 +23,7 @@ FROM base AS shuffle
ARG TARGETOS ARG TARGETOS
ARG TARGETARCH ARG TARGETARCH
RUN CGO_ENABLED=0 make build-shuffler RUN CGO_ENABLED=0 make build-shuffler
RUN ./cron/shuffle/shuffle 2500 cron/data/projects.csv cron/data/projects.release.csv RUN ./cron/internal/shuffle/shuffle 2500 cron/internal/data/projects.csv cron/internal/data/projects.release.csv
FROM base AS controller FROM base AS controller
ARG TARGETOS ARG TARGETOS
@ -31,7 +31,7 @@ ARG TARGETARCH
RUN CGO_ENABLED=0 make build-controller RUN CGO_ENABLED=0 make build-controller
FROM gcr.io/distroless/base:nonroot@sha256:d65ac1a65a4d82a48ebd0a22aea2acdd95d7abeeda245dfee932ec0018c781f4 FROM gcr.io/distroless/base:nonroot@sha256:d65ac1a65a4d82a48ebd0a22aea2acdd95d7abeeda245dfee932ec0018c781f4
COPY ./cron/data/projects*csv cron/data/ COPY ./cron/internal/data/projects*csv cron/data/
COPY --from=shuffle /src/cron/data/projects.release.csv cron/data/projects.release.csv COPY --from=shuffle /src/cron/internal/data/projects.release.csv cron/internal/data/projects.release.csv
COPY --from=controller /src/cron/controller/controller cron/controller/controller COPY --from=controller /src/cron/internal/controller/controller cron/internal/controller/controller
ENTRYPOINT ["cron/controller/controller"] ENTRYPOINT ["cron/internal/controller/controller"]

View File

@ -26,9 +26,9 @@ import (
"sigs.k8s.io/release-utils/version" "sigs.k8s.io/release-utils/version"
"github.com/ossf/scorecard/v4/clients" "github.com/ossf/scorecard/v4/clients"
"github.com/ossf/scorecard/v4/cron/config" "github.com/ossf/scorecard/v4/cron/internal/config"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
"github.com/ossf/scorecard/v4/cron/pubsub" "github.com/ossf/scorecard/v4/cron/internal/pubsub"
) )
var headSHA = clients.HeadSHA var headSHA = clients.HeadSHA

View File

@ -20,7 +20,7 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
// Script to add new project repositories to the projects.csv file: // Script to add new project repositories to the projects.csv file:

View File

@ -22,7 +22,7 @@ import (
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
func lessThanURI(x, y data.RepoFormat) bool { func lessThanURI(x, y data.RepoFormat) bool {

View File

@ -26,7 +26,7 @@ import (
// Needed to link in GCP drivers. // Needed to link in GCP drivers.
_ "gocloud.dev/blob/gcsblob" _ "gocloud.dev/blob/gcsblob"
"github.com/ossf/scorecard/v4/cron/config" "github.com/ossf/scorecard/v4/cron/internal/config"
) )
const ( const (

View File

Can't render this file because it is too large.

View File

@ -30,7 +30,7 @@ import (
"golang.org/x/tools/go/vcs" "golang.org/x/tools/go/vcs"
"github.com/ossf/scorecard/v4/clients/githubrepo" "github.com/ossf/scorecard/v4/clients/githubrepo"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
var ( var (

View File

@ -19,7 +19,7 @@ import (
"bytes" "bytes"
"os" "os"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
// Adds "project=${PROJECT},dependency=true" to the repositories metadata. // Adds "project=${PROJECT},dependency=true" to the repositories metadata.

View File

@ -19,7 +19,7 @@ import (
"log" "log"
"os" "os"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
// Validates data.Iterator used by production PubSub cron job. // Validates data.Iterator used by production PubSub cron job.

View File

@ -24,7 +24,7 @@ import (
"contrib.go.opencensus.io/exporter/stackdriver/monitoredresource/gcp" "contrib.go.opencensus.io/exporter/stackdriver/monitoredresource/gcp"
"go.opencensus.io/stats/view" "go.opencensus.io/stats/view"
"github.com/ossf/scorecard/v4/cron/config" "github.com/ossf/scorecard/v4/cron/internal/config"
) )
var errorUndefinedExporter = errors.New("unsupported exporterType") var errorUndefinedExporter = errors.New("unsupported exporterType")

View File

@ -28,7 +28,7 @@ import (
_ "gocloud.dev/pubsub/gcppubsub" _ "gocloud.dev/pubsub/gcppubsub"
"google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/protojson"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
var errorPublish = errors.New("total errors when publishing") var errorPublish = errors.New("total errors when publishing")

View File

@ -21,7 +21,7 @@ import (
"gocloud.dev/pubsub" "gocloud.dev/pubsub"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
type mockSucceedTopic struct{} type mockSucceedTopic struct{}

View File

@ -21,7 +21,7 @@ import (
"google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/protojson"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
// ErrorInParse indicates there was an error while unmarshalling the protocol buffer message. // ErrorInParse indicates there was an error while unmarshalling the protocol buffer message.

View File

@ -24,7 +24,7 @@ import (
pubsub "cloud.google.com/go/pubsub/apiv1" pubsub "cloud.google.com/go/pubsub/apiv1"
pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1" pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
const ( const (

View File

@ -23,7 +23,7 @@ import (
// Needed to link in GCP drivers. // Needed to link in GCP drivers.
_ "gocloud.dev/pubsub/gcppubsub" _ "gocloud.dev/pubsub/gcppubsub"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
type receiver interface { type receiver interface {

View File

@ -23,7 +23,7 @@ import (
"google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
var repo1 = "repo1" var repo1 = "repo1"

View File

@ -21,7 +21,7 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
func main() { func main() {

View File

@ -25,5 +25,5 @@ ARG TARGETARCH
RUN CGO_ENABLED=0 make build-webhook RUN CGO_ENABLED=0 make build-webhook
FROM gcr.io/distroless/base:nonroot@sha256:d65ac1a65a4d82a48ebd0a22aea2acdd95d7abeeda245dfee932ec0018c781f4 FROM gcr.io/distroless/base:nonroot@sha256:d65ac1a65a4d82a48ebd0a22aea2acdd95d7abeeda245dfee932ec0018c781f4
COPY --from=webhook /src/cron/webhook/webhook cron/webhook/webhook COPY --from=webhook /src/cron/internal/webhook/webhook cron/internal/webhook/webhook
ENTRYPOINT ["cron/webhook/webhook"] ENTRYPOINT ["cron/internal/webhook/webhook"]

View File

@ -26,7 +26,7 @@ import (
"github.com/google/go-containerregistry/pkg/v1/google" "github.com/google/go-containerregistry/pkg/v1/google"
"google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/protojson"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
) )
const stableTag = "stable" const stableTag = "stable"

View File

@ -25,5 +25,5 @@ ARG TARGETARCH
RUN CGO_ENABLED=0 make build-worker RUN CGO_ENABLED=0 make build-worker
FROM gcr.io/distroless/base:nonroot@sha256:d65ac1a65a4d82a48ebd0a22aea2acdd95d7abeeda245dfee932ec0018c781f4 FROM gcr.io/distroless/base:nonroot@sha256:d65ac1a65a4d82a48ebd0a22aea2acdd95d7abeeda245dfee932ec0018c781f4
COPY --from=worker /src/cron/worker/worker cron/worker/worker COPY --from=worker /src/cron/internal/worker/worker cron/internal/worker/worker
ENTRYPOINT ["cron/worker/worker"] ENTRYPOINT ["cron/internal/worker/worker"]

View File

@ -30,11 +30,11 @@ import (
"github.com/ossf/scorecard/v4/clients" "github.com/ossf/scorecard/v4/clients"
"github.com/ossf/scorecard/v4/clients/githubrepo" "github.com/ossf/scorecard/v4/clients/githubrepo"
githubstats "github.com/ossf/scorecard/v4/clients/githubrepo/stats" githubstats "github.com/ossf/scorecard/v4/clients/githubrepo/stats"
"github.com/ossf/scorecard/v4/cron/config" "github.com/ossf/scorecard/v4/cron/internal/config"
"github.com/ossf/scorecard/v4/cron/data" "github.com/ossf/scorecard/v4/cron/internal/data"
format "github.com/ossf/scorecard/v4/cron/format" format "github.com/ossf/scorecard/v4/cron/internal/format"
"github.com/ossf/scorecard/v4/cron/monitoring" "github.com/ossf/scorecard/v4/cron/internal/monitoring"
"github.com/ossf/scorecard/v4/cron/pubsub" "github.com/ossf/scorecard/v4/cron/internal/pubsub"
docs "github.com/ossf/scorecard/v4/docs/checks" docs "github.com/ossf/scorecard/v4/docs/checks"
sce "github.com/ossf/scorecard/v4/errors" sce "github.com/ossf/scorecard/v4/errors"
"github.com/ossf/scorecard/v4/log" "github.com/ossf/scorecard/v4/log"