Skip to content
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

feat: Default project Id - use GOOGLE_APPLICATION_CREDENTIALS first, then GOOGLE_CLOUD_PROJECT #1421

Merged
merged 1 commit into from
Dec 23, 2020

Conversation

pawelpasterz
Copy link
Contributor

@pawelpasterz pawelpasterz commented Dec 23, 2020

Fixes #1407

Flank will now use GOOGLE_APPLICATION_CREDENTIALS env first, to parse and get project id. (previously the first one was GOOGLE_CLOUD_PROJECT

Test Plan

How do we know the code works?

  1. build flank
  2. remember to use the fat jar to launch test runs java -jar ./test_runner/build/libs/flank.jar
  3. create dummy echo '{"project_id":"any funny project id here"}' >> test.json
  4. export variable export GOOGLE_APPLICATION_CREDENTIALS="$(pwd)/test.json"
  5. export variable export GOOGLE_CLOUD_PROJECT="another project id"
  6. run any flank test run (within the same terminal window)
  7. If you are creative enough you should get 404 (interesting fact: I used ddd project id during local tests and it turned out there is such project, I received 403 instead 😄 ) with a message
    1. 404 -> Flank was unable to find project [id from step 4.]
    2. 403 -> Flank encountered a 403 error when running on project [id from 2.] (from [path to file from 2.])
  8. clear export GOOGLE_APPLICATION_CREDENTIALS=
  9. similar to 7. except project id should be from 5
  10. clear export GOOGLE_CLOUD_PROJECT=
  11. run tests, flank should proceed normally

Checklist

  • Documented
  • Unit tested

@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 2020

Timestamp: 2020-12-23 13:07:33
Buildscan url for ubuntu-workflow run 440291527
https://gradle.com/s/sbgyufh6ama6e

@pawelpasterz pawelpasterz force-pushed the 1407-use-provided-credentials-first branch from ecdea65 to 579162c Compare December 23, 2020 05:38
@pawelpasterz pawelpasterz marked this pull request as ready for review December 23, 2020 05:39
@pawelpasterz
Copy link
Contributor Author

@flank-it

@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 2020

Integration tests succeed, you could see results here

@pawelpasterz pawelpasterz changed the title feature: Default project Id - use GOOGLE_APPLICATION_CREDENTIALS first, then GOOGLE_CLOUD_PROJECT feat: Default project Id - use GOOGLE_APPLICATION_CREDENTIALS first, then GOOGLE_CLOUD_PROJECT Dec 23, 2020
@pawelpasterz pawelpasterz force-pushed the 1407-use-provided-credentials-first branch from 579162c to c35357a Compare December 23, 2020 12:21
@pawelpasterz pawelpasterz force-pushed the 1407-use-provided-credentials-first branch from c35357a to 4f37042 Compare December 23, 2020 13:03
@piotradamczyk5 piotradamczyk5 self-requested a review December 23, 2020 14:32
@mergify mergify bot merged commit 3b4bd90 into master Dec 23, 2020
@mergify mergify bot deleted the 1407-use-provided-credentials-first branch December 23, 2020 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flank doesn't autodetect projectId from JSON file on CI (Buildkite if it matters)
3 participants