Skip to content

[improve] [broker] Verify at least one URL is present for cluster creation#20821

Open
harshithasudhakar wants to merge 15 commits intoapache:masterfrom
harshithasudhakar:patch-1
Open

[improve] [broker] Verify at least one URL is present for cluster creation#20821
harshithasudhakar wants to merge 15 commits intoapache:masterfrom
harshithasudhakar:patch-1

Conversation

@harshithasudhakar
Copy link
Copy Markdown
Member

@harshithasudhakar harshithasudhakar commented Jul 17, 2023

Fixes #5638

Main/Original Issue: apache#19866

Motivation

Modifications

Checking if serviceUrl, serviceUrlTls, brokerServiceUrl, or brokerServiceUrlTls are not null. Then proceeds to throw IllegalArgumentException if either of serviceUrl, serviceUrlTls or brokerServiceUrl, brokerServiceUrlTls has not been set.

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Checking if `serviceUrl`, `serviceUrlTls`, `brokerServiceUrl`, or `brokerServiceUrlTls` are not null. Then proceeds to throw `IllegalArgumentException` if either of `serviceUrl`, `serviceUrlTls` or `brokerServiceUrl`,  `brokerServiceUrlTls` has not been set.
@github-actions
Copy link
Copy Markdown

@harshithasudhakar Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Jul 17, 2023
@harshithasudhakar harshithasudhakar changed the title Update ClusterDataImpl.java [Enhancement] Verify at least one URL is present for cluster creation Jul 17, 2023
Copy link
Copy Markdown
Contributor

@Technoboy- Technoboy- left a comment

Choose a reason for hiding this comment

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

Could we use StringUtils.isEmpty(getServiceUrl()) && StringUtils.isEmpty(getServiceUrlTls()) to reduce the codes ?

Copy link
Copy Markdown
Contributor

@poorbarcode poorbarcode left a comment

Choose a reason for hiding this comment

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

Could you add a test for this change?

Used StringUtils.isEmpty(getServiceUrl()) && StringUtils.isEmpty(getServiceUrlTls()) to reduce the codes
@poorbarcode poorbarcode added this to the 3.2.0 milestone Jul 24, 2023
@Technoboy- Technoboy- changed the title [Enhancement] Verify at least one URL is present for cluster creation [improve][common] Verify at least one URL is present for cluster creation Jul 24, 2023
@harshithasudhakar
Copy link
Copy Markdown
Member Author

@poorbarcode I have made two testcases to make sure at least one URL is set.

Changes:

1. testUpdateClusterServiceUrl(): Tests API for updating cluster's Service URL, and checks if the retrieved serviceURL matches with it.

2. testUpdateClusterBrokerServiceUrl(): Tests API for updating cluster's Service Broker URL, and checks if the retrieved serviceBrokerURL matches with it.
@harshithasudhakar
Copy link
Copy Markdown
Member Author

harshithasudhakar commented Aug 11, 2023

@poorbarcode @Technoboy-
I made the following changes in AdminApi2Test:

  1. testUpdateClusterServiceUrl(): Tests API for updating cluster's Service URL, and checks if the retrieved serviceURL matches with it.

  2. testUpdateClusterBrokerServiceUrl(): Tests API for updating cluster's Service Broker URL, and checks if the retrieved serviceBrokerURL matches with it.

@harshithasudhakar
Copy link
Copy Markdown
Member Author

@poorbarcode @Technoboy- Hi, are there any other similar issues I can work on?

@github-actions
Copy link
Copy Markdown

The pr had no activity for 30 days, mark with Stale label.

@Technoboy- Technoboy- modified the milestones: 3.2.0, 3.3.0 Dec 22, 2023
@coderzc coderzc modified the milestones: 3.3.0, 3.4.0 May 8, 2024
@harshithasudhakar
Copy link
Copy Markdown
Member Author

Hi, I'd like to fix the errors in this PR but I'm unable to find the log files for this. Can you help me out? How can I run the tests again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants