-
Notifications
You must be signed in to change notification settings - Fork 892
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
VertexAI: update testing to clone mock responses from shared repo #8333
Conversation
|
Changeset File Check ✅
|
Size Report 1Affected ProductsNo changes between base commit (e7260e2) and merge commit (4f1565a).Test Logs |
Size Analysis Report 1Affected ProductsNo changes between base commit (e7260e2) and merge commit (4f1565a).Test Logs |
d0d8de6
to
033f089
Compare
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.
Nice!
We talked about this earlier, but I just want to confirm: When a change to the expected responses are made, those changes will stay in a separate branch until the changes in the backend go live?
So, the process would be:
- Breaking changes to the response format are proposed/staged, and the new responses are checked into a branch (e.g.
staging
) in the golden files repo. - When we get around to fixing how we handle the new responses, we would add
git checkout staging
to thetestsetup
step to test against the new version of the responses. - When the changes to the responses go live,
staging
is merged intomaster
, and we make another PR, removinggit checkout staging
fromtestsetup
.
If this is the case, or there is another process, is that documented somewhere?
@dlarocque That's just an idea I had, it's not documented anywhere. That process is a bit cumbersome, but I don't think it should be an issue if breaking changes don't come too often. Keep in mind that non-breaking changes can be merged directly to @hsubox76 @andrewheard @rlazo @davidmotson Please share any thoughts. I can document this in the golden files repo when everyone agrees on a solution 🤠 |
Hey Daniel, would this process work for you?
The main advantage of this over the previous one is that moving things around are done in only one repo (platform) rather than 2 (platform & golden files). This makes maintainance of the golden files easier as adding new tests is a single step process. WDYT? |
Agreed!
Oh I didn't see this- nice! |
@rlazo That sounds good to me! Would the breaking changes only be checked into main once they go live in the backend? |
Ideally they would go live asap, because we can then use the tests to
develop the code earlier
…On Thu, Jun 27, 2024, 11:57 a.m. Daniel La Rocque ***@***.***> wrote:
Hey Daniel, would this process work for you?
1. Breaking changes to the response are checked into the main branch
of the golden files repo.
2. This will, potentially, break your code. Then you'll keep having
failures until the code is fixed.
2.1 If you need the code to pass tests *now*, because you are working
on something else, you can change your code to checkout the commit before
the breaking change.
2.2 Once your code is fixed, you can start checking out main HEAD again
That sounds good to me! Would the breaking changes only be checked into
main once they go live in the backend?
—
Reply to this email directly, view it on GitHub
<#8333 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACZ7QSHFAXW7OWVTSDI3WLZJQY7JAVCNFSM6AAAAABJYZPM7KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJVGA4DSNBQGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This sounds reasonable to me as well on the Swift side. I think we'll just need to make sure it's well documented in the workflows / scripts so the rest of our team members can easily spot the issue and temporarily work around it (or know to ignore CI failures). If breakages become too frequent, one other possible process I can think of:
cc: @paulb777 in case you have ideas or opinions on processes. |
I do feel a bit uneasy about CI being guaranteed to go red any time there is a breaking change to the test responses, particularly on branches/PRs that don't make changes related to vertex, where the owner of the branch isn't aware of any of this. I suppose we could work on a fix before the breaking changes are merged to main by modifying our test scripts to checkout the commit with the breaking changes, but then if a branch isn't rebased on top of the fix its CI will still go red anyway. The only solution I can think of to this problem right now is checking out individual commits, but then this introduces some overhead because we'd have to update that commit every time a change is made to the golden files, which defeats a part of their purpose. |
Do JS run all the tests for all the products for each PR? |
Yes, we need to document this so it's clear what to do when these errors are found. And as you said, these particular breaking changes should be rare, as they not only break SDKs, but anybody using the REST API directly. |
Yeah, we have a workflow that runs all the tests. From this PR: https://github.com/firebase/firebase-js-sdk/actions/runs/9688342328/job/26735897472?pr=8333#step:8:1 |
Just for clarification, that isn't a required check (it's "Test All Packages" in the checks below). Contributors can still merge their PRs if it fails. It does make an alarming red X that makes contributors nervous to merge, though, and they usually double check with the core team, and we have to reassure them that it isn't related to their change, so that's a bit of friction. I don't know if this is overengineering, but can we make the workflow smart, so that we can specify a commit/branch name to clone in the PR somewhere with like a label, or some text in the PR title in special brackets of some kind, and the workflow can put that in an env variable or something and the git clone step will clone from that commit/branch if it finds that string? And if it doesn't find any string like that, then it clones from main like normal? Then if you want the CI to use "staging" or "an old commit" or whatever you just put [[[staging]]] or [[[sagd43]] or whatever in the PR title or somewhere Github workflows can read easily. |
Here's a proposal: The golden test repository will tag all commits in a semver-ish manner
This way you know that the contents in the commit tagged v2.2 and v2.6 are compatible and will not break your tests. Furthermore, you can "pin" your repo to a major version, but get updates for the minor versions. For example major version
this will return the latest tag in the This will help keep the maintenance of the golden file repo low, while enabling platform teams to use a known "good" version. |
This removes mock responses from this repo and updates the test setup process to clone them from the new shared repo.