OpenSearch icon indicating copy to clipboard operation
OpenSearch copied to clipboard

[BUG] Contradictory constraints highlighted in comments for snapshot name in CreateSnapshotRequest.java

Open JeffHuss opened this issue 3 years ago • 7 comments

Describe the bug I'm a technical writer for the OpenSearch Project, and I'm currently working on writing upgrade and migration documentation for OpenSearch and Elasticsearch users. As part of this process, I'm taking a snapshot of the cluster state before changing things. While investigating the snapshot API, I came across an inconsistent comment in CreateSnapshotRequest.java:

On Line 74, the comment states:

must not start with underscore ('-')

The issue is that the example character, inside the single quotes, is a hyphen and not an underscore. While we continue to improve the documentation, we sometimes rely on reviewing the code itself, or at least comments in the code, to determine what the expected behavior is, what constraints we must observe, etc. So this "just a comment" should still be accurate.

To Reproduce N/A - this is just a typo in a comment in a Java file

Expected behavior The line should either read:

must not start with underscore ('_')

or...

must not start with hyphen ('-')

Plugins Security

Screenshots N/A

Host/Environment (please complete the following information): N/A

Additional context N/A

JeffHuss avatar Feb 22 '23 20:02 JeffHuss

@JeffH-AWS if the comment is incorrect, want to PR a fix?

dblock avatar Mar 03 '23 19:03 dblock

The service enforces that the snapshot name not start with underscore. So there's an opportunity for a single character change PR here :)

andrross avatar Mar 07 '23 21:03 andrross

Hey @andrross, Can you assign that to me? It would be my first contribution! Thanks!

Renatotmmartins avatar Mar 13 '23 13:03 Renatotmmartins

@Renatotmmartins Done!

andrross avatar Mar 20 '23 15:03 andrross

@andrross I took up the issue as it was stagnant for sometime. Please review the PR

AkM-2018 avatar May 14 '23 06:05 AkM-2018

This issue can be closed as PR is merged!

AkM-2018 avatar May 18 '23 04:05 AkM-2018

Fixed by #7554

andrross avatar May 18 '23 16:05 andrross