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

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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

harshithasudhakar
Copy link
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

@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
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
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
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
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
Member Author

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

@github-actions
Copy link

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

@poorbarcode poorbarcode reopened this Sep 20, 2023
@poorbarcode poorbarcode changed the title [improve][common] Verify at least one URL is present for cluster creation [improve] [broker] Verify at least one URL is present for cluster creation Sep 20, 2023
@poorbarcode
Copy link
Contributor

@github-actions github-actions bot removed the Stale label Sep 20, 2023
@Technoboy-
Copy link
Contributor

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

Sorry for the late response. I think you can try to fix the flaky tests, it can help you understand the related function more clearly.

@harshithasudhakar
Copy link
Member Author

@Technoboy- Thank you for helping me out with this PR. Sure, I'll get started on identifying and addressing these tests and will certainly reach out for guidance when needed. If you have any specific resources or tips for getting started with this task, please do to share them.

@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
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