-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add envvar GOOGLE_CHRONICLE_INSTANCE_ID for tests #12536
Conversation
.ci/magician/cmd/check_cassettes.go
Outdated
@@ -16,6 +16,7 @@ var ccEnvironmentVariables = [...]string{ | |||
"GOCACHE", | |||
"GOPATH", | |||
"GOOGLE_BILLING_ACCOUNT", | |||
"GOOGLE_CHRONICLE_INSTANCE_ID", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is backward-compatible. It seems the current change requires all PRs to rebase to include the updates in the cloud build configuration .yml file. Otherwise, the build process might fail due to the missing environment variable GOOGLE_CHRONICLE_INSTANCE_ID
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could be right, but I don't know enough about how this is set up. Could you elaborate a bit? Is there a set of .ci functionality that runs off of main, and needs to be updated as a "step 1"? (also, is any of this documented for me to get clarification on my own?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Among the files modified, .ci/gcb-pr-downstream-generation-and-test.yml
(we usually call it the generate-diff
job) is the only one that runs off the PR branch's head. The previously used .ci/gcb-generate-diffs-new.yml
file has already been removed and replaced with this new configuration, we can safely remove it from this PR. This behavior occurs because the Cloud Build trigger is configured to respond to pull request events, invoking the configuration file from the PR branch.
In contrast, other YAML files are for triggers working directly with the main branch and can immediately adapt to code changes once merged.
For the generate-diff
job, the Magician code should sync at the beginning of execution. Therefore, any updates to the Magician source code take immediate effect for all PRs once the change is merged.
To ensure backward compatibility when introducing a new environment variable, we generally have two options:
-
Split the change in two PRs.
- The first PR updates the configuration yml file
- The second PR updates the Magician source code.
- Allow a soak period after merging the first PR to ensure most PRs already have the updated configuration checked in before merging the second PR.
-
Make the source code backward compatible
- Currently, the Magician checks for existence of all env variables, as seen in this code:
env := make(map[string]string, len(ttvEnvironmentVariables)) for _, ev := range ttvEnvironmentVariables { val, ok := os.LookupEnv(ev) if !ok { return fmt.Errorf("did not provide %s environment variable", ev) } env[ev] = val }
- To add a new env var without breaking existing functionality, we should make an exception for the new variable, ensuring it does not trigger an error if it is missing. This approach allows the change to take effect immediately for PRs rebased off main after the change is merged.
I hope this helps clarify things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be updated now with optional env vars, thanks for the help!
bed3d1f
to
7677564
Compare
7677564
to
9c3df70
Compare
It seems the issue is due to permission issues with the secret value. I've granted access to the relevant service accounts and will retry now. /gcbrun |
Tests analyticsTotal tests: 4370 Click here to see the affected service packages
Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🔴 Tests failed when rerunning REPLAYING mode: Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made. Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
Test failures appear unrelated (same showing in other PRs like #12580) |
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.