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

Add since information to properties #1117

Closed
keith-turner opened this issue Apr 23, 2019 · 3 comments · Fixed by #2190
Closed

Add since information to properties #1117

keith-turner opened this issue Apr 23, 2019 · 3 comments · Fixed by #2190
Assignees
Projects

Comments

@keith-turner
Copy link
Contributor

https://issues.apache.org/jira/browse/ACCUMULO-4592

@foster33
Copy link
Contributor

foster33 commented Jul 1, 2021

Is this still a desired addition? I was looking at potential issues to do and came by this one.

@ctubbsii
Copy link
Member

ctubbsii commented Jul 1, 2021

@foster33 Yes, this would still be a nice addition. Adding both "since" and "deprecated since", and also "replaced by", if relevant, information to the generated docs at https://accumulo.apache.org/docs/2.x/configuration/server-properties would be great. The code that generates the Markdown for that page is in core/src/main/java/org/apache/accumulo/core/conf/ConfigurationDocGen.java

For "deprecated since" you could use the @Deprecated(since = "1.6.4") annotation information. You can pull the "replaced by" information from our own @ReplacedBy annotation. You'll probably have to create some kind of @Since annotation, but you may wish to avoid using that name, so it's not confused with the built-in javadoc @since tag. Perhaps @AvailableSince?

A quick Google search and I found a tutorial about accessing annotation parameters that could be useful at https://nadundesilva.medium.com/reading-annotations-at-run-time-using-the-java-reflections-api-ce175ba43b2

Adding these in an automated way using these annotations could help us remove the same, redundant information from the description fields that we had been manually adding.

@ctubbsii
Copy link
Member

ctubbsii commented Jul 1, 2021

The original ticket did suggest using the enum constructor parameter to store this information, but annotations might be easier. It'd just be annoying to have a new annotation for every enum, since that's a lot of new lines to add to the file. It might be best to store "since" information in the enum, passed as a constructor parameter, and only use the annotations for @Deprecated and @ReplacedBy, since those are rarer. Even if this doesn't save space, it can be used to guarantee that everything gets "since" information, because parameters can be made mandatory, and it's easy to accidentally omit an annotation. Though, a unit test could be used to ensure everything's annotated with "since" information if you go that route.

@ctubbsii ctubbsii added this to To do in 2.1.0 via automation Jul 8, 2021
2.1.0 automation moved this from To do to Done Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
2.1.0
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants