Skip to content

SREP-2441: Return the body of the error when backplane-api is unable to assume role#825

Merged
openshift-merge-bot[bot] merged 3 commits intoopenshift:mainfrom
ratnam915:feature/SREP-2441
Nov 8, 2025
Merged

SREP-2441: Return the body of the error when backplane-api is unable to assume role#825
openshift-merge-bot[bot] merged 3 commits intoopenshift:mainfrom
ratnam915:feature/SREP-2441

Conversation

@ratnam915
Copy link
Contributor

This PR has been created to address the issue of backplane-cli gets an error from backplane-api while it is assuming a role
and only the status code 500 is displayed, this PR address the issue by printing the response body along with the error.

Changes made to common.go

Unit test coverage for code changes carried out in common_test.go

As part of testing below is the change:

Error before:

ERRO[0015] failed to get cloud console for cluster 2mbm2lqoknnr4sn73utv5ar93a61dhb3: failed to assume role with isolated backplane flow: failed to fetch arn sequence: 500 Internal Server Error

Error after code change:

ERRO[0015] failed to get cloud console for cluster 2mbm2lqoknnr4sn73utv5ar93a61dhb3: failed to assume role with isolated backplane flow: failed to fetch arn sequence: error from backplane:
Status Code: 500
Message: error occurred for type assume-role-sequence, error: failed to assume orgrole: AccessDenied: User is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789012:role/TestRole
(response body: {"statusCode":500,"message":"error occurred for type assume-role-sequence, error: failed to assume orgrole: AccessDenied: User is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789012:role/TestRole","reason":"InternalError","details":{"error":"AWS STS AssumeRole failed","roleArn":"arn:aws:iam::123456789012:role/TestRole"}})

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 6, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 6, 2025

@ratnam915: This pull request references SREP-2441 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

Details

In response to this:

This PR has been created to address the issue of backplane-cli gets an error from backplane-api while it is assuming a role
and only the status code 500 is displayed, this PR address the issue by printing the response body along with the error.

Changes made to common.go

Unit test coverage for code changes carried out in common_test.go

As part of testing below is the change:

Error before:

ERRO[0015] failed to get cloud console for cluster 2mbm2lqoknnr4sn73utv5ar93a61dhb3: failed to assume role with isolated backplane flow: failed to fetch arn sequence: 500 Internal Server Error

Error after code change:

ERRO[0015] failed to get cloud console for cluster 2mbm2lqoknnr4sn73utv5ar93a61dhb3: failed to assume role with isolated backplane flow: failed to fetch arn sequence: error from backplane:
Status Code: 500
Message: error occurred for type assume-role-sequence, error: failed to assume orgrole: AccessDenied: User is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789012:role/TestRole
(response body: {"statusCode":500,"message":"error occurred for type assume-role-sequence, error: failed to assume orgrole: AccessDenied: User is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789012:role/TestRole","reason":"InternalError","details":{"error":"AWS STS AssumeRole failed","roleArn":"arn:aws:iam::123456789012:role/TestRole"}})

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from diakovnec and smarthall November 6, 2025 06:05
@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 53.18%. Comparing base (1734520) to head (d7df842).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
cmd/ocm-backplane/cloud/common.go 90.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #825      +/-   ##
==========================================
+ Coverage   52.85%   53.18%   +0.33%     
==========================================
  Files          86       86              
  Lines        6421     6430       +9     
==========================================
+ Hits         3394     3420      +26     
+ Misses       2576     2554      -22     
- Partials      451      456       +5     
Files with missing lines Coverage Δ
cmd/ocm-backplane/cloud/common.go 56.07% <90.00%> (+1.58%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ratnam915
Copy link
Contributor Author

/test images

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 7, 2025

@ratnam915: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@samanthajayasinghe
Copy link
Contributor

/label tide/merge-method-squash

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Nov 8, 2025
@samanthajayasinghe
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ratnam915, samanthajayasinghe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 8beb0d5 into openshift:main Nov 8, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants