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

fix(IAM Policy Management): remove options property from PolicyAssignment #248

Merged
merged 6 commits into from
Jul 5, 2024

Conversation

siddhuvarma1997
Copy link
Contributor

@siddhuvarma1997 siddhuvarma1997 commented Jul 1, 2024

PR summary

PR Checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Current vs new behavior

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Signed-off-by: Alluri-Varma <alluri.varma@ibm.com>
@CLAassistant
Copy link

CLAassistant commented Jul 1, 2024

CLA assistant check
All committers have signed the CLA.

@siddhuvarma1997
Copy link
Contributor Author

integration tests:
image
image

@siddhuvarma1997 siddhuvarma1997 marked this pull request as ready for review July 1, 2024 20:42
Signed-off-by: Alluri-Varma <alluri.varma@ibm.com>
Signed-off-by: Alluri-Varma <alluri.varma@ibm.com>
@pyrooka pyrooka self-requested a review July 3, 2024 13:17
Copy link
Member

@pyrooka pyrooka left a comment

Choose a reason for hiding this comment

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

Most of the changes look good, but need to improve the code style here and there. Also, don't forget to sign the CLA!

Comment on lines 1203 to 1229
@Test(dependsOnMethods = { "testCreateS2SPolicyTemplate" })
public void testCreatePolicyAssignmentError() throws Exception {
try{
AssignmentTargetDetails assignmentTargetDetails = new AssignmentTargetDetails.Builder()
.type("Enterprise")
.id(testTargetEnterpriseAccountId)
.build();

AssignmentTemplateDetails assignmentTemplateDetails = new AssignmentTemplateDetails.Builder()
.id(testS2STemplateId)
.version(testS2SBaseTemplateVersion)
.build();


CreatePolicyTemplateAssignmentOptions createPolicyAssignmentOptions = new CreatePolicyTemplateAssignmentOptions.Builder()
.version("1.0")
.target(assignmentTargetDetails)
.templates(new ArrayList<AssignmentTemplateDetails>(Arrays.asList(assignmentTemplateDetails)))
.build();
Response<PolicyAssignmentV1Collection> response = service.createPolicyTemplateAssignment(createPolicyAssignmentOptions).execute();
} catch (BadRequestException e) {
assertEquals(e.getStatusCode(), 400);
assertEquals(e.getMessage(), "Invalid body format. Check the input parameters. instance.target.type is not one of enum values: Account");
}

}

Copy link
Member

Choose a reason for hiding this comment

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

Please format this code block (testCreatePolicyAssignmentError()) with a formatter, because it contains missing spaces (like in the try{ statement) and wrong indentation (the whole try block) and so on.

PolicyAssignmentV1Options assignmentV1Options = new PolicyAssignmentV1Options.Builder()
.root(rootAssignmentDetails)
.build();

Copy link
Member

Choose a reason for hiding this comment

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

I thinks there should be only a single new line here.

Suggested change

siddhualluri and others added 3 commits July 4, 2024 11:04
Signed-off-by: Alluri-Varma <alluri.varma@ibm.com>
Signed-off-by: Norbert Biczo <pyrooka@users.noreply.github.com>
Signed-off-by: Norbert Biczo <pyrooka@users.noreply.github.com>
Copy link
Member

@pyrooka pyrooka left a comment

Choose a reason for hiding this comment

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

@siddhualluri @siddhuvarma1997 Please attach the result of the example test run and sign the CLA!

@siddhuvarma1997
Copy link
Contributor Author

example tests:
image

Copy link
Member

@pyrooka pyrooka left a comment

Choose a reason for hiding this comment

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

Although there is an error in the examples test run I approve this, because overall the build succeeded and I see no reason the examples to fail because the change is pretty straightforward and simple.
(cc @padamstx you might have some thoughts on this.)

@pyrooka pyrooka changed the title fix(IAM Policy Assignment): S2S Policy Assignments fix(IAM Policy Management): remove options property from PolicyAssignment Jul 5, 2024
@pyrooka pyrooka merged commit 9897bb5 into main Jul 5, 2024
4 checks passed
@pyrooka pyrooka deleted the s2sassignmentapi branch July 5, 2024 15:26
ibm-devx-sdk pushed a commit that referenced this pull request Jul 5, 2024
## [0.54.2](0.54.1...0.54.2) (2024-07-05)

### Bug Fixes

* **IAM Policy Management:** remove `options` property from PolicyAssignment ([#248](#248)) ([9897bb5](9897bb5))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 0.54.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants