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

Add async operation support to dynamic-rp #8161

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

rynowak
Copy link
Contributor

@rynowak rynowak commented Dec 20, 2024

Description

This change adds the async operationStatus and operationResult handlers to the dynamic-rp API. This change is significant, because like all functionality in dynamic-rp, it's dynamic and needs to work for any UDT resource provider rather than a fixed namespace.

Type of change

  • This pull request adds or changes features of Radius and has an approved issue (issue link required).

Fixes: #6688

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
  • A design document PR is created in the design-notes repository, if new APIs are being introduced.
  • If applicable, design document has been reviewed and approved by Radius maintainers/approvers.
  • A PR for the samples repository is created, if existing samples are affected by the changes in this PR.
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.

This change adds the async operationStatus and operationResult handlers to the dynamic-rp API. This change is significant, because like all functionality in dynamic-rp, it's dynamic and needs to work for any UDT resource provider rather than a fixed namespace.

Signed-off-by: Ryan Nowak <[email protected]>
@rynowak rynowak requested review from a team as code owners December 20, 2024 20:44
}

err = databaseClient.Save(ctx, &database.Object{Data: operation, Metadata: database.Metadata{ID: operationStatusID}})
require.NoError(t, err)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the cool things about the integration-testing approach is that we can just manipulate the database if we need to simulate something tricky for a test 👍

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 69.73684% with 23 lines in your changes missing coverage. Please review.

Project coverage is 60.05%. Comparing base (defd40b) to head (b3f4945).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/dynamicrp/frontend/operations.go 56.25% 12 Missing and 2 partials ⚠️
pkg/armrpc/asyncoperation/worker/worker.go 40.00% 2 Missing and 1 partial ⚠️
pkg/dynamicrp/frontend/routes.go 85.71% 2 Missing and 1 partial ⚠️
pkg/dynamicrp/frontend/service.go 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8161   +/-   ##
=======================================
  Coverage   60.04%   60.05%           
=======================================
  Files         580      581    +1     
  Lines       38469    38536   +67     
=======================================
+ Hits        23097    23141   +44     
- Misses      13678    13696   +18     
- Partials     1694     1699    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pkg/armrpc/asyncoperation/worker/worker.go Show resolved Hide resolved
Comment on lines +70 to +72
if strings.HasSuffix(strings.ToLower(opts.ResourceType), "locations/operationstatuses") || strings.HasSuffix(strings.ToLower(opts.ResourceType), "locations/operationresults") {
opts.ResourceType = id.ProviderNamespace() + "/operationstatuses"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In either case, why do we set the Resource Type to operationStatuses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments right above here explain this, please make a suggestion if it's not clear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked that we only have one for both which is Applications.Core/operationStatuses. Thanks.

@rynowak rynowak temporarily deployed to functional-tests December 20, 2024 21:57 — with GitHub Actions Inactive
@radius-functional-tests
Copy link

radius-functional-tests bot commented Dec 20, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository rynowak/radius
Commit ref b3f4945
Unique ID funcb860887273
Image tag pr-funcb860887273
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcb860887273
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funcb860887273
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcb860887273
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcb860887273
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcb860887273
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@rynowak rynowak merged commit 6b8ef42 into radius-project:main Dec 20, 2024
29 checks passed
@rynowak rynowak deleted the dynamic-rp-asyncoperations branch December 20, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User-Defined Resource Types
2 participants