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

[BUG-3581] [Code Style] HttpStatus & Headers should not be imported from org.apache.hc.core5.http - Header Refactor Only #3753

Conversation

prabhask5
Copy link
Contributor

Description

Accounts for refactor of Header classes from hc.core5.http to just http by adding checkstyle test, and manually refactoring all current occurrences of the illegal import. Additionally updated spotlessApply to make the refactor automatic on future cases of illegal import.

  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Bug fix/refactor

  • Why these changes are required?

Refer to #3581

  • What is the old behavior before changes and new behavior after changes?

Ideally nothing.

Issues Resolved

Is this a backport? If so, please add backport PR # and/or commits #
No.

Testing

Tests have been modified and should work before merging.

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@prabhask5
Copy link
Contributor Author

@peternied @cwperks @scrawfor99 I refactored Header for this PR. In trying to fix the compiler issues that arose, I tried to change the import of BasicHeader from import org.apache.hc.core5.http.message.BasicHeader; to import org.apache.http.message.BasicHeader;. Let me know if this is a bad change to make. For four files the errors that arose were not because of this reason: OpensearchClientProvider.java, TestRestClient.java, MockSamlldpServer.java, RestHelper.java. It looks like for these files the error is trying to pass the new Header import into a function that only takes in the old Header import. I cannot change these functions because they are outside the security repo. Any other ideas on how to fix these?

@peternied
Copy link
Member

@prabhask5, thanks for your work on the issue [1]. In open-source projects, contributors are expected to not just find issues but also seek solutions, deepening their understanding of the codebase. I suggest you further explore how your changes affect the existing code. If it's too complex, maybe try another project aspect. Remember, as maintainers, we guide and review, but you're responsible for developing and testing solutions.

We're here for feedback and help with any specific questions!

@prabhask5
Copy link
Contributor Author

prabhask5 commented Nov 21, 2023

@prabhask5, thanks for your work on the issue [1]. In open-source projects, contributors are expected to not just find issues but also seek solutions, deepening their understanding of the codebase. I suggest you further explore how your changes affect the existing code. If it's too complex, maybe try another project aspect. Remember, as maintainers, we guide and review, but you're responsible for developing and testing solutions.

We're here for feedback and help with any specific questions!

@peternied Thanks for the comment, I’ll work to do so! Just to check though, is the basic header change a valid change in this context or should I figure this out without making any other import changes? Tysm!

@peternied
Copy link
Member

Doesn't look like this is being worked on anymore, going to close this out. Please feel free to reopen if you re-engage on this @prabhask5

@peternied peternied closed this Dec 8, 2023
@prabhask5 prabhask5 deleted the pk-refactor-core5-header-imports branch July 10, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants