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 for #380. #503

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Fix for #380. #503

merged 1 commit into from
Jan 10, 2024

Conversation

DumboJetEngine
Copy link
Contributor

Description

Fix for #380.

Issues Resolved

#380.

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.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Thanks. Will need a unit test as well.


return type;

bool ShouldUnwrapType(Type ty)
Copy link
Member

Choose a reason for hiding this comment

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

Is this a pattern elsewhere in the codebase to write a function within another function? Otherwise make this private static?

Copy link
Contributor Author

@DumboJetEngine DumboJetEngine Jan 8, 2024

Choose a reason for hiding this comment

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

Apparently not.
Although, it might be because local functions are a relatively new language feature.
I can change this.

For the test, I saw that there were no tests at all for the PropertyWalker and the PropertiesExtensions that was using it was marked as internal. I will add some tests now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess I also need to update the change-log too?
Anything special I should pay attention to?

Copy link
Member

Choose a reason for hiding this comment

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

Nope, keep it short! :) Thanks much.

@DumboJetEngine
Copy link
Contributor Author

DumboJetEngine commented Jan 8, 2024

Thanks. Will need a unit test as well.

Shall I put it at Tests.Reproduce.GitHubIssue380 or this is some code area that is inherited by ElasticSearch?
I see it contains 4-digit issues in there, while OpenSearch is still using 3-digit issues. That's why I ask -- it feels weird.
Perhaps I can put it as Tests.Reproduce.PropertyWalkerTests instead...

@DumboJetEngine
Copy link
Contributor Author

DumboJetEngine commented Jan 8, 2024

I have mixed the two issues ( #380, #375 ) a bit and messed up the history. 🤦‍♂️
Shall I perhaps create the PR from scratch?
Other than that, I think the changes should be OK now.

Update: Perhaps I should move my tests inside the Tests project, and out of Tests.Reproduce.

@Xtansia
Copy link
Collaborator

Xtansia commented Jan 10, 2024

I have mixed the two issues ( #380, #375 ) a bit and messed up the history. 🤦‍♂️ Shall I perhaps create the PR from scratch? Other than that, I think the changes should be OK now.

Update: Perhaps I should move my tests inside the Tests project, and out of Tests.Reproduce.

@DumboJetEngine You don't need to completely recreate the PR, you can amend and drop the commits on your local branch as you see fit and then force push your feature branch and the content of the PR will update to match. This is preferred over closing and recreating the PR, as otherwise it can create a lot of notification spam and churn in the closed PR history.

@DumboJetEngine
Copy link
Contributor Author

@Xtansia
OK.
Done. :)
Let me know if all is OK.

Copy link
Collaborator

@Xtansia Xtansia left a comment

Choose a reason for hiding this comment

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

Thanks @DumboJetEngine, code-wise all looks good to me, just need to correct the PR number in the changelog item

CHANGELOG.md Outdated
@@ -14,6 +14,11 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Removed
- Removed the `Features` API which is not supported by OpenSearch from the low-level client ([#331](https://github.com/opensearch-project/opensearch-net/pull/331))


### Fixed
- Fixed `IEnumerable<int?>` property mapping. ([#380](https://github.com/opensearch-project/opensearch-net/pull/375))
Copy link
Collaborator

Choose a reason for hiding this comment

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

The changelog item should reference this PR's number: 503

Suggested change
- Fixed `IEnumerable<int?>` property mapping. ([#380](https://github.com/opensearch-project/opensearch-net/pull/375))
- Fixed `IEnumerable<int?>` property mapping. ([#503](https://github.com/opensearch-project/opensearch-net/pull/503))

Copy link
Collaborator

@Xtansia Xtansia left a comment

Choose a reason for hiding this comment

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

Sorry just noticed a couple other things, the test file needs a license header added, and it appears you have a space in the file name of the test file.

@@ -0,0 +1,77 @@
using System;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file needs a license header like so:

Suggested change
using System;
/* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
using System;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Anything more I need to change?

@Xtansia Xtansia merged commit afa7c7c into opensearch-project:main Jan 10, 2024
32 of 35 checks passed
@Xtansia Xtansia added the backport 1.x Backport to 1.x branch label Jan 10, 2024
@opensearch-trigger-bot
Copy link
Contributor

The backport to 1.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-503-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 afa7c7c928decdeac66feabd64c04732e1b57fe7
# Push it to GitHub
git push --set-upstream origin backport/backport-503-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x

Then, create a pull request where the base branch is 1.x and the compare/head branch is backport/backport-503-to-1.x.

@Xtansia
Copy link
Collaborator

Xtansia commented Jan 10, 2024

@DumboJetEngine Would you be able to follow the above instructions fixing any merge conflicts (almost certainly only something minor in the CHANGELOG) to backport this fix to the 1.x version line?

@DumboJetEngine
Copy link
Contributor Author

@Xtansia Yes, I think I can do this.
Tomorrow though.
I need to leave my computer now.

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

Successfully merging this pull request may close these issues.

3 participants