feat(environments): cross-environment bulk operations#5536
Draft
markphelps wants to merge 31 commits into
Draft
Conversation
Add CopyResource, CopyNamespace, and BulkApplyResources RPCs to the EnvironmentsService along with supporting enums (ConflictStrategy, BulkOperation, OperationStatus) and request/response messages. Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Add Validate() methods for CopyResourceRequest, CopyNamespaceRequest, and BulkApplyResourcesRequest to enforce required fields. Add Request() methods for authorization, requiring appropriate read/update permissions on source and target environments. Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Same-environment copy (across namespaces) remains available to all users. Only cross-environment copy requires a Pro license. Also removes dead copyFlag/copySegment client-side mutations that were replaced by the server-side CopyResource RPC. Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Add CopyResource, CopyNamespace, and BulkApplyResources to both the gRPC SDK wrapper and the HTTP transport client. Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Document that v1/v2 SDK .sdk.gen.go files are now maintained by hand (no longer generated via protoc plugin). Covers the three-layer architecture and step-by-step guide for adding new RPCs. Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Contributor
|
The latest Buf updates on your PR. Results from workflow Proto / proto-lint (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2 #5536 +/- ##
==========================================
+ Coverage 60.70% 61.00% +0.29%
==========================================
Files 141 141
Lines 14023 14339 +316
==========================================
+ Hits 8513 8747 +234
- Misses 4784 4823 +39
- Partials 726 769 +43
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When using SKIP or FAIL conflict strategies, the copy operations previously called tgtEnv.Update() even when no writes were needed, causing "cannot create empty commit: clean working tree" errors. Now we pre-check resource existence via View() and only call Update() when there are actual resources to write (create or overwrite). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
…ror message The integration test expects the conflict error message to contain "already exists", but ErrAlreadyExistsf only stores the format string as-is without adding a prefix. Updated the format string to include "already exists" for consistency with the CopyResource error path. Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Resolve conflicts in generated protobuf and SDK files by regenerating from proto definitions after merge. Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
- Return error for unknown bulk operation instead of silent success - Validate source_environment_key and source_namespace_key in CopyNamespaceRequest - Cap publisher goroutines at 100 via semaphore (restores concurrency limit) - Chain revisions sequentially in bulk copy UI instead of parallel requests Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Add a read-only "Environments" tab showing a flag's state across all base environments. Each environment row fetches the flag independently via GetResource, displaying enabled/disabled state, variant/rule/rollout counts, and a drift indicator for structural differences. - Extract shared compare helpers to ui/src/utils/compare.ts - Add FlagEnvironments component with per-environment row queries - Add "Environments" tab to both variant and boolean flag tab arrays - Add 20 unit tests for compare utility functions - Refactor Compare.tsx to import from shared utils Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
- Add dark mode classes to Compare page Pro upsell banner - Add flex-wrap to FlagEnvironments rows for narrow screens - Replace "Loading..." text with animated skeleton placeholders Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR simplifies the v2 copy/apply API surface and extends
BulkApplyResourcesto target multiple environments in a single request.Changes
CopyResourcefromEnvironmentsService.CopyNamespaceBulkApplyResourcesCopyResourceRequest/CopyResourceResponseproto messages.BulkApplyResourcesRequestwithenvironment_keys(optional target environments list).BulkApplyNamespaceResultwithenvironment_keyso responses are unambiguous across environment+namespace targets.revisionbehavior for the primaryenvironment_keypath binding.rpc/v2/environments/environments.pb.gorpc/v2/environments/environments_grpc.pb.gorpc/v2/environments/environments.pb.gw.gorpc/v2/environments/openapi.yamlBulkApplyResourcesinstead of/resources/copyfrom earlier commits in this branch.Naming Note
BulkApplyResourcesremains the RPC name because it supports non-copy operations (CREATE,UPDATE,DELETE,UPSERT) in addition to copy-like workflows.Backward Compatibility
This is a v2 pre-release API shape change in PR scope (not yet live), so removing
CopyResourceand extendingBulkApplyResourcesis intentional.Additional Notes
feat/cross-env-operationsf0196732