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

[v15] Teleterm: add new access request fields (#39050) #39320

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

kimlisa
Copy link
Contributor

@kimlisa kimlisa commented Mar 14, 2024

backport #39050 to branch/v15

manual because there was a conflict with service.pb.go, resolved by running make grpc

Copy link

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@kimlisa kimlisa added the no-changelog Indicates that a PR does not require a changelog entry label Mar 14, 2024
};
export type CreateAccessRequestParams =
apiService.CreateAccessRequestRequest & {
rootClusterUri: uri.RootClusterUri;
Copy link
Member

Choose a reason for hiding this comment

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

Only because of your comment under that PR with dates I noticed that you want to backport to v14 too. In that case, our advice with using types.CreateAccessRequestParams directly and not mapping it goes out of the window, because v14 doesn't have protobuf-ts.

This means on v14 we won't be able to simply do…

export type CreateAccessRequestParams =
  apiService.CreateAccessRequestRequest & …

…because on that branch, apiService.CreateAccessRequestRequest is a class and not a simple object.

IIRC, you can try doing this and see where it takes you:

export type CreateAccessRequestParams =
  apiService.CreateAccessRequestRequest.AsObject & …

@@ -295,21 +295,8 @@ export function createTshdClient(
},

async createAccessRequest(params: types.CreateAccessRequestParams) {
const req = api.CreateAccessRequestRequest.create({
Copy link
Member

Choose a reason for hiding this comment

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

On v14, params have to be converted to a class. This means you'll have to call setters for the fields added in this PR, just like it's done for other fields already.

async createAccessRequest(params: types.CreateAccessRequestParams) {
const req = new api.CreateAccessRequestRequest()
.setRootClusterUri(params.rootClusterUri)
.setSuggestedReviewersList(params.suggestedReviewers)
.setRolesList(params.roles)
.setResourceIdsList(
params.resourceIds.map(({ id, clusterName, kind }) => {
const resourceId = new ResourceID();
resourceId.setName(id);
resourceId.setClusterName(clusterName);
resourceId.setKind(kind);
return resourceId;
})
)
.setReason(params.reason);

@kimlisa kimlisa enabled auto-merge March 14, 2024 16:46
@kimlisa kimlisa added this pull request to the merge queue Mar 14, 2024
Merged via the queue into branch/v15 with commit ac3b343 Mar 14, 2024
38 checks passed
@kimlisa kimlisa deleted the lisa/15/teleterm-update-ar-typing branch March 14, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport no-changelog Indicates that a PR does not require a changelog entry size/md ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants