-
Notifications
You must be signed in to change notification settings - Fork 25
Fix Compute Engine instance group manager monitoring #2025
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
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8f4ce0f
fix: remove invalid G101 linter name from nolint directives
jordanstephens e2fb500
log which services we are waiting for
jordanstephens bc07c3c
fix(gcp): correct CE instance group label parsing and query filters
jordanstephens 94c9862
fix(gcp): look up CE instance group manager labels from live resource
jordanstephens 3dcfd37
fix(gcp): drop label filters from CE instance group manager query
jordanstephens e287817
Update Nix vendorHash to sha256-DxRBE7mugWJ2NqBiIDNazg/mb+zjZkgNjpTDJ…
github-actions[bot] 49bb101
Apply suggestions from code review
jordanstephens c60ff2d
test(gcp): add tests for CE instance group manager monitoring fixes
jordanstephens 010c779
chore: go mod tidy — promote genproto/googleapis/api to direct dep
jordanstephens ac35299
Merge branch 'main' into jordan/fix-gcp-ce-monitoring
jordanstephens 15a4987
Apply suggestion from @jordanstephens
jordanstephens 35ec187
Update Nix vendorHash to sha256-zxQuu/RcVgA67++LuRs5xpDiq2e7gepkV8nqQ…
github-actions[bot] 97cd714
fix(gcp): scope MIG activity parser to deployment etag
jordanstephens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package gcp | ||
|
|
||
| import ( | ||
| "strings" | ||
| "testing" | ||
| ) | ||
|
|
||
| func TestAddComputeEngineInstanceGroupInsertOrPatch(t *testing.T) { | ||
| tests := []struct { | ||
| name string | ||
| stack string | ||
| project string | ||
| etag string | ||
| services []string | ||
| }{ | ||
| {"no args", "", "", "", nil}, | ||
| {"with all args", "my-stack", "my-project", "abc123", []string{"svc1", "svc2"}}, | ||
| {"with stack only", "my-stack", "", "", nil}, | ||
| {"with services only", "", "", "", []string{"svc1"}}, | ||
| } | ||
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| q := NewSubscribeQuery() | ||
| q.AddComputeEngineInstanceGroupInsertOrPatch(tt.stack, tt.project, tt.etag, tt.services) | ||
| query := q.GetQuery() | ||
|
|
||
| if !strings.Contains(query, `regionInstanceGroupManagers.(insert|patch)`) { | ||
| t.Errorf("query missing method name filter:\n%v", query) | ||
| } | ||
| if strings.Contains(query, "allInstancesConfig") { | ||
| t.Errorf("query must not contain allInstancesConfig label filters (PATCH requests omit labels):\n%v", query) | ||
| } | ||
| for _, label := range []string{"defang-stack", "defang-project", "defang-etag", "defang-service"} { | ||
| if strings.Contains(query, label) { | ||
| t.Errorf("query must not filter by %q label (labels absent from PATCH request body):\n%v", label, query) | ||
| } | ||
| } | ||
| }) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.