Skip to content

Improve the docs for using GCP to clarify the project-ID and fix a broken command. #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 14, 2023

Conversation

calebbrown
Copy link
Contributor

Fixes #289

Signed-off-by: Caleb Brown [email protected]

@pnacht
Copy link

pnacht commented Dec 28, 2022

Could you add some detail on what the expected project-id is? I tried using my own project but still get an error.

$ gcloud auth login --project=pnacht-criticality-scorecard --update-adc
Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?...

Application default credentials (ADC) were updated.

You are now logged in as [pnacht@...].
Your current project is [pnacht-criticality-scorecard].  You can change this setting by running:
  $ gcloud config set project PROJECT_ID

Updates are available for some Google Cloud CLI components.  To install them,
please run:
  $ gcloud components update

$ criticality_score github.com/kubernetes/kubernetes
2022-12-28 10:34:15.057 INFO    Preparing default scorer
2022-12-28 10:34:15.058 ERROR   Failed to create collector      {"error": "init deps.dev source: unable to detect projectID, please refer to docs for DetectProjectID"}
main.main
        /Users/pnacht/go/pkg/mod/github.com/ossf/[email protected]/cmd/criticality_score/main.go:160
runtime.main
        /usr/local/go/src/runtime/proc.go:250

@manunio
Copy link

manunio commented Feb 1, 2023

Could you add some detail on what the expected project-id is? I tried using my own project but still get an error.

$ gcloud auth login --project=pnacht-criticality-scorecard --update-adc
Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?...

Application default credentials (ADC) were updated.

You are now logged in as [pnacht@...].
Your current project is [pnacht-criticality-scorecard].  You can change this setting by running:
  $ gcloud config set project PROJECT_ID

Updates are available for some Google Cloud CLI components.  To install them,
please run:
  $ gcloud components update

$ criticality_score github.com/kubernetes/kubernetes
2022-12-28 10:34:15.057 INFO    Preparing default scorer
2022-12-28 10:34:15.058 ERROR   Failed to create collector      {"error": "init deps.dev source: unable to detect projectID, please refer to docs for DetectProjectID"}
main.main
        /Users/pnacht/go/pkg/mod/github.com/ossf/[email protected]/cmd/criticality_score/main.go:160
runtime.main
        /usr/local/go/src/runtime/proc.go:250

Hi @pnacht did you get any solution for this?
Edit: python version of criticality_score worked for me.

oliverchang
oliverchang previously approved these changes Apr 4, 2023
Copy link
Contributor

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry completely missed this one from earlier during the holidays!

@calebbrown
Copy link
Contributor Author

@oliverchang @pnacht Please take another look.

I set up an empty container to test this from scratch, and have updated the docs to hopefully make it clearer.

Unfortunately there are scenarios where the auto-detect of projectID fails, so it has to be manually specified.

@calebbrown calebbrown requested a review from oliverchang April 13, 2023 23:56
@calebbrown calebbrown merged commit 7841277 into main Apr 14, 2023
@calebbrown calebbrown deleted the docfix branch April 14, 2023 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI seems to require more setup than shown in the documentation
4 participants